Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

C# example — TCG Price Lookup API

A minimal .NET 6+ example calling the TCG Price Lookup API using only HttpClient and System.Text.Json from the standard library — no NuGet packages required.

Run

TCGLOOKUP_API_KEY=tlk_live_... dotnet run

Requires .NET 6+ (top-level statements + System.Text.Json). Get a free API key at tcgpricelookup.com/tcg-api.

What it shows

  • A self-contained TcgLookupClient class
  • GetAsync("/cards/search", new() { ["q"] = ..., ["game"] = ... }) — search across every supported TCG
  • GetAsync($"/cards/{id}", new()) — fetch the full price block for a single card
  • Custom TcgLookupException with status code, plus catch when filters for 403 / 429
  • Reading rate-limit headers from client.RateLimitRemaining / client.RateLimitTotal

Why no NuGet?

A native Tcglookup NuGet package 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