Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

README.md

Ruby example — TCG Price Lookup API

A minimal Ruby example using only the standard library (net/http + json) to call the TCG Price Lookup API. No third-party gems required.

Run

TCGLOOKUP_API_KEY=tlk_live_... ruby search.rb

Requires Ruby 2.7+. Get a free API key at tcgpricelookup.com/tcg-api.

What it shows

  • A self-contained TcgLookupClient class — about 50 lines
  • client.get('/cards/search', q: ..., game: ..., limit: ...) — search across every supported TCG
  • client.get("/cards/#{id}") — fetch the full price block for a single card
  • Custom TcgLookupError exception with status + body
  • Reading rate-limit headers from the most recent response

Why no gem?

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.

Build something bigger