SofaScore API endpoint
Returns a team's last played match and its next scheduled match with teams, competition, status, score and start time. Either side can be missing (a team with no upcoming fixture returns only `previous_event`). Returns 404 when SofaScore has neither. For full fixture lists use team-events.
/sofascore/team-near-eventsQuery parameters:
id: required. Numeric SofaScore team id, e.g. 17. Get it from sofascore-search or sofascore-team-events.Notable response behavior:
sofascore-team-events: teams, competition, status, score and start time.previous_event. Returns 404 when SofaScore has neither. Use sofascore-team-events for full fixture lists.| Field | In the sample | Value in the sample |
|---|---|---|
| team_id | Has a value | |
| previous_event.id | Has a value | |
| previous_event.slug | Has a value | |
| previous_event.start_timestamp | Has a value | 2026-10-11 |
| previous_event.start_time | Has a value | 2026-10-11 |
| previous_event.status | Has a value | |
| previous_event.winner_code | Has a value | |
| previous_event.tournament | Has a value | |
| previous_event.home_team | Has a value | |
| previous_event.away_team | Has a value | |
| previous_event.home_score | Has a value | |
| previous_event.away_score | Has a value | |
| next_event.id | Has a value | |
| next_event.slug | Has a value | |
| next_event.start_timestamp | Has a value | 2026-10-14 |
| next_event.start_time | Has a value | 2026-10-14 |
| next_event.status | Has a value | |
| next_event.tournament | Has a value | |
| next_event.home_team | Has a value | |
| next_event.away_team | Has a value |
| Parameter | Type | Required | Default | Description | Example |
|---|---|---|---|---|---|
| id | string | Yes | Numeric SofaScore team id | 17 | |
| x-api-key (header) | string | Yes | API key required |
curl -X GET "https://api.crawlora.net/api/v1/sofascore/team-near-events?id=17" \ -H "x-api-key: $CRAWLORA_API_KEY"
{
"code": 200,
"msg": "OK",
"data": {
"team_id": 17,
"source_url": "https://api.sofascore.com/api/v1/team/17/near-events",
"fetched_at": "2026-10-07T00:00:00Z",
"previous_event": {
"id": 16363867,
"slug": "sunderland-manchester-city",
"start_timestamp": 1789909200,
"start_time": "2026-09-20T13:00:00Z",
"status": {
"code": 100,
"description": "Ended",
"type": "finished"
},
"winner_code": 1,
"tournament": {
"id": 1,
"name": "Premier League",
"slug": "premier-league",
"category": "England",
"unique_tournament_id": 17,
"unique_tournament_name": "Premier League"
},
"home_team": {
"id": 17,
"name": "Manchester City",
"short_name": "Man City",
"slug": "manchester-city"
},
"away_team": {
"id": 41,
"name": "Sunderland",
"short_name": "Sunderland",
"slug": "sunderland"
},
"home_score": {
"current": 5,
"period1": 3,
"period2": 2
},
"away_score": {
"current": 3,
"period1": 2,
"period2": 1
}
},
"next_event": {
"id": 16363878,
"start_timestamp": 1791732600,
"start_time": "2026-10-11T15:30:00Z",
"status": {
"code": 0,
"description": "Not started",
"type": "notstarted"
},
"tournament": {
"id": 1,
"name": "Premier League",
"unique_tournament_id": 17
},
"home_team": {
"id": 44,
"name": "Liverpool FC",
"slug": "liverpool"
},
"away_team": {
"id": 17,
"name": "Manchester City",
"short_name": "Man City",
"slug": "manchester-city"
}
}
}
}Request schema
No body schema
Response schema
#/definitions/sofascore.teamNearEventsResponseDoc
| Field | Type | Required | Enum | Bounds | Example | Description |
|---|---|---|---|---|---|---|
| code | integer | No | 200 | |||
| data | sofascore.TeamNearEventsResponse | No | ||||
| data.fetched_at | string | No | ||||
| data.next_event | sofascore.EventSummary | No | EventSummary record, 38 fields: away_score, away_team, home_score, home_team, id, slug, start_time, start_timestamp, status, tournament, winner_code. Described under SofaScore live events API. | |||
| data.previous_event | sofascore.EventSummary | No | EventSummary record, 38 fields: away_score, away_team, home_score, home_team, id, slug, start_time, start_timestamp, status, tournament, winner_code. Described under SofaScore live events API. | |||
| data.source_url | string | No | ||||
| data.team_id | integer | No | 17 | |||
| msg | string | No | OK |
| Status | Description | Schema |
|---|---|---|
| 400 | Bad Request | #/definitions/app.Response |
| 404 | Not Found | #/definitions/app.Response |
| 429 | Too Many Requests | #/definitions/app.Response |
| 503 | Service Unavailable | #/definitions/app.Response |
Use environment variables for secrets and keep Crawlora API keys server-side.
curl -X GET "https://api.crawlora.net/api/v1/sofascore/team-near-events?id=17" \
-H "x-api-key: $CRAWLORA_API_KEY"