SDKs & CLI
Clients that already know the rules.
Typed SDKs for TypeScript, Python and Go, plus the dsa command for your terminal. Each one reads DATASPORTSAPI_API_KEY, waits out a rate limit by itself, walks the pages for you and, on Business, keeps a live stream merged.
Not published yet
None of the packages is on npm, PyPI or the Go module proxy yet. The install lines here are the real ones and start working with the first release. Until then, call the REST API directly: every endpoint page has a cURL line.
# goes live with the first release — not on a registry yet
~/app $ npm install datasportsapi
~/app $ export DATASPORTSAPI_API_KEY=dsa_live_…
import { DataSportsAPI } from "datasportsapi";
const client = new DataSportsAPI(); // reads DATASPORTSAPI_API_KEY
const { data } = await client.livescores.list({ sport: "football" });
console.log(data.length, "matches in play");Pick your client
Four ways in, all maintained by us.
Each client covers every endpoint in the catalog, and every endpoint page in the docs shows the call in all four, next to the cURL line.
Side by side
Same behaviour, native names.
The clients agree on what they do and differ only in how each language spells it. This is the cheat sheet.
| Capability | TypeScript | Python | Go | dsa CLI |
|---|---|---|---|---|
| Reads the key from | DATASPORTSAPI_API_KEY | DATASPORTSAPI_API_KEY | DATASPORTSAPI_API_KEY | dsa login · DATASPORTSAPI_API_KEY |
| Typed responses | TS types | TypedDict | structs | Not applicable |
| Walk every page | fixturesPages() | fixtures_pages() | FixturesPages() | --all |
| Concurrency | Promises | AsyncDataSportsAPI | context.Context | Not applicable |
| Retries 429 rate_limited + 503After Retry-After, twice by default | maxRetries | max_retries | WithMaxRetries | --max-retries |
| Live stream (Business)Ticket, reconnect, replay and merge built in | client.stream() | client.stream() | client.Stream() | dsa watch |
| Output formats | Not applicable | Not applicable | Not applicable | json · jsonl · table · csv |
Built-in retries
When the API says wait, the client waits.
Two kinds of answer clear up on their own, so every client retries them after the Retry-After the API sends, up to twice by default. Running out of quota does not clear up in seconds, so that one comes straight back to you with the time until the reset.
- 429
rate_limitedRetried: Wait Retry-After, then retry
- 503
upstream_unavailableRetried: Wait Retry-After, then retry
- 429
quota_exceededNot retried: Raise at once, with retryAfter until the reset
A 429 rate_limited answer is not counted against your quota. Change the retry count with maxRetries, max_retries, WithMaxRetries or --max-retries.
Any language
No SDK? HTTPS and JSON will do.
Each REST call is ordinary HTTPS with your key in the Authorization header, and nearly all of them are a simple GET. An OpenAPI 3.1 document describes the whole contract for code generators, and downloading it needs no key.
$ curl -H "Authorization: Bearer dsa_live_…" \
"https://api.datasportsapi.com/v2/livescores?sport=football"
# OpenAPI 3.1, no key needed
$ curl -O https://api.datasportsapi.com/v2/openapi.jsonAI assistants
Docs your coding agent can read.
The docs are also published as plain Markdown that an AI assistant can take in at once. Give it the short index for an overview, or the full file when it should know every endpoint and field.
https://datasportsapi.com/llms.txthttps://datasportsapi.com/llms-full.txt
Published alongside the first release, like the packages.
The live stream helpers need a Business key; everything else works on every plan, Free included.
Get a key, then pick a client.
1,000 free requests a day during the beta. No card, no sales call.