Description
Returns the data of finished matches (limit: within 30 days): match events, match statistics, text commentary
Request rate: 120/min
Notes:
Data for live matches comes from the live match data endpoint, which returns everything for the matches of the last 2 hours; keep it locally
Use this endpoint to fill gaps when something was missed
Request rate: 120/min
Notes:
Data for live matches comes from the live match data endpoint, which returns everything for the matches of the last 2 hours; keep it locally
Use this endpoint to fill gaps when something was missed
Access
- Request
GET https://api.sports.csap.ai/api/v1/matches/live/history- Auth
- Header X-API-Key: <your key> (Authorization: Bearer <key> also works; ?key= is still accepted but discouraged, because the key ends up in URLs and logs)
- External keys
- Available (scoped)External keys can call it, but only data inside the open scope is returned.
- Rate limits
- 3000 per minute · 200000 per day · Set per key (rate_per_min and quota_daily returned by /api/v1/account are authoritative; the numbers above are a trial key's). Beyond them the answer is 429. In addition, heavy requests such as whole-table snapshots and statistics lists without a match id are processed 2 at a time for the whole platform; a request that cannot get a slot receives 429 with Retry-After. Responses do not carry X-RateLimit-* headers for now. See the general guide
Request parameters 1
| Parameter | Type | required | Example | Description |
|---|---|---|---|---|
| id | integer | required | 5179 | Match id |
Example request
curl "https://api.sports.csap.ai/api/v1/matches/live/history?id=5179" \ -H "X-API-Key: YOUR_API_KEY"
Try it
Example response
{
"code": 0,
"data": [
{
"id": 5179,
"incidents": [
{
"position": 2,
"time": 9,
"type": 20
},
{
"player_name": "Adam Mulele",
"position": 2,
"time": 29,
"type": 22
},
{
"position": 2,
"time": 30,
"type": 21
}
],
"score": [
5179,
8,
[
3,
0,
0
]
],
"stats": [
{
"away": 37,
"home": 63,
"type": 25
},
{
"away": 3,
"home": 7,
"type": 2
},
{
"away": 2,
"home": 1,
"type": 3
}
],
"tlive": [
{
"add_time": null,
"data": "比赛开始",
"incident_type": "match_started",
"main": 1,
"player_in": null,
"player_name": null,
"player_out": null,
"position": 0,
"time": "0",
"type": 40
},
{
"add_time": null,
"data": "6' 皇家马德里C队 第 1 个角球",
"incident_type": "corner_kick",
"main": 0,
"player_in": null,
"player_name": null,
"player_out": null,
"position": 1,
"time": "6",
"type": 6
},
{
"add_time": null,
"data": "9' 黄牌 巴拉多利德B队",
"incident_type": "yellow_card",
"main": 0,
"player_in": null,
"player_name": null,
"player_out": null,
"position": 2,
"time": "9",
"type": 20
}
]
}
],
"message": "success",
"success": true
}Response fields 5
idintegerRecord id; paging cursor (the id parameter returns records >= this value). In match endpoints it is the platform match id (gmid)
Example: 5179incidentsarray<object>Match events; empty when there are none· 5
scorearrayScore
statsarray<object>Statistic item· 3
tlivearray<object>Text commentary; empty when there is none· 10
Errors
| HTTP | message | When |
|---|---|---|
| 401 | missing API key / unauthorized | No X-API-Key, or the key is invalid or disabled |
| 400 | bad param … | Malformed parameter (e.g. id is neither a number nor u<uid>) |
| 301 | match merged into <gmid> | Queried by an old match id that has been merged into a new gmid: Location points to the new address and the body carries moved_to |
| 404 | not found | The match / team / competition does not exist, or is outside what this key can see (external keys see only matches inside the open coverage) |
| 429 | rate limit exceeded / daily quota exceeded | The key's per-minute rate or daily quota is exceeded |
| 429 | server busy, retry later | The server's concurrency slots are full (only 2 heavy requests at a time); retry after Retry-After seconds |
| 500 | query error | The query failed on the server; you may retry |