1. The Five-Endpoint Football Data Architecture
Avoid juggling incompatible schemas across separate sports vendors by mapping every UI view directly to one of FootballAPI's five normalized routes.
- GET /v1/matches/live: Poll active matchdays every 30 seconds for live scores, match clocks, possession %, shots, corners, cards, and Expected Goals (xG).
- GET /v1/matches/fixtures: Render upcoming schedules and historical results by league code and YYYYMMDD date.
- GET /v1/leagues/standings: Display full league tables with W/D/L, goal difference, points per game, and qualification zones.
- GET /v1/matches/detail: Hydrate match detail drawers with starting XI formations, substitutes, goal/card/VAR events, and play-by-play commentary.
- GET /v1/teams/roster: Fetch complete club squads by numeric team_id or club name with jersey numbers, positions, appearances, and goals.
Fetch Live Premier League Scores & xG Telemetry
Cost: 2 Credits per match returned (0 Credits if empty).
curl -sS "https://api.footballapi.dev/v1/matches/live?league=epl&limit=5" \
-H "x-api-key: fb_live_your_api_key"import requests
res = requests.get(
"https://api.footballapi.dev/v1/matches/live",
params={"league": "epl", "limit": 5},
headers={"x-api-key": "fb_live_your_api_key"},
timeout=15,
)
for m in res.json()["data"]["matches"]:
print(m["home_team"]["name"], m["home_team"]["score"], "-", m["away_team"]["score"], m["away_team"]["name"])const res = await fetch("https://api.footballapi.dev/v1/matches/live?league=epl&limit=5", {
headers: { "x-api-key": process.env.FOOTBALL_API_KEY! },
});
const { data } = await res.json();
console.log(data.matches);{
"code": 0,
"provider": "https://footballapi.dev",
"status": "ok",
"data": {
"league": "epl",
"count": 1,
"matches": [
{
"match_id": "401878758",
"status": "finished",
"home_team": { "name": "Leeds United", "abbreviation": "LEE", "score": 1 },
"away_team": { "name": "Tottenham Hotspur", "abbreviation": "TOT", "score": 0 },
"telemetry": {
"home": { "possession_pct": 39.2, "shots": 16, "shots_on_target": 4, "xg": 1.96 },
"away": { "possession_pct": 60.8, "shots": 11, "shots_on_target": 3, "xg": 1.43 }
}
}
]
}
}Interactive Football Analytics Underwriting Terminal · GET /v1/matches/live
Verify real-time latency, parcel credit math & JSON schema
Frequently Asked Questions
- Which league codes are accepted in the ?league= parameter?
- Use short slugs such as epl, ucl, laliga, seriea, bundesliga, ligue1, mls, eredivisie, libertadores, europa, worldcup, championship, or all.
- How fresh are live football scores?
- /v1/matches/live uses a 30-second live TTL cache (with ?fresh=1 bypass on paid plans) so live goals, cards, and match clocks update in near real time.