Overview

One stable payload for the whole match picture

SportsSync returns match identity, teams, intel, opening lines, market, injuries, and metadata in one response, so the buyer does not need to stitch feeds or normalize partial data by hand.

Canonical v1 metadata key is api_version. Public examples in these docs use placeholders, not exposed live credentials.
Fixed top-level shape Every response includes the same 7 sections.
Graceful degradation Missing sections return available: false.
Fast first call Start with a published sample ID, then swap in your own match ID.

Base URL

https://hylnixnuabtnmjcdnujm.supabase.co/functions/v1
Quickstart

First successful call

Use a sandbox key, pick one of the published sample IDs, then hit /match-context. The browser demo at /demo/index.html calls a server proxy that only serves the published sample IDs, so no production integration key is exposed client-side.

Step What to do
1 Email api@sportsync.io for a sandbox key.
2 Pick a public sample match ID from the table below.
3 Send a GET request with x-api-key and match_id.

Published sample IDs

Match match_id
EPL · Arsenal vs Man Cityb193b51f-cbed-4398-a297-237dd3322607
WC26 · USA vs Mexicob42fe447-b2b1-485f-ae6d-1559ee2b57c7
NBA · Lakers vs Celticsd6742e61-2457-43fd-aa3f-e61f6a76c7af
WC26 · England vs Brazilc94d7e01-333d-41cd-a67d-cc0285fa7f28
Authentication

Use the API key header

Production and sandbox calls both authenticate with the x-api-key header.

x-api-key: YOUR_SANDBOX_OR_PRODUCTION_KEY

Do not embed your production key in public browser code. If you want a public-facing demo, proxy the call on the server and only allow published sample IDs.

Endpoint

Request shape

GET /match-context?match_id=<source_or_uuid>&league=<optional>

Name Type Required Notes
match_idstringYesPublished source ID or canonical UUID.
leaguestringNoOptional filter when the client already knows the league.
cURL
curl -H "x-api-key: YOUR_SANDBOX_KEY" \
  "https://hylnixnuabtnmjcdnujm.supabase.co/functions/v1/match-context?match_id=b42fe447-b2b1-485f-ae6d-1559ee2b57c7"
Response

Top-level contract

All top-level sections are always present. When intel or injuries are unavailable, the section remains in place with available: false, which keeps typed clients predictable.

JSON outline
{
  "match": { ... },
  "teams": { ... },
  "intel": { ... },
  "injuries": { ... },
  "opening_lines": { ... },
  "market": { ... },
  "metadata": {
    "api_version": "v1",
    "generated_at": "ISO-8601",
    "response_time_ms": 182,
    "data_freshness": { ... },
    "sections_available": { ... }
  }
}
Errors

Structured error responses

HTTP Code When it happens
401MISSING_API_KEYNo API key header.
401INVALID_API_KEYKey not recognized.
400MISSING_MATCH_IDNo match_id query param.
404MATCH_NOT_FOUNDMatch does not exist.
429RATE_LIMITEDRequest limit reached.
Examples

Production-shaped examples

JavaScript
const response = await fetch(
  "https://hylnixnuabtnmjcdnujm.supabase.co/functions/v1/match-context?match_id=b42fe447-b2b1-485f-ae6d-1559ee2b57c7",
  { headers: { "x-api-key": "YOUR_SANDBOX_KEY" } }
);

const payload = await response.json();
console.log(payload.match, payload.market, payload.metadata);
Python
import requests

resp = requests.get(
    "https://hylnixnuabtnmjcdnujm.supabase.co/functions/v1/match-context",
    params={"match_id": "b42fe447-b2b1-485f-ae6d-1559ee2b57c7"},
    headers={"x-api-key": "YOUR_SANDBOX_KEY"}
)

print(resp.json())