A self-contained Java 11+ example that calls the TCG Price Lookup API using only the JDK standard library — no Maven, no Gradle, no third-party dependencies.
TCGLOOKUP_API_KEY=tlk_live_... java Search.javaRequires Java 11+ (uses java.net.http.HttpClient and the single-file launcher introduced in JDK 11). Get a free API key at tcgpricelookup.com/tcg-api.
- A self-contained
TcgLookupClientinner class - Search by name + game, then fetch the top hit's full price block
- Custom
TcgLookupExceptionwith status code - Reading rate-limit headers
- A tiny zero-dependency JSON parser (
MiniJson) — handles the subset of JSON the API returns
To keep this example a single self-contained file you can run with java Search.java. For production code, drop in Jackson or Gson for proper JSON handling and use a real build tool.
A native tcglookup Java SDK isn't published yet. If you want one, open an issue.
- See the full developer ecosystem at github.com/TCG-Price-Lookup/awesome-tcg
- Browse other languages in tcg-api-examples