Package-level declarations
The clients (SportsDbClient, SportsDbFutures), their configuration, the v1 and v2 endpoint groups, Helpers for common tasks (v2 or v1 depending on the key), and the exceptions.
Types
The API answered with a {"Message": ...} body this library does not recognise.
Common tasks in one call. Each helper picks the best endpoint for your key: v2 with a premium key, v1 with the free key 123 (and then the free key's small result limits apply, as noted on each method). Any key other than 123 that the API accepts is a paid key, so no extra call is made to find out.
Any other non-2xx HTTP response. bodySnippet is the start of the response body.
The API rejected the key (HTTP 400 Invalid Premium API key). Only 123 and paid keys work.
The request failed before an HTTP response arrived (DNS, connection, timeout...).
A v2 endpoint was called with the free key. v2 accepts premium keys only.
The rate limit was exceeded (HTTP 429) and retries were used up or disabled. retryAfter is how long the server asked to wait, when it said.
One finished API call.
Receives one RequestEvent per API call, after it finishes. Set it with SportsDbConfig.requestListener. It runs on the calling coroutine, so keep it quick. Exceptions it throws are ignored, so a broken listener can't break API calls.
The response body could not be understood as a TheSportsDB envelope.
The TheSportsDB client.
Client settings. Build with SportsDbClient's DSL:
Base class for every error this library throws.
A Java-friendly wrapper: every SportsDbClient method, returning a CompletableFuture.
The v2 API: https://www.thesportsdb.com/api/v2/json/{group}/{name}/{param}, with the key in the X-API-KEY header. Premium keys only: with the free key every call throws PremiumRequiredException without touching the network.