Description
Pass match_id (the platform match id); returns the merged event timeline of the match.
Access
- Request
GET https://api.sports.csap.ai/api/v1/matches/events/by-match- 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 2
| Parameter | Type | required | Example | Description |
|---|---|---|---|---|
| match_id | integer | required | 5179 | Platform match id (gmid) |
| limit | integer | optional | 2 | Default 500 |
Example request
curl "https://api.sports.csap.ai/api/v1/matches/events/by-match?limit=2&match_id=5179" \ -H "X-API-Key: YOUR_API_KEY"
Try it
Example response
{
"code": 0,
"data": [
{
"added_time": null,
"minute": "6",
"player": null,
"player_in": null,
"player_out": null,
"side": "home",
"source": "S3",
"type": "corner_kick",
"type_zh": "角球"
}
],
"message": "success",
"success": true
}Response fields 9
added_timenullnullableStoppage-time minutes
minutestringMatch minute
Example: "6"playernullnullablePlayer name
player_innullnullablePlayer coming on
player_outnullnullablePlayer going off
sidestringhome = home team / away = away team
Example: "home"sourcestringSource code (S1, S2…)
Example: "S3"typestringType
Example: "corner_kick"type_zhstring
Example: "角球"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 |