All endpoints except
GET /health require your API key in the X-API-Key request header.Get your API key
API keys are issued to your account (a client) by the Sportrix Data team. Contact support to request a key for your account.Your key will look like this:Keys always begin with
sk_. Keep your key secret — do not commit it to source control or expose it in client-side code.Verify your key works
Call A successful response returns an array of your enabled sports:Note the
GET /sports to confirm your key is valid and see which sports are enabled on your account:id of the sport you want to work with — you’ll use it in the next step.If you receive a 401 Unauthorized response, double-check that you copied the key correctly and that it hasn’t been disabled or expired.Find a league
Call Results come back in a pagination envelope:Note the
GET /leagues with your sport id to browse the leagues available on your account:id of the league you want to explore.List matches in a league
Call Each item in the response is a match object:Note the
GET /matches with the league id from the previous step to see matches. Use status=STARTED to focus on in-play matches:id of a match you want to track — you’ll use it in the next steps.Fetch a live score snapshot
If your key has the The response is a live snapshot object with the current score, clock, phase, statistics, and event timeline:This endpoint returns the last-known state even if the match has just ended, so you can safely poll it throughout and after a match.
live_scores or live_scores_statistics scope, call GET /matches/{id}/live to get the current live state of a match:Stream live updates over WebSocket
If your key has the After subscribing, you’ll immediately receive a A single connection can subscribe to multiple matches simultaneously — each incoming frame carries the
live_scores_statistics scope, you can subscribe to real-time push updates instead of polling. Install the websocket-client library (pip install websocket-client), then run the script below — substituting your key and a live match id:snapshot frame with the full current state, followed by update frames whenever the match state changes:match_id so you can route updates correctly.