matchSummary()
returns MatchSummary Scoreline, status, and team-level xG.
Sofascore notes: Full status-code decoding, including live states and shootout penalties.
Sofascore is the richest free source for live match state. The adapter decodes their status codes and type buckets (scheduled, live, halftime, finished, postponed, cancelled, abandoned) and gives you back a consistent MatchSummary that works for both live scoreboards and historical result cards.
fromSofascore.matchSummary(event) MatchSummary <ShotMap />, your own React view, a server-side
report, or an analysis script.
Sofascore is the only adapter here that natively understands live states — the halftime code, in-play vs full time, the penalty-shootout resolution — without needing a second provider. If you're building a live match strip, start here.
import { fromSofascore } from "@withqwerty/campos-adapters";
const summary = fromSofascore.matchSummary(matchEvent); matchSummary()
returns MatchSummary Scoreline, status, and team-level xG.
Sofascore notes: Full status-code decoding, including live states and shootout penalties.
Supported cards plot from this adapter with no extra work. Partial cards plot, but read the scope note. Dimmed cards need a surface this provider doesn't ship.
Plot events, shots, passes, and formations directly on the pitch.
Time-series and xG-driven views from shots().
These charts are adapter-independent — they take pre-aggregated inputs.
Sofascore's status object has both a code (numeric) and a
type (coarse bucket). The adapter prefers type and uses
code to refine edge cases like halftime, extra time, and shootout resolutions.
The full decoding table:
{
"scheduled": [
0,
"type: notstarted"
],
"live": [
6,
7,
8,
9,
"type: inprogress"
],
"halftime": [
31,
41,
50
],
"finished": [
100,
110,
120,
130,
140,
"type: finished"
],
"postponed": [
60,
"type: postponed"
],
"cancelled": [
70,
"type: canceled"
],
"abandoned": [
90
]
}
Halftime markers, in-play scoreboards, shootout resolutions, historical result
cards — matchSummary() handles all of them from the same Sofascore payload.
Sofascore publishes richer detail behind per-match endpoints, but the current Campos adapter stays summary-only. Expand as the community needs justify it.
The adapter accepts the Sofascore match event object directly — whether you hit their API, use ScraperFC, or maintain your own scraper. Field names match Sofascore's native shape.
Concrete credits for the projects that did the underlying research or laid the reference tables we read from.
Sofascore status-code table and WhoScored match-centre structure references.
{
"id": 12529128,
"status": {
"code": 100,
"description": "Ended",
"type": "finished"
},
"startTimestamp": 1724011200,
"homeTeam": {
"id": 17,
"name": "Manchester City"
},
"awayTeam": {
"id": 38,
"name": "Chelsea"
},
"homeScore": {
"current": 2,
"penalties": null
},
"awayScore": {
"current": 0,
"penalties": null
},
"tournament": {
"name": "Premier League"
},
"season": {
"name": "24/25",
"year": 2024
},
"venue": {
"name": "Etihad Stadium"
},
"roundInfo": {
"round": 1
}
} {
"matchId": "12529128",
"competitionLabel": "Premier League",
"seasonLabel": "24/25",
"kickoff": "2024-08-18T20:00:00.000Z",
"status": "finished",
"statusLabel": "Ended",
"venue": "Etihad Stadium",
"home": {
"teamId": "17",
"teamLabel": "Manchester City",
"score": 2
},
"away": {
"teamId": "38",
"teamLabel": "Chelsea",
"score": 0
},
"sourceMeta": {
"statusCode": 100,
"statusType": "finished",
"round": 1
}
}