Skip to content
datasportsAPI

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_…

live.ts
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");
key from DATASPORTSAPI_API_KEYTypeScript guide

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.

Capabilities of each client and the name each language uses
CapabilityTypeScriptPythonGodsa CLI
Reads the key fromDATASPORTSAPI_API_KEYDATASPORTSAPI_API_KEYDATASPORTSAPI_API_KEYdsa login · DATASPORTSAPI_API_KEY
Typed responsesTS typesTypedDictstructsNot applicable
Walk every pagefixturesPages()fixtures_pages()FixturesPages()--all
ConcurrencyPromisesAsyncDataSportsAPIcontext.ContextNot applicable
Retries 429 rate_limited + 503After Retry-After, twice by defaultmaxRetriesmax_retriesWithMaxRetries--max-retries
Live stream (Business)Ticket, reconnect, replay and merge built inclient.stream()client.stream()client.Stream()dsa watch
Output formatsNot applicableNot applicableNot applicablejson · 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.

  1. 429rate_limited

    Retried: Wait Retry-After, then retry

  2. 503upstream_unavailable

    Retried: Wait Retry-After, then retry

  3. 429quota_exceeded

    Not 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.

shell
$ 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.json

AI 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.txt
  • https://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.