Skip to main content
This guide walks you from zero to a working integration — a verified REST call against the fixture catalog and a live WebSocket subscription that prints score updates to your terminal. You’ll need your API key and about five minutes.
All endpoints except GET /health require your API key in the X-API-Key request header.
1

Get your API key

API keys are issued to your account (a client) by the SportriX 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.
2

Verify your key works

Call GET /sports to confirm your key is valid and see which sports are enabled on your account:
A successful response returns an array of your enabled sports:
Note the 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.
3

Find a league

Call GET /leagues with your sport id to browse the leagues available on your account:
Results come back in a pagination envelope:
Note the id of the league you want to explore.
4

List matches in a league

Call GET /matches with the league id from the previous step to see matches. Use status=STARTED to focus on in-play matches:
Each item in the response is a match object:
Note the id of a match you want to track — you’ll use it in the next steps.
5

Fetch a live score snapshot

If your key has the live_scores or live_scores_statistics scope, call GET /matches/{id}/live to get the current live state of a match:
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.
6

Stream live updates over WebSocket

If your key has 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:
After subscribing, you’ll immediately receive a snapshot frame with the full current state, followed by update frames whenever the match state changes:
A single connection can subscribe to multiple matches simultaneously — each incoming frame carries the match_id so you can route updates correctly.