A minimal Ruby example using only the standard library (net/http + json) to call the TCG Price Lookup API. No third-party gems required.
TCGLOOKUP_API_KEY=tlk_live_... ruby search.rbRequires Ruby 2.7+. Get a free API key at tcgpricelookup.com/tcg-api.
- A self-contained
TcgLookupClientclass — about 50 lines client.get('/cards/search', q: ..., game: ..., limit: ...)— search across every supported TCGclient.get("/cards/#{id}")— fetch the full price block for a single card- Custom
TcgLookupErrorexception with status + body - Reading rate-limit headers from the most recent response
A native tcglookup Ruby gem isn't published yet. If you want one, open an issue — until then, this single file is enough to build production apps. The HTTP layer is small and the API surface is stable.
- See the full developer ecosystem at github.com/TCG-Price-Lookup/awesome-tcg
- Browse other languages in tcg-api-examples