football-docs 0.17.4 → 0.17.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -4,7 +4,7 @@ Searchable football data provider and tooling documentation for AI coding agents
4
4
 
5
5
  **Who it's for:** Developers and analysts who use AI coding tools (Claude Code, Cursor, VS Code Copilot) to work with football data. Works with any tool that supports MCP.
6
6
 
7
- **What it does:** Gives your AI agent a searchable index of documentation for 30 football data providers and tools — event types, qualifier IDs, coordinate systems, API endpoints, data models, identity surfaces, and cross-provider comparisons for the data providers (StatsBomb, Opta, Wyscout, Impect, SkillCorner, Sportradar, TheSportsDB, FMDB Pro, TransferRoom, and more), the open-source libraries people build with (kloppy, mplsoccer, socceraction, soccerdata, floodlight, fast-forward, unravelsports, and more), and the APIs of wearable and sports-science vendors (STATSports, Firstbeat, Hawkin Dynamics, VALD). Your agent looks up the real docs instead of guessing from training data.
7
+ **What it does:** Gives your AI agent a searchable index of documentation for 31 football data providers and tools — event types, qualifier IDs, coordinate systems, API endpoints, data models, identity surfaces, and cross-provider comparisons for the data providers (StatsBomb, Opta, Wyscout, Impect, SkillCorner, Sportradar, TheSportsDB, FMDB Pro, TransferRoom, and more), the open-source libraries people build with (kloppy, mplsoccer, socceraction, soccerdata, floodlight, fast-forward, unravelsports, and more), and the APIs of wearable and sports-science vendors (STATSports, Firstbeat, Hawkin Dynamics, VALD). Your agent looks up the real docs instead of guessing from training data.
8
8
 
9
9
  **Why not just let the AI figure it out?** LLMs get football data specifics wrong constantly — Opta qualifier IDs, StatsBomb coordinate ranges, API endpoint URLs, library method signatures. These are mutable facts that change across versions. football-docs gives the agent verified, sourced documentation with provenance tracking so you know where every answer came from.
10
10
 
@@ -312,9 +312,10 @@ metrics:sources` re-checks every card quote against its live source.
312
312
  | Sportradar | 481 | integration guide (API basics, coverage tiers, ID handling, match status, update frequencies, push, historical data), Soccer Extended v4 endpoint reference with data-point tables, FAQ, plus curated api-access, api-endpoints, data-model, charting-and-stories, integration-notes, data-provenance |
313
313
  | socceraction | 34 | SPADL format, VAEP, Expected Threat |
314
314
  | BeSoccer | 16 | api-access, api-endpoints, data-provenance |
315
- | Driblab | 32 | api-access, api-endpoints, data-model, data-provenance |
315
+ | Driblab | 34 | api-access, api-endpoints, data-model, data-provenance |
316
+ | API-Football | 29 | api-access, data-model, identity-surfaces |
316
317
  | ESPN | 21 | api-access, scoreboard, match-summary, teams-and-standings, identity-and-coverage |
317
- | Reep | 32 | overview, identity-and-ids, download-duckdb-csv, api, data-provenance |
318
+ | Reep | 33 | overview, identity-and-ids, download-duckdb-csv, api, data-provenance |
318
319
  | TheSportsDB | 20 | api-access, api-endpoints, livescore, identity-surfaces, data-provenance |
319
320
  | FotMob | 5 | identity-surfaces, data-provenance |
320
321
  | Soccerdonna | 5 | identity-surfaces, data-provenance |
@@ -325,7 +326,7 @@ metrics:sources` re-checks every card quote against its live source.
325
326
  | VALD | 318 | api-access, api-endpoints, per-product endpoints and schemas (tenants, profiles, forcedecks, nordbord, forceframe, smartspeed, dynamo, humantrak), identity-surfaces, data-provenance |
326
327
  | Metric cards | 101 | xg, npxg, xg_assisted, xa, ppda, progressive_passes, progressive_carries, xt, vaep, field_tilt, pass_completion; see [Metric cards](#metric-cards) |
327
328
 
328
- **3,514 searchable chunks** across 31 providers and tools (the metric cards count as one).
329
+ **3,546 searchable chunks** across 32 providers and tools (the metric cards count as one).
329
330
 
330
331
  STATSports, Firstbeat, Hawkin Dynamics and VALD sell wearables and testing devices.
331
332
  Their APIs return a customer's own athlete data, which includes personal and health
@@ -365,7 +366,7 @@ trusting them.
365
366
  | StatsBomb | ID and name pairs observed in a sample of the public [open data](https://github.com/statsbomb/open-data) (three matches per competition-season, at a pinned commit). IDs the sample lacks must be listed in both the Open Data Events specification and kloppy's parser. Regenerate with `pnpm statsbomb:truth` | `src/__tests__/statsbomb-truth.test.ts` |
366
367
  | Opta | Stats Perform's F24 appendices, which have no machine-readable form. `data/opta-truth.json` holds each ID the docs use, with its label, checked by hand. The test also rejects the wrong meanings earlier docs gave some IDs (`WRONG_MEANINGS` in `src/opta-truth.ts`) | `src/__tests__/opta-truth.test.ts` |
367
368
  | SportMonks | Type and state IDs as SportMonks publishes them on its definitions pages and in the types spreadsheet linked from its Types page (`data/sportmonks-types-truth.json`, fetched 2026-09-30). Not the full list: the complete one needs an API key | `src/__tests__/sportmonks-truth.test.ts` |
368
- | Reep | The public OpenAPI spec (endpoint paths and methods), and one release's manifest and column schema (CSV table list, columns used in the SQL examples, licence and exclusions) | `src/__tests__/provider-truth.test.ts`, `src/__tests__/reep.test.ts` |
369
+ | Reep | The public OpenAPI spec (endpoint paths and methods), and one release's file list, manifest and table columns read from its CSV headers (CSV table list, columns used in the SQL examples, exclusions) | `src/__tests__/provider-truth.test.ts`, `src/__tests__/reep.test.ts` |
369
370
  | STATSports, Firstbeat, Hawkin Dynamics, VALD | Each vendor's public OpenAPI spec (STATSports v5 to v7, Firstbeat's `openapi.json`, the document inline on Hawkin's API reference page, VALD's eight product specs) — endpoint paths and methods, and every field name in the docs' schema tables. The STATSports `DrillKpiV7` table and the Hawkin metric tables must list the spec's and `metrics.json`'s entries in full. Firstbeat's variable list has no machine-readable source and is copied by hand from its public variables page | `src/__tests__/provider-truth.test.ts`, `src/__tests__/wearable-vendors.test.ts` |
370
371
 
371
372
  ESPN has a separate observation check in `src/__tests__/espn.test.ts`. It validates
@@ -376,7 +377,7 @@ Refresh manually with `python3 scripts/observe_espn.py --scheduled-date YYYYMMDD
376
377
  choosing a future fixture date and using permitted access. The script stores no
377
378
  raw responses. Review the diff, update the docs and dates, then rebuild the index.
378
379
 
379
- Reep's snapshots age weekly, as a new release is cut each week. Run
380
+ Reep's snapshots age with each download release, which is cut weekly or less often. Run
380
381
  `python3 scripts/check_reep_live.py` to check every download link and list what
381
382
  has changed since the snapshots; the refresh steps are in [specs/README.md](specs/README.md#reep).
382
383
 
package/data/docs.db CHANGED
Binary file
package/dist/index.js CHANGED
@@ -178,7 +178,8 @@ export function createFootballDocsServer() {
178
178
  "Look up by provider + id (pass namespace too, e.g. transfermarkt 'spieler', opta 'person'), by reep_id, or by name.",
179
179
  "Sources, in order: a local copy of the free register (REEP_DUCKDB_PATH), then the Reep API (REEP_API_KEY; keys are",
180
180
  "issued by hand on request, never self-service). With neither set, it returns setup steps and a DuckDB query.",
181
- "Keeping the local file current: Reep releases weekly. Every local answer ends with the file's release stamp checked",
181
+ "Keeping the local file current: Reep publishes a download release weekly or less often; new matching reaches the",
182
+ "Reep API daily. Every local answer ends with the file's release stamp checked",
182
183
  "against https://data.reep.football/releases/latest.json. If it says the file is out of date, tell the user and offer",
183
184
  "to run the curl command it gives, which downloads https://reep.football/downloads/duckdb over the same path; the",
184
185
  "next call uses the new file without a restart. Before bulk matching, make sure the file is current.",
package/dist/reep.d.ts CHANGED
@@ -15,7 +15,7 @@
15
15
  export declare const REEP_CONTACT = "getintouch+nutmeg@withqwerty.com";
16
16
  export declare const REEP_DOWNLOAD_URL = "https://reep.football/downloads/duckdb";
17
17
  export declare const REEP_LATEST_URL = "https://data.reep.football/releases/latest.json";
18
- export declare const ENTITY_TYPES: readonly ["player", "coach", "referee", "team", "competition", "season", "stage", "match"];
18
+ export declare const ENTITY_TYPES: readonly ["player", "coach", "referee", "team", "competition", "season", "stage", "venue", "match"];
19
19
  export type EntityType = (typeof ENTITY_TYPES)[number];
20
20
  export type ResolveEntityArgs = {
21
21
  name?: string;
package/dist/reep.js CHANGED
@@ -21,7 +21,7 @@ const DEFAULT_API_URL = "https://reep.football/api/v1";
21
21
  const USER_AGENT = "football-docs (+https://github.com/withqwerty/football-docs)";
22
22
  const MAX_RESULTS = 10;
23
23
  const FRESHNESS_TTL_MS = 60 * 60 * 1000;
24
- export const ENTITY_TYPES = ["player", "coach", "referee", "team", "competition", "season", "stage", "match"];
24
+ export const ENTITY_TYPES = ["player", "coach", "referee", "team", "competition", "season", "stage", "venue", "match"];
25
25
  const textResult = (text, isError = false) => ({
26
26
  isError: isError || undefined,
27
27
  content: [{ type: "text", text }],
@@ -36,19 +36,30 @@ function upstreamLabel(status) {
36
36
  return "removed from the provider's list";
37
37
  return `upstream status: ${status}`;
38
38
  }
39
- // bridges.upstream_status arrived in the 2026-09-26 release; older files lack it.
40
- const upstreamColumn = new WeakMap();
41
- function hasUpstreamStatus(register) {
42
- let known = upstreamColumn.get(register);
39
+ // Register files differ by release: bridges.upstream_status arrived in the
40
+ // 2026-09-26 release and is gone again from later ones, and later releases name
41
+ // an entity in entities.canonical_name instead of entities.label.
42
+ const knownColumns = new WeakMap();
43
+ function hasColumn(register, table, column) {
44
+ let columns = knownColumns.get(register);
45
+ if (!columns) {
46
+ columns = new Map();
47
+ knownColumns.set(register, columns);
48
+ }
49
+ const key = `${table}.${column}`;
50
+ let known = columns.get(key);
43
51
  if (!known) {
44
52
  known = register
45
- .query("SELECT count(*) AS n FROM information_schema.columns WHERE table_name = 'bridges' AND column_name = 'upstream_status'", {})
53
+ .query("SELECT count(*) AS n FROM information_schema.columns WHERE table_name = $table AND column_name = $column", { table, column })
46
54
  .then((rows) => Number(rows[0]?.n ?? 0) > 0)
47
55
  .catch(() => false);
48
- upstreamColumn.set(register, known);
56
+ columns.set(key, known);
49
57
  }
50
58
  return known;
51
59
  }
60
+ function hasUpstreamStatus(register) {
61
+ return hasColumn(register, "bridges", "upstream_status");
62
+ }
52
63
  function parseQuery(args) {
53
64
  const provider = args.provider?.trim().toLowerCase();
54
65
  const id = args.id?.trim();
@@ -77,7 +88,11 @@ async function openDuckdb(path) {
77
88
  const instance = await duckdb.DuckDBInstance.create(path, { access_mode: "READ_ONLY" });
78
89
  const connection = await instance.connect();
79
90
  const query = async (sql, params) => (await connection.runAndReadAll(sql, params)).getRowObjectsJson();
80
- const meta = await query("SELECT value FROM release_metadata WHERE key = 'source_stamp'", {});
91
+ // Later releases ship the file without release_metadata, so its stamp is unknown.
92
+ const hasMetadata = await query("SELECT count(*) AS n FROM information_schema.tables WHERE table_name = 'release_metadata'", {});
93
+ const meta = Number(hasMetadata[0]?.n ?? 0) > 0
94
+ ? await query("SELECT value FROM release_metadata WHERE key = 'source_stamp'", {})
95
+ : [];
81
96
  return {
82
97
  register: { stamp: meta.length ? String(meta[0].value) : null, query },
83
98
  close: () => connection.closeSync(),
@@ -127,6 +142,7 @@ async function localLookup(register, q) {
127
142
  let ids = [];
128
143
  const upstream = await hasUpstreamStatus(register);
129
144
  const upstreamCol = upstream ? "upstream_status" : "NULL AS upstream_status";
145
+ const labelCol = (await hasColumn(register, "entities", "label")) ? "label" : "canonical_name AS label";
130
146
  if (q.kind === "provider") {
131
147
  const params = { provider: q.provider, id: q.id };
132
148
  let sql = `SELECT DISTINCT b.reep_id, b.namespace, ${upstream ? "b.upstream_status" : "NULL AS upstream_status"} ` +
@@ -178,7 +194,7 @@ async function localLookup(register, q) {
178
194
  if (seen.has(target.id))
179
195
  continue;
180
196
  seen.add(target.id);
181
- const entity = await register.query("SELECT reep_id, label, entity_type FROM entities WHERE reep_id = $id", {
197
+ const entity = await register.query(`SELECT reep_id, ${labelCol}, entity_type FROM entities WHERE reep_id = $id`, {
182
198
  id: target.id,
183
199
  });
184
200
  if (!entity.length) {
@@ -305,11 +321,15 @@ async function freshnessNote(path, local, fetchImpl) {
305
321
  catch (error) {
306
322
  return (`Local register release: ${local ?? "unknown"}. Could not check for a newer release ` +
307
323
  `(${error instanceof Error ? error.message : String(error)}). The current stamp is at ${REEP_LATEST_URL}; ` +
308
- `releases are weekly. If it differs from the local release:\n${update}`);
324
+ `download releases are weekly or less often. If it differs from the local release:\n${update}`);
309
325
  }
310
326
  if (local === current)
311
327
  return `Local register release: ${local} (current).`;
312
- return (`**The local register is out of date.** Local release: ${local ?? "unknown"}; current release: ${current}. ` +
328
+ if (local === null) {
329
+ return (`The local register file does not record its release (it has no release_metadata table); the current ` +
330
+ `release is ${current}. If the file was downloaded before that release, update it:\n${update}`);
331
+ }
332
+ return (`**The local register is out of date.** Local release: ${local}; current release: ${current}. ` +
313
333
  `Tell the user, and offer to update it before relying on these results.\n${update}`);
314
334
  }
315
335
  // ---------------------------------------------------------------------------
@@ -411,10 +431,9 @@ function sqlFor(q) {
411
431
  if (q.kind === "provider") {
412
432
  return [
413
433
  "-- A bridge can name a merged Reep ID: follow its redirect to the survivor. An empty",
414
- "-- to_id is a tombstone (redirect_reason de_corroborated or withheld), not a merge.",
415
- "-- upstream_status: empty for a live ID, retired or removed when the provider no longer uses it.",
416
- "SELECT b.reep_id AS bridged_id, r.reason AS redirect_reason, e.reep_id, e.label, e.entity_type,",
417
- " o.provider, o.namespace, o.external_id, coalesce(o.upstream_status, '') AS upstream_status",
434
+ "-- to_id is a tombstone (the ID was withdrawn or withheld), not a merge.",
435
+ "SELECT b.reep_id AS bridged_id, r.reason AS redirect_reason, e.reep_id, e.canonical_name, e.entity_type,",
436
+ " o.provider, o.namespace, o.external_id",
418
437
  "FROM bridges b",
419
438
  "LEFT JOIN redirects r ON r.from_id = b.reep_id",
420
439
  "JOIN entities e ON e.reep_id = coalesce(nullif(r.to_id, ''), b.reep_id)",
@@ -422,28 +441,27 @@ function sqlFor(q) {
422
441
  "JOIN bridges o ON o.reep_id = e.reep_id OR o.reep_id IN (SELECT from_id FROM redirects WHERE to_id = e.reep_id)",
423
442
  `WHERE b.provider = ${quote(q.provider)}${q.namespace ? ` AND b.namespace = ${quote(q.namespace)}` : ""}`,
424
443
  ` AND b.external_id = ${quote(q.id)}`,
425
- "ORDER BY coalesce(o.upstream_status, '') <> '', o.provider, o.namespace;",
444
+ "ORDER BY o.provider, o.namespace;",
426
445
  ].join("\n");
427
446
  }
428
447
  if (q.kind === "reep_id") {
429
448
  return [
430
449
  "-- First check for a tombstone: a redirect with an empty to_id means the ID was withdrawn",
431
- "-- (reason de_corroborated) or withheld, not merged.",
450
+ "-- or withheld, not merged.",
432
451
  `SELECT from_id, to_id, reason FROM redirects WHERE from_id = ${quote(q.reepId)};`,
433
452
  "",
434
453
  "-- Then follow a merge redirect to the survivor, and list every provider ID, including",
435
454
  "-- any still attached to an ID merged into it (bridged_on names that ID).",
436
- "SELECT e.reep_id, e.label, e.entity_type, b.provider, b.namespace, b.external_id, b.reep_id AS bridged_on,",
437
- " coalesce(b.upstream_status, '') AS upstream_status",
455
+ "SELECT e.reep_id, e.canonical_name, e.entity_type, b.provider, b.namespace, b.external_id, b.reep_id AS bridged_on",
438
456
  "FROM entities e",
439
457
  "JOIN bridges b ON b.reep_id = e.reep_id OR b.reep_id IN (SELECT from_id FROM redirects WHERE to_id = e.reep_id)",
440
458
  `WHERE e.reep_id = coalesce((SELECT nullif(to_id, '') FROM redirects WHERE from_id = ${quote(q.reepId)}), ${quote(q.reepId)})`,
441
459
  ` AND NOT EXISTS (SELECT 1 FROM redirects WHERE from_id = ${quote(q.reepId)} AND coalesce(to_id, '') = '')`,
442
- "ORDER BY coalesce(b.upstream_status, '') <> '', b.provider, b.namespace;",
460
+ "ORDER BY b.provider, b.namespace;",
443
461
  ].join("\n");
444
462
  }
445
463
  return [
446
- "SELECT reep_id, label, entity_type, bridge_count",
464
+ "SELECT reep_id, canonical_name, entity_type, bridge_count",
447
465
  "FROM entity_search",
448
466
  `WHERE search_text ILIKE ${quote(`%${q.name}%`)}${q.type ? ` AND entity_type = ${quote(q.type)}` : ""}`,
449
467
  "ORDER BY bridge_count DESC",
@@ -457,11 +475,12 @@ function setupGuidance(q, note) {
457
475
  "",
458
476
  `1. Free, no key: download the whole register (${REEP_DOWNLOAD_URL}, one DuckDB file of several hundred MB)`,
459
477
  " and set REEP_DUCKDB_PATH to its path in this server's MCP configuration. Lookups then run locally.",
460
- " Reep releases weekly; this tool reports when the local file is out of date and how to refresh it.",
478
+ " Reep publishes a download release weekly or less often; this tool reports when the local file is out of date",
479
+ " and how to refresh it. The daily matching updates go to the Reep API only.",
461
480
  `2. The Reep API: set REEP_API_KEY. Keys are issued by hand on request, with no self-service sign-up;`,
462
481
  ` email ${REEP_CONTACT} with your organisation and what you are matching.`,
463
482
  "",
464
- "Meanwhile, this query answers the question against the downloaded file (duckdb reep-register-v1.duckdb):",
483
+ "Meanwhile, this query answers the question against the downloaded file (duckdb reep-register.duckdb):",
465
484
  "",
466
485
  "```sql",
467
486
  sqlFor(q),
@@ -0,0 +1,221 @@
1
+ ---
2
+ source_url: https://www.api-football.com/documentation-v3
3
+ source_type: curated
4
+ upstream_version: 3.9.3
5
+ crawled_at: 2026-10-16
6
+ ---
7
+
8
+ # API-Football v3 access
9
+
10
+ API-Football is the football API from API-SPORTS. These original reference
11
+ notes cover access and selected football endpoints, not a complete mirror of
12
+ the provider's portal. Official documentation version 3.9.3 was checked on
13
+ 2026-10-15. Direct-access response structures were checked on the same date.
14
+ Access guidance was revised on 2026-10-16: RapidAPI references below are
15
+ historical, not a verified current access path. Direct Free-plan checks were
16
+ executed on 2026-10-16; their scope and season restriction are described below.
17
+
18
+ ## API-Football direct API-SPORTS access
19
+
20
+ Use direct API-SPORTS access and its dashboard for account setup. This is the
21
+ access path verified for this reference with both paid and Free accounts.
22
+
23
+ | Access path | Base URL | Request headers | Verification |
24
+ |---|---|---|---|
25
+ | Direct API-SPORTS | `https://v3.football.api-sports.io` | `x-apisports-key: YOUR_API_KEY` | Successful paid GET requests on 2026-10-15 and Free checks on 2026-10-16 |
26
+
27
+ For direct access, the fixture path is `/fixtures`. The direct API
28
+ documentation specifies GET requests and an allowed request-header list
29
+ containing `x-apisports-key`. Check its CORS restrictions when using a
30
+ framework that adds custom headers.
31
+ Source: [API-Football authentication](https://www.api-football.com/documentation-v3#section/Authentication).
32
+
33
+ **Historical note only — not setup instructions:** older material used the
34
+ RapidAPI base `https://api-football-v1.p.rapidapi.com/v3` with `X-RapidAPI-Key`
35
+ and `X-RapidAPI-Host` headers, rather than the direct API-SPORTS URL/key.
36
+ Do not use that historical gateway for new setup or send a direct-access key
37
+ there; current availability not verified. Sources: [older provider URL example](https://www.api-football.com/news/post/how-to-get-all-teams-and-their-ids)
38
+ and [RapidAPI header protocol](https://docs.rapidapi.com/v2/docs/configuring-api-authentication).
39
+
40
+ ## API-Football plans and rate limits
41
+
42
+ API-Football's direct-access quotas below were checked on 2026-10-15. Daily
43
+ allocation and request rate are separate limits. These quotas apply to
44
+ direct API-SPORTS access.
45
+
46
+ | Direct plan | Requests per day | Requests per minute |
47
+ |---|---|---|
48
+ | Free | 100 | 10 |
49
+ | Pro | 7,500 | 300 |
50
+ | Ultra | 75,000 | 450 |
51
+ | Mega | 150,000 | 900 |
52
+
53
+ The pricing page restricts the seasons available on Free. Choose a season
54
+ available to the account; a successful paid-plan request is not evidence that
55
+ the same request is included on Free. This reference does not fix a list of
56
+ Free seasons or promise identical coverage across plans.
57
+
58
+ In direct Free checks on 2026-10-16, `/status` identified an active Free plan
59
+ and headers reported 100 daily requests and 10 requests per minute.
60
+ `/fixtures?league=140&season=2024&team=541&status=FT` returned 38 fixtures
61
+ without errors. The same league/team with `season=2026` returned HTTP 200,
62
+ zero results, an empty response and an `errors.plan` field. An HTTP-success
63
+ code alone does not establish season access. This is a dated check of two
64
+ seasons, not a permanent list of Free coverage. Successful Free samples also
65
+ covered league/team metadata, events, lineups, team and player match
66
+ statistics, standings, two player-statistics pages without overlapping IDs,
67
+ current squads, injuries and transfers for the selected context.
68
+
69
+ Successful direct samples included these response headers (header names are case-insensitive):
70
+
71
+ | Header | Meaning |
72
+ |---|---|
73
+ | `x-ratelimit-requests-limit` | Daily allocation |
74
+ | `x-ratelimit-requests-remaining` | Daily requests remaining |
75
+ | `X-RateLimit-Limit` | Maximum requests per minute |
76
+ | `X-RateLimit-Remaining` | Requests remaining in the minute window |
77
+
78
+ All four headers were present in the successful paid and Free samples. They
79
+ were absent in the sampled Free season-restriction response, so clients must
80
+ tolerate missing quota headers on errors. The provider documents HTTP 429 for excessive request rate, with an `errors` object in its example.
81
+ Do not assume every `errors` value is an array just because successful
82
+ responses contain `[]`. No rate-limit failure was deliberately triggered.
83
+ The provider also warns that excessive traffic can cause a firewall block.
84
+
85
+ Sources: [direct plans](https://www.api-football.com/pricing),
86
+ [rate-limit policy, published 2026-06-12](https://www.api-football.com/news/post/how-ratelimit-works),
87
+ [authentication and response headers](https://www.api-football.com/documentation-v3#section/Authentication).
88
+
89
+ ## API-Football account status and response errors
90
+
91
+ `GET /status` on the direct API returns account, subscription and request-quota
92
+ information. The portal says this call does not count against the daily
93
+ quota. Keep account details and credentials out of logs and shared examples.
94
+
95
+ The successful 2026-10-15 status sample had `errors: []`, an object in
96
+ `response`, and `results: 0`, despite an active subscription. Other sampled
97
+ football endpoints returned arrays in `response`. Do not implement a universal
98
+ "results equals zero means authentication failed" rule. Check HTTP status,
99
+ `errors` and the endpoint's response shape.
100
+
101
+ A separate validation check, `/players?team=541` without the required season,
102
+ returned HTTP 200 with an `errors` object containing a season error, zero
103
+ results and an empty response array. HTTP 200 alone does not establish a
104
+ successful data query. Empty events and lineups for a scheduled fixture were
105
+ also checked: those had no errors and are different from this parameter error.
106
+
107
+ Source: [API-SPORTS account and status](https://www.api-football.com/documentation-v3#section/Authentication/API-SPORTS-Account).
108
+ The status result above is a dated observation, not a guarantee about future
109
+ responses.
110
+
111
+ ## API-Football football endpoint selection
112
+
113
+ These GET endpoints cover the first API-Football data-model reference. Their
114
+ paths and relevant parameters were checked against documentation v3.9.3;
115
+ each row also had a successful direct-access sample on 2026-10-15. Parameters
116
+ shown here identify useful queries, not every valid combination.
117
+
118
+ | Endpoint | Selected query parameters | Response context |
119
+ |---|---|---|
120
+ | `GET /leagues` | `id`, `season` | Competition, country and available seasons with coverage |
121
+ | `GET /teams` | `id` | Team and venue |
122
+ | `GET /fixtures` | `league`, `season`, `team`, `status` | Matches and scores |
123
+ | `GET /fixtures/events` | `fixture` | Goals, cards, substitutions and VAR incidents |
124
+ | `GET /fixtures/lineups` | `fixture` | Formation, coach, starters and substitutes |
125
+ | `GET /fixtures/statistics` | `fixture` | Team-level match statistics |
126
+ | `GET /fixtures/players` | `fixture` | Player-level match statistics, grouped by team |
127
+ | `GET /standings` | `league`, `season` | Competition standings, grouped in nested arrays |
128
+ | `GET /players` | `team`, `league`, `season`, `page` | Player profiles and contextual season statistics |
129
+ | `GET /players/squads` | `team` | Current squad |
130
+ | `GET /injuries` | `team`, `league`, `season` | Player absences in fixture context |
131
+ | `GET /transfers` | `team` | Available transfer records |
132
+ | `GET /fixtures/rounds` | `league`, `season`, `dates` | Round labels with date ranges when requested |
133
+ | `GET /fixtures/headtohead` | `h2h`, `last` | Selected fixtures between two team IDs |
134
+ | `GET /players/profiles` | `player` | Player profile |
135
+ | `GET /players/teams` | `player` | Teams associated with a player |
136
+
137
+ `/fixtures/rounds` accepts a boolean `dates` option, documented default false;
138
+ `dates=true` was checked and returned round/date objects.
139
+ `/fixtures/statistics` accepts boolean `half`, documented default false, with
140
+ half data documented from season 2024. The checked `half=true` response
141
+ contained `statistics_1h` and `statistics_2h` arrays alongside `statistics`.
142
+ `/injuries?ids=...` was checked for one and for two fixture IDs. The documented
143
+ maximum is 20; the boundary itself was not tested.
144
+
145
+ The fixtures portal documents `id` and `ids` queries with extended events,
146
+ lineups, fixture statistics and player statistics. A single-ID request and a
147
+ two-ID batch were checked for those blocks. `ids` is documented to accept up
148
+ to 20 hyphen-separated fixture IDs; that boundary was not tested. Do not
149
+ assume a league-filtered fixture list contains those same extended blocks.
150
+
151
+ Source: [API-Football endpoint reference](https://www.api-football.com/documentation-v3#tag/Fixtures/operation/get-fixtures).
152
+ See [data-model.md](data-model.md) for the sampled fields and limitations.
153
+
154
+ ## API-Football players pagination and current squads
155
+
156
+ `GET /players` uses the `page` query parameter and documents 20 results per
157
+ page. In the checked query, `page=1` returned 20 results with
158
+ `paging.current=1` and `paging.total=4`. All four pages were checked: 20, 20,
159
+ 20 and 2 records, with 62 distinct player IDs and no overlap between pages in
160
+ this query. Use the returned pagination metadata instead of assuming that
161
+ the first response is the complete player list.
162
+
163
+ `GET /players/squads?team=...` returns a current squad, not a season-filtered
164
+ historical squad. The documented parameters are `team` and `player`, not
165
+ `season`; the `player` form returns associated teams. Season statistics from
166
+ `/players` are a different resource and can contain multiple competitive
167
+ contexts for the same player. Both `team` and `player` query forms were checked.
168
+
169
+ Sources: [player statistics](https://www.api-football.com/documentation-v3#tag/Players/operation/get-players),
170
+ [squads](https://www.api-football.com/documentation-v3#tag/Players/operation/get-players-squads).
171
+
172
+ ## API-Football Python GET example
173
+
174
+ This standard-library example uses direct access. Set `API_FOOTBALL_KEY` in
175
+ the process environment. It reads a selected league response and prints only
176
+ the result count; it does not print credentials or the response payload.
177
+ The example was executed successfully on 2026-10-15 with a paid account.
178
+
179
+ ```python
180
+ import json
181
+ import os
182
+ import urllib.request
183
+
184
+ request = urllib.request.Request(
185
+ "https://v3.football.api-sports.io/leagues?id=140&season=2024",
186
+ headers={"x-apisports-key": os.environ["API_FOOTBALL_KEY"]},
187
+ )
188
+ with urllib.request.urlopen(request, timeout=30) as response:
189
+ data = json.load(response)
190
+ if data.get("errors"):
191
+ raise RuntimeError("API-Football reported an error")
192
+ print(data["results"])
193
+ ```
194
+
195
+ This is one GET example, not a polling client. HTTP and transport exceptions
196
+ propagate to the caller. Check quota headers and subscription coverage before
197
+ using it in a recurring pipeline. Source: [direct authentication](https://www.api-football.com/documentation-v3#section/Authentication).
198
+
199
+ ## API-Football data sources and verification limits
200
+
201
+ API-Football's [terms](https://www.api-football.com/terms), checked on
202
+ 2026-10-15, refer to data supplied by partners but do not name the upstream
203
+ collectors or licensors. Record the collection/licensing provenance as **not
204
+ publicly documented** beyond that statement; do not assign a particular
205
+ upstream provider or describe every field as first-party or derived.
206
+
207
+ These docs contain original summaries of public documentation and dated
208
+ structural observations. A subscription is required for the sampled data API;
209
+ this reference grants no rights in the underlying data, images or trademarks.
210
+ Raw API payloads and account details are not included. The structural evidence
211
+ is in `data/api-football-observations.json`; separate Free checks are in
212
+ `data/api-football-free-observations.json`.
213
+
214
+ The main direct samples cover league 140, team 541, completed fixtures in
215
+ season 2024 and scheduled fixtures in season 2026. Head-to-head, squad and
216
+ transfer queries are not restricted to that season pair. The observations
217
+ include successful data, legitimate empty responses and a parameter error;
218
+ they do not establish every possible type, competition or status. Update
219
+ frequencies in the portal are indicative, not guaranteed. Free checks are
220
+ separate from the paid samples used for the field/type tables. Only direct
221
+ API-SPORTS access is covered by the setup instructions and live checks.