API Documentation
REST & WebSocket reference
Authenticate with your API key and start pulling data. Every endpoint, parameter and response documented.
Authentication
All requests require an API key sent in the X-API-Key header. Keep your key secret and rotate it from the dashboard.
Base URL
https://api.sportfast.iocurl -X GET "https://api.sportfast.io/v1/livescore?lang=en" \
-H "X-API-Key: YOUR_API_KEY"Endpoints
| GET | /v1/livescore | Live Scores | Try in Playground |
| GET | /v1/fixtures | Fixtures | Try in Playground |
| GET | /v1/leagues | Leagues | Try in Playground |
| GET | /v1/standings | Standings | Try in Playground |
| GET | /v1/h2h | Head-to-Head | Try in Playground |
| GET | /v1/odds | Odds | Try in Playground |
| GET | /v1/lineups | Lineups | Try in Playground |
| GET | /v1/teams | Teams | Try in Playground |
| GET | /v1/players | Players | Try in Playground |
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
lang | string | — | Response language: en or zh. Default en. |
league_id | integer | — | Filter by league ID. |
date | string | — | Filter by date (YYYY-MM-DD). |
page | integer | — | Page number for pagination. |
WebSocket
Persistent WebSocket connections deliver data in milliseconds — no polling, no lag. Goals, substitutions and cards sync in real time.
import WebSocket from "ws";
const ws = new WebSocket("wss://stream.sportfast.io/v1/live", {
headers: { "X-API-Key": "YOUR_API_KEY" },
});
ws.on("message", (msg) => {
const event = JSON.parse(msg);
console.log(event.type, event.data);
});Error Codes
| 401 | Invalid or missing API key |
| 403 | Plan quota exceeded |
| 429 | Rate limit exceeded |
| 404 | Resource not found |
| 500 | Internal server error |