Streaming as a Service

Streaming API

Stream catalog

List and filter streams, read their renditions, and understand which streams your key can see.

List streams

curl -s "https://platform-api.altsportsleagues.ai/v1/streams?status=live&language=es" \
  -H "Authorization: Bearer $ASD_API_KEY"
ParameterMeaning
statusscheduled, live or ended
event_idA spine event ID (64 lowercase hex characters) from Data as a Service, such as one from /v1/{sport}/events
sportA sport key, for example smx
leagueExact league name, not case sensitive
languageA language tag such as en, es or pt-br: only streams with audio in that language
limit1 to 100, default 20
page_tokenThe next_page_token from the previous page

Streams come newest-registered first (by when they were added, not by start time). Pagination works as in Pagination and filters: pass next_page_token back as page_token until it is null. A token is tied to the filters it was issued with.

What a stream looks like

{
  "object": "stream",
  "id": "str_…",
  "event_id": "9c2e41f0…",
  "sport": "smx",
  "league_name": "…",
  "title": "…",
  "status": "live",
  "starts_at": "…",
  "ended_at": null,
  "provider": "…",
  "master_hls_url": "https://…/master.m3u8",
  "renditions": [
    { "kind": "video", "language": null, "label": "…", "hls_url": "https://…" },
    { "kind": "audio", "language": "en", "label": "English", "hls_url": "https://…" },
    { "kind": "audio", "language": "es", "label": "Español", "hls_url": "https://…" }
  ],
  "available_languages": ["en", "es"],
  "created_at": "…",
  "updated_at": "…"
}

The shape above follows the API's schema; values are placeholders because the catalog has no streams yet. Use master_hls_url with a player that handles audio tracks, or pick a single rendition's hls_url. The playlist host is given in each stream item, so read it from the response instead of building URLs yourself.

Today each stream has one video rendition. Check renditions[] for kind: "video" rather than assuming one.

How streams get into the catalog

Streams are added by ALT Sports Data. There is no registration API yet, so you cannot register or list a stream of your own through the API. If you have a feed you want carried, contact ALT Sports Data.

Join streams to your data

event_id on a stream is the same ID that Data as a Service returns, so you can go from a schedule straight to video:

events = requests.get(f"{BASE_URL}/v1/smx/events", headers=headers,
                      params={"sort": "-start_date", "limit": 5}, timeout=65).json()["data"]
for event in events:
    streams = requests.get(f"{BASE_URL}/v1/streams", headers=headers,
                           params={"event_id": event["event_id"]}, timeout=30).json()["data"]
    print(event["event_name"], [s["master_hls_url"] for s in streams])
const events = (await (await fetch(`${BASE_URL}/v1/smx/events?sort=-start_date&limit=5`, { headers })).json()).data;
for (const event of events) {
  const streams = (await (await fetch(`${BASE_URL}/v1/streams?event_id=${event.event_id}`, { headers })).json()).data;
  console.log(event.event_name, streams.map((s: { master_hls_url: string }) => s.master_hls_url));
}

Odds event IDs from /v1/odds/* do not match spine event IDs, so you cannot look streams up by an odds ID. See IDs, grades and data basis.

Which streams your key sees

Streams follow the service-wide sport reach. Asking for ?sport= outside your key's sports returns 403 forbidden_sport, and an unfiltered list only includes sports you can read. During the preview every key can read all sports.

Costs and limits

Both stream endpoints cost 0 credits. They count toward your key's shared rate limit, and responses can be cached for 30 seconds (Cache-Control: private, max-age=30). An empty list means no stream matches; it never means the catalog is unreachable, which is reported as 500 internal_error. The API blocks calls from other websites' browser pages (CORS), so call it from your server.

On this page