# OddsYorkie API > Football odds, stats and live match data over a REST API and a WebSocket. # Introduction OddsYorkie is a REST API and a WebSocket for football odds, stats and live match data. These pages are in the order you would build with it, and every code example on them is run before we publish it. ## What you can do - [Find games](live-and-upcoming.md) that are live, upcoming or on a given day, and filter them by competition, team and odds. - [Read prices](market-list.md) for one match or many, with every market bet365 offers. - [Follow a match](score-and-tracker.md) through its tracker, stats, players and live tables. - [Receive changes as they happen](connecting.md) over a WebSocket. - [Read Bet Builder](bet-builder-pre-match.md) combinations before the game and in play. - [Look back](opening-and-closing-lines.md) at opening and closing lines and every price move. - [Compare teams](team-stats.md) with form, averages and a match preview. ## How the pages work Each page does one job. It opens with two lines on what it is for, then numbered steps, each with a sentence or two and one example. Reference tables come last. Every example comes in cURL, JavaScript, Python and PHP, and in a Claude Code / Codex tab with a prompt that asks an assistant to do the same step. The language you pick is remembered on every page. ## The base URL All paths start with `/api/v2`, so the base URL is `https://odds-feed.on-forge.com/api/v2`. Responses are JSON. Times are UTC in ISO 8601 with milliseconds. ## Where to start 1. Follow the [Quickstart](quickstart.md) to get a key and make a request. 2. Read [Authentication](authentication.md) and [Plans and access](plans.md) to see what your key can read. 3. Pick the page for the job in the sidebar. # Quickstart Use this page to get a key, make a request and see where live updates come from. It needs a key and a way to send an HTTP header. ## 1. Get your key Create an account, then open [API keys](/dashboard/keys) in your dashboard and create a key. A key looks like `12|aBcD...` and is shown once, so store it somewhere safe. Keep it out of client-side code and public repositories. ## 2. Make your first request List the matches that are live now. `limit` caps how many come back, and the key goes in the `Authorization` header as a bearer token. ```bash curl "https://odds-feed.on-forge.com/api/v2/matches?status=live&limit=1" \ -H "Authorization: Bearer YOUR_KEY" ``` ```js const params = new URLSearchParams({ status: 'live', limit: '1' }); const response = await fetch(`https://odds-feed.on-forge.com/api/v2/matches?${params}`, { headers: { Authorization: 'Bearer YOUR_KEY' }, }); console.log(JSON.stringify(await response.json(), null, 2)); ``` ```python import json import requests response = requests.get( 'https://odds-feed.on-forge.com/api/v2/matches', headers={'Authorization': 'Bearer YOUR_KEY'}, params={'status': 'live', 'limit': 1}, ) print(json.dumps(response.json(), indent=2)) ``` ```php use Illuminate\Support\Facades\Http; $response = Http::withToken('YOUR_KEY')->get('https://odds-feed.on-forge.com/api/v2/matches', ['status' => 'live', 'limit' => 1]); echo json_encode($response->json(), JSON_PRETTY_PRINT); ``` ```json { "data": [ { "id": "0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70", "kickoff_at": "2026-11-27T09:40:20.000Z", "status": "live", "competition": { "id": "0199c5a0-0000-7000-9000-000000000001", "name": "Premier League", "tier": "T1", "gender": "men", "age_group": "senior", "is_cup": false, "is_continental": false, "is_friendly": false }, "home": { "id": "0199c5a0-0000-7000-8000-000000000001", "name": "Brentford" }, "away": { "id": "0199c5a0-0000-7000-8000-000000000002", "name": "Everton" }, "refs": [{ "source": "bet365", "type": "fixture", "id": "203186268" }], "bet_builder": { "status": "unavailable", "reason": "not_upcoming" } } ], "meta": { "generated_at": "2026-11-27T10:41:00.000Z", "next_cursor": null, "has_more": false }, "links": { "next": null } } ``` ## 3. Read the response Every response is JSON with `data`, `meta` and `links`. Times are UTC in ISO 8601 with milliseconds. The `id` of a match is what the other endpoints take, for example `/api/v2/matches/{id}/odds`. ## 4. Receive a live update Polling works, but a WebSocket sends each change as it happens. Connect with any Pusher client and subscribe to a match. [Connecting](connecting.md) explains each part, and [Plans and access](plans.md) says which plans include live updates. ```js import Pusher from 'pusher-js'; const pusher = new Pusher('75f6d3a4cc8f73610c0c351d9199cf5a', { cluster: 'mt1', wsHost: '127.0.0.1', wssPort: 443, forceTLS: true, enabledTransports: ['ws', 'wss'], channelAuthorization: { endpoint: 'https://odds-feed.on-forge.com/broadcasting/auth', headers: { Authorization: 'Bearer YOUR_KEY' }, }, }); pusher .subscribe('private-match.0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70.odds') .bind('update', (message) => console.log(message.type, message.revision)); ``` ## Next - [Authentication](authentication.md) explains the key and its abilities. - [Live and upcoming games](live-and-upcoming.md) shows how to find the matches you want. - [Using with AI](using-ai.md) shows how to give a coding assistant these docs. # Authentication and keys Use this page to send your key and to see what a failed request looks like. Every endpoint except the documentation needs a key. ## 1. Send the key as a bearer token Send the key in the `Authorization` header of every request. ``` Authorization: Bearer YOUR_KEY ``` ## 2. Keep the key secret Read the key from an environment variable or a secrets store, and never write it into code that ships to a browser or into a repository. A key is shown once when you create it. If one leaks, delete it in the [dashboard](/dashboard/keys) and create another. ## 3. Check a failed request A request without a valid key gets a `401` and an `error` object. Every error is built the same way, described on [Errors](errors.md). ```bash curl "https://odds-feed.on-forge.com/api/v2/matches?limit=1" ``` ```js const params = new URLSearchParams({ limit: '1' }); const response = await fetch(`https://odds-feed.on-forge.com/api/v2/matches?${params}`); console.log(JSON.stringify(await response.json(), null, 2)); ``` ```python import json import requests response = requests.get( 'https://odds-feed.on-forge.com/api/v2/matches', params={'limit': 1}, ) print(json.dumps(response.json(), indent=2)) ``` ```php use Illuminate\Support\Facades\Http; $response = Http::get('https://odds-feed.on-forge.com/api/v2/matches', ['limit' => 1]); echo json_encode($response->json(), JSON_PRETTY_PRINT); ``` ```json { "error": { "status": 401, "code": "unauthenticated", "message": "A valid API key is required." } } ``` ## 4. Know what a key can do A key carries abilities, and your plan decides which abilities it can use. An endpoint that needs an ability the key lacks answers `403` with the code `not_entitled`. [Plans and access](plans.md) shows the answer for each plan, and [Abilities](abilities.md) lists the ability each endpoint needs. ## Reference | Item | Value | | --- | --- | | Base URL | `https://odds-feed.on-forge.com/api/v2` | | Authentication | `Authorization: Bearer YOUR_KEY` | | Format | JSON, UTF-8 | | Times | UTC, ISO 8601 with milliseconds, for example `2026-11-27T09:40:20.000Z` | | Ids | Matches, competitions, teams and venues use UUIDs | # Plans and access Use this page to see what each plan shows and what happens when a key asks for more. A request outside your plan is answered with `403` and the code `not_entitled`. Free shows the seven main markets, the same as Main lines, 60 seconds behind, with 1,000 requests a day. On Main lines, Full depth and Player props, prices over REST refresh every 15 seconds, with 600 requests a minute. With the WebSocket, prices arrive within 250 milliseconds and REST is live too. Business is live, with 3,000 requests a minute. ## 1. Main lines Main lines shows seven markets: full-time and half-time result, double chance, both teams to score, goals, goal lines and Asian handicaps. Ask for any other market and the answer is `403`. The message names the market and the plan that includes it. ```bash curl "https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e71/odds?markets=corners.race" \ -H "Authorization: Bearer MAIN_KEY" ``` ```js const params = new URLSearchParams({ markets: 'corners.race' }); const response = await fetch(`https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e71/odds?${params}`, { headers: { Authorization: 'Bearer MAIN_KEY' }, }); console.log(JSON.stringify(await response.json(), null, 2)); ``` ```python import json import requests response = requests.get( 'https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e71/odds', headers={'Authorization': 'Bearer MAIN_KEY'}, params={'markets': 'corners.race'}, ) print(json.dumps(response.json(), indent=2)) ``` ```php use Illuminate\Support\Facades\Http; $response = Http::withToken('MAIN_KEY')->get('https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e71/odds', ['markets' => 'corners.race']); echo json_encode($response->json(), JSON_PRETTY_PRINT); ``` ```json { "error": { "status": 403, "code": "not_entitled", "message": "Your plan does not include corners.race. The Full depth plan or higher does." } } ``` ## 2. Full depth Full depth shows every match and team market, the Bet Builder match and team sections and the live tracker. It does not show player markets. ```bash curl "https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e71/odds?include=players" \ -H "Authorization: Bearer FULL_KEY" ``` ```js const params = new URLSearchParams({ include: 'players' }); const response = await fetch(`https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e71/odds?${params}`, { headers: { Authorization: 'Bearer FULL_KEY' }, }); console.log(JSON.stringify(await response.json(), null, 2)); ``` ```python import json import requests response = requests.get( 'https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e71/odds', headers={'Authorization': 'Bearer FULL_KEY'}, params={'include': 'players'}, ) print(json.dumps(response.json(), indent=2)) ``` ```php use Illuminate\Support\Facades\Http; $response = Http::withToken('FULL_KEY')->get('https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e71/odds', ['include' => 'players']); echo json_encode($response->json(), JSON_PRETTY_PRINT); ``` ```json { "error": { "status": 403, "code": "not_entitled", "message": "Your plan does not include player markets. The Player props plan or higher does." } } ``` ## 3. Player props Player props adds every player market and the Bet Builder player sections. Price history is not part of it. A key without the `history:read` ability answers `403`. ```bash curl "https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e71/odds/history?market=goals.asian" \ -H "Authorization: Bearer PROPS_KEY" ``` ```js const params = new URLSearchParams({ market: 'goals.asian' }); const response = await fetch(`https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e71/odds/history?${params}`, { headers: { Authorization: 'Bearer PROPS_KEY' }, }); console.log(JSON.stringify(await response.json(), null, 2)); ``` ```python import json import requests response = requests.get( 'https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e71/odds/history', headers={'Authorization': 'Bearer PROPS_KEY'}, params={'market': 'goals.asian'}, ) print(json.dumps(response.json(), indent=2)) ``` ```php use Illuminate\Support\Facades\Http; $response = Http::withToken('PROPS_KEY')->get('https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e71/odds/history', ['market' => 'goals.asian']); echo json_encode($response->json(), JSON_PRETTY_PRINT); ``` ```json { "error": { "status": 403, "code": "not_entitled", "message": "This key lacks the history:read ability." } } ``` ## 4. Business Business has every ability, including opening and closing lines and price history, and 3,000 requests a minute. It can also ask for historic odds: up to 5 competition-seasons a month from the odds archive (January 2021 onwards, eight main markets), sent as CSV within 2 working days. ## 5. The WebSocket add-on Main lines, Full depth and Player props can add the WebSocket for £25 a month. It gives `stream:read` and `stream:firehose`, so your key can follow one match or every live match, on your plan's [odds channel](channels.md). Business includes the WebSocket already. ## 6. Other bookmakers Main lines, Full depth and Player props can add other bookmakers for £5 a month, and Business includes them. `GET /matches/{id}/books` lists each bookmaker's opening and latest price for eight main markets, before the game and in play, under the same market keys as the odds: `match.result`, `match.asian_handicap`, `goals.asian`, `corners.asian`, `match.1h.asian_handicap`, `goals.1h.asian`, `corners.1h.asian` and `match.1h.result`. It needs `books:read`. ## 7. Extra requests Any paid plan can add requests a minute in packs of 600, at £5 a month each, up to 10 packs. They add to the plan's own limit. The WebSocket does not count against requests. ## 8. The stats pack Main lines, Full depth and Player props can add the stats pack for £15 a month: team stats and form, match previews, competition averages and stats filters on matches. It gives `stats:read`. Business includes it. ## Reference | Plan | Markets | Also includes | Abilities | | --- | --- | --- | --- | | Free | Seven main markets, 60 seconds behind | | `fixtures:read`, `markets:read` | | Main lines | Seven main markets | | `fixtures:read`, `markets:read` | | Full depth | Every match and team market | Bet Builder match and team sections, live tracker, player stats sheet, live tables | `fixtures:read`, `markets:read` | | Player props | Every market, with player markets | Bet Builder player sections, in-play combos | Full depth | | Business | Every market, with player markets | Opening and closing lines, price history, the WebSocket | Player props, plus `stream:read`, `stream:firehose` and `history:read` | | Plan | Requests | WebSocket | Connections at once | | --- | --- | --- | --- | | Free | 1,000 a day | Not available | | | Main lines | 600 a minute | Add-on, £25 a month | 1 | | Full depth | 600 a minute | Add-on, £25 a month | 1 | | Player props | 600 a minute | Add-on, £25 a month | 2 | | Business | 3,000 a minute | Included | 5 | The [market keys](market-keys.md) page lists the plan each market needs. # Rate limits Use this page to see how many requests a key may make and what to do when you reach the limit. The limits count requests to `/api/v2`, per key. ## 1. Read the headers Every response carries `X-RateLimit-Limit`, the requests allowed in a minute, and `X-RateLimit-Remaining`, the requests left in this minute. ```bash curl -s -o /dev/null "https://odds-feed.on-forge.com/api/v2/status" \ -H "Authorization: Bearer YOUR_KEY" \ -w '{"limit": %header{x-ratelimit-limit}, "remaining": %header{x-ratelimit-remaining}}\n' ``` ```js const response = await fetch('https://odds-feed.on-forge.com/api/v2/status', { headers: { Authorization: 'Bearer YOUR_KEY' }, }); console.log(JSON.stringify({ limit: Number(response.headers.get('X-RateLimit-Limit')), remaining: Number(response.headers.get('X-RateLimit-Remaining')), }, null, 2)); ``` ```python import json import requests response = requests.get( 'https://odds-feed.on-forge.com/api/v2/status', headers={'Authorization': 'Bearer YOUR_KEY'}, ) print(json.dumps({ 'limit': int(response.headers['X-RateLimit-Limit']), 'remaining': int(response.headers['X-RateLimit-Remaining']), }, indent=2)) ``` ```php use Illuminate\Support\Facades\Http; $response = Http::withToken('YOUR_KEY')->get('https://odds-feed.on-forge.com/api/v2/status'); echo json_encode([ 'limit' => (int) $response->header('X-RateLimit-Limit'), 'remaining' => (int) $response->header('X-RateLimit-Remaining'), ], JSON_PRETTY_PRINT); ``` ```json { "limit": 6000, "remaining": 5990 } ``` ## 2. Wait when you reach the limit When you pass the limit the answer is `429` with the code `rate_limited`. The `Retry-After` header says how many seconds to wait. Wait that long, then send the request again. ## 3. Stay within your plan's daily allowance Free keys also have a daily allowance of 1,000 requests, shared by every key on the account and counted from 00:00 UTC. Paid plans have no daily allowance. When you use it up, every request answers `429` with the code `rate_limited` until 00:00 UTC. The message gives the reset time, and `Retry-After` gives the seconds left. ## 4. Poll no faster than your plan refreshes On Main lines, Full depth and Player props without the WebSocket, match and odds reads refresh every 15 seconds. The `X-Refreshes-Every` header gives the seconds, `Cache-Control` says how long the answer you have stays current, and sending its `ETag` back in `If-None-Match` answers `304` when nothing has changed. Asking more often returns the same answer. ## 5. Use live updates instead of polling If you need each change as it happens, [live updates](connecting.md) send it within 250 milliseconds and cost no requests. Keys with the WebSocket read REST live as well. ## Reference | Limit | Applies to | Default | | --- | --- | --- | | API | All `/api/v2` endpoints | Per account: 60 a minute on Free, 600 on Main lines, Full depth and Player props, 3,000 on Business | | Extra requests | All `/api/v2` endpoints | Any paid plan can add packs of 600 a minute, £5 a month each, up to 10 packs | | Refresh | Match and odds reads | Every 15 seconds on Main lines, Full depth and Player props without the WebSocket | | Bet Builder capture | `POST /matches/{id}/betbuilder/capture` | 20 requests a minute per key, as well as the API limit | | Daily allowance | All `/api/v2` endpoints | 1,000 requests a day per account on Free, none on paid plans | Business plans have higher limits. # Errors Use this page to handle a failed request. Every error is built the same way, so one handler covers every endpoint. ## 1. Read the error An error is JSON with an `error` object. `code` is stable, so branch on it. `message` is for people. A `400` also carries `fields`, a list of problems for each parameter. ```bash curl "https://odds-feed.on-forge.com/api/v2/matches?cup=maybe&limit=0" \ -H "Authorization: Bearer YOUR_KEY" ``` ```js const params = new URLSearchParams({ cup: 'maybe', limit: '0' }); const response = await fetch(`https://odds-feed.on-forge.com/api/v2/matches?${params}`, { headers: { Authorization: 'Bearer YOUR_KEY' }, }); console.log(JSON.stringify(await response.json(), null, 2)); ``` ```python import json import requests response = requests.get( 'https://odds-feed.on-forge.com/api/v2/matches', headers={'Authorization': 'Bearer YOUR_KEY'}, params={'cup': 'maybe', 'limit': 0}, ) print(json.dumps(response.json(), indent=2)) ``` ```php use Illuminate\Support\Facades\Http; $response = Http::withToken('YOUR_KEY')->get('https://odds-feed.on-forge.com/api/v2/matches', ['cup' => 'maybe', 'limit' => 0]); echo json_encode($response->json(), JSON_PRETTY_PRINT); ``` ```json { "error": { "status": 400, "code": "bad_request", "message": "The request was invalid.", "fields": { "limit": ["The limit field must be at least 1."], "cup": ["The cup field must be 1, 0, true or false."] } } } ``` ## 2. Handle a missing ability A key without the ability an endpoint needs, or a plan without the markets you asked for, gets a `403` with the code `not_entitled`. Here the key only has `fixtures:read`. ```bash curl "https://odds-feed.on-forge.com/api/v2/odds?matches=0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70" \ -H "Authorization: Bearer LIMITED_KEY" ``` ```js const params = new URLSearchParams({ matches: '0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70' }); const response = await fetch(`https://odds-feed.on-forge.com/api/v2/odds?${params}`, { headers: { Authorization: 'Bearer LIMITED_KEY' }, }); console.log(JSON.stringify(await response.json(), null, 2)); ``` ```python import json import requests response = requests.get( 'https://odds-feed.on-forge.com/api/v2/odds', headers={'Authorization': 'Bearer LIMITED_KEY'}, params={'matches': '0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70'}, ) print(json.dumps(response.json(), indent=2)) ``` ```php use Illuminate\Support\Facades\Http; $response = Http::withToken('LIMITED_KEY')->get('https://odds-feed.on-forge.com/api/v2/odds', ['matches' => '0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70']); echo json_encode($response->json(), JSON_PRETTY_PRINT); ``` ```json { "error": { "status": 403, "code": "not_entitled", "message": "This key lacks the markets:read ability." } } ``` ## 3. Handle a missing record An unknown id, or one that is not a UUID, gets a `404`. The code says what was not found. ```bash curl "https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-0000-7000-8000-00000000dead" \ -H "Authorization: Bearer YOUR_KEY" ``` ```js const response = await fetch('https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-0000-7000-8000-00000000dead', { headers: { Authorization: 'Bearer YOUR_KEY' }, }); console.log(JSON.stringify(await response.json(), null, 2)); ``` ```python import json import requests response = requests.get( 'https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-0000-7000-8000-00000000dead', headers={'Authorization': 'Bearer YOUR_KEY'}, ) print(json.dumps(response.json(), indent=2)) ``` ```php use Illuminate\Support\Facades\Http; $response = Http::withToken('YOUR_KEY')->get('https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-0000-7000-8000-00000000dead'); echo json_encode($response->json(), JSON_PRETTY_PRINT); ``` ```json { "error": { "status": 404, "code": "match_not_found", "message": "No match has this id." } } ``` ## 4. Decide whether to retry | Status | Retry | | --- | --- | | `400`, `401`, `403`, `404` | No. Change the request, the key or the plan. | | `429` | Yes, after the seconds in `Retry-After`. See [Rate limits](rate-limits.md). | | `500` | Yes, after a short wait. | Every code is listed in [Error codes](error-codes.md). # Live and upcoming games Use this page to list the matches that are live, the matches in a time window and the matches on one local day. All three are requests to `GET /matches`. ## 1. List live matches Filter on `status`. The values are `scheduled`, `live`, `ended`, `postponed` and `cancelled`. ```bash curl "https://odds-feed.on-forge.com/api/v2/matches?status=live" \ -H "Authorization: Bearer YOUR_KEY" ``` ```js const params = new URLSearchParams({ status: 'live' }); const response = await fetch(`https://odds-feed.on-forge.com/api/v2/matches?${params}`, { headers: { Authorization: 'Bearer YOUR_KEY' }, }); console.log(JSON.stringify(await response.json(), null, 2)); ``` ```python import json import requests response = requests.get( 'https://odds-feed.on-forge.com/api/v2/matches', headers={'Authorization': 'Bearer YOUR_KEY'}, params={'status': 'live'}, ) print(json.dumps(response.json(), indent=2)) ``` ```php use Illuminate\Support\Facades\Http; $response = Http::withToken('YOUR_KEY')->get('https://odds-feed.on-forge.com/api/v2/matches', ['status' => 'live']); echo json_encode($response->json(), JSON_PRETTY_PRINT); ``` ```json { "data": [ { "id": "0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70", "status": "live", "home": { "id": "0199c5a0-0000-7000-8000-000000000001", "name": "Brentford" }, "away": { "id": "0199c5a0-0000-7000-8000-000000000002", "name": "Everton" }, "…": "…" } ], "meta": { "next_cursor": null, "has_more": false }, "links": { "next": null } } ``` ## 2. List upcoming matches in a window Use `from` and `to` for a time window. `from` is inclusive, `to` is exclusive and must be after `from`. ```bash curl "https://odds-feed.on-forge.com/api/v2/matches?status=scheduled&from=2026-03-14T00:00:00Z&to=2026-03-16T00:00:00Z" \ -H "Authorization: Bearer YOUR_KEY" ``` ```js const params = new URLSearchParams({ status: 'scheduled', from: '2026-03-14T00:00:00Z', to: '2026-03-16T00:00:00Z' }); const response = await fetch(`https://odds-feed.on-forge.com/api/v2/matches?${params}`, { headers: { Authorization: 'Bearer YOUR_KEY' }, }); console.log(JSON.stringify(await response.json(), null, 2)); ``` ```python import json import requests response = requests.get( 'https://odds-feed.on-forge.com/api/v2/matches', headers={'Authorization': 'Bearer YOUR_KEY'}, params={'status': 'scheduled', 'from': '2026-03-14T00:00:00Z', 'to': '2026-03-16T00:00:00Z'}, ) print(json.dumps(response.json(), indent=2)) ``` ```php use Illuminate\Support\Facades\Http; $response = Http::withToken('YOUR_KEY')->get('https://odds-feed.on-forge.com/api/v2/matches', ['status' => 'scheduled', 'from' => '2026-03-14T00:00:00Z', 'to' => '2026-03-16T00:00:00Z']); echo json_encode($response->json(), JSON_PRETTY_PRINT); ``` ```json { "data": [ { "id": "0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e71", "status": "scheduled", "home": { "id": "0199c5a0-0000-7000-8000-000000000003", "name": "Aston Villa" }, "away": { "id": "0199c5a0-0000-7000-8000-000000000004", "name": "Sunderland" }, "bet_builder": { "status": "available" }, "…": "…" } ], "meta": { "has_more": false }, "…": "…" } ``` ## 3. List a local day `date` and `tz` return the matches that kick off on one calendar day in a time zone. `tz` is an IANA name and defaults to `UTC`. ```bash curl "https://odds-feed.on-forge.com/api/v2/matches?date=2026-03-14&tz=Europe/London" \ -H "Authorization: Bearer YOUR_KEY" ``` ```js const params = new URLSearchParams({ date: '2026-03-14', tz: 'Europe/London' }); const response = await fetch(`https://odds-feed.on-forge.com/api/v2/matches?${params}`, { headers: { Authorization: 'Bearer YOUR_KEY' }, }); console.log(JSON.stringify(await response.json(), null, 2)); ``` ```python import json import requests response = requests.get( 'https://odds-feed.on-forge.com/api/v2/matches', headers={'Authorization': 'Bearer YOUR_KEY'}, params={'date': '2026-03-14', 'tz': 'Europe/London'}, ) print(json.dumps(response.json(), indent=2)) ``` ```php use Illuminate\Support\Facades\Http; $response = Http::withToken('YOUR_KEY')->get('https://odds-feed.on-forge.com/api/v2/matches', ['date' => '2026-03-14', 'tz' => 'Europe/London']); echo json_encode($response->json(), JSON_PRETTY_PRINT); ``` ```json { "data": [ { "id": "0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70", "home": { "name": "Brentford", "…": "…" }, "…": "…" } ], "…": "…" } ``` ## Reference Fields on a match. | Field | Type | Notes | | --- | --- | --- | | `id` | string | Match id. | | `kickoff_at` | string or null | UTC. | | `status` | string | See [Game details](game-details.md). | | `competition` | object | `id`, `name`, `tier`, `gender`, `age_group`, `is_cup`, `is_continental`, `is_friendly`. | | `home`, `away` | object | `id` and `name`. | | `refs` | list | Ids other systems use for the match. See [External ids](external-ids.md). | | `bet_builder` | object | `status` is `available`, `partial` or `unavailable`, with a `reason` unless it is available. See [Bet Builder before the game](bet-builder-pre-match.md). | # Filtering games Use this page to narrow `GET /matches` by competition, team, competition type or odds, and to change the order. Filters can be combined in one request. ## 1. Filter by competition Pass a competition `id` as `competition`. To find the id from a name, see [Searching teams and competitions](searching-teams-and-competitions.md). ```bash curl "https://odds-feed.on-forge.com/api/v2/matches?competition=0199c5a0-0000-7000-9000-000000000001&status=scheduled" \ -H "Authorization: Bearer YOUR_KEY" ``` ```js const params = new URLSearchParams({ competition: '0199c5a0-0000-7000-9000-000000000001', status: 'scheduled' }); const response = await fetch(`https://odds-feed.on-forge.com/api/v2/matches?${params}`, { headers: { Authorization: 'Bearer YOUR_KEY' }, }); console.log(JSON.stringify(await response.json(), null, 2)); ``` ```python import json import requests response = requests.get( 'https://odds-feed.on-forge.com/api/v2/matches', headers={'Authorization': 'Bearer YOUR_KEY'}, params={'competition': '0199c5a0-0000-7000-9000-000000000001', 'status': 'scheduled'}, ) print(json.dumps(response.json(), indent=2)) ``` ```php use Illuminate\Support\Facades\Http; $response = Http::withToken('YOUR_KEY')->get('https://odds-feed.on-forge.com/api/v2/matches', ['competition' => '0199c5a0-0000-7000-9000-000000000001', 'status' => 'scheduled']); echo json_encode($response->json(), JSON_PRETTY_PRINT); ``` ```json { "data": [ { "competition": { "id": "0199c5a0-0000-7000-9000-000000000001", "name": "Premier League", "…": "…" }, "home": { "name": "Aston Villa", "…": "…" }, "…": "…" } ], "…": "…" } ``` `competition` also accepts an exact competition name. ## 2. Filter by team Pass a team `id` as `team`. A team matches whether it plays at home or away. ```bash curl "https://odds-feed.on-forge.com/api/v2/matches?team=0199c5a0-0000-7000-8000-000000000001" \ -H "Authorization: Bearer YOUR_KEY" ``` ```js const params = new URLSearchParams({ team: '0199c5a0-0000-7000-8000-000000000001' }); const response = await fetch(`https://odds-feed.on-forge.com/api/v2/matches?${params}`, { headers: { Authorization: 'Bearer YOUR_KEY' }, }); console.log(JSON.stringify(await response.json(), null, 2)); ``` ```python import json import requests response = requests.get( 'https://odds-feed.on-forge.com/api/v2/matches', headers={'Authorization': 'Bearer YOUR_KEY'}, params={'team': '0199c5a0-0000-7000-8000-000000000001'}, ) print(json.dumps(response.json(), indent=2)) ``` ```php use Illuminate\Support\Facades\Http; $response = Http::withToken('YOUR_KEY')->get('https://odds-feed.on-forge.com/api/v2/matches', ['team' => '0199c5a0-0000-7000-8000-000000000001']); echo json_encode($response->json(), JSON_PRETTY_PRINT); ``` ```json { "data": [ { "home": { "name": "Brentford", "…": "…" }, "away": { "name": "Everton", "…": "…" }, "…": "…" } ], "…": "…" } ``` ## 3. Filter by competition type `tier`, `gender`, `age_group`, `cup`, `continental` and `friendly` filter on how the competition is classified. The yes/no filters take `1`, `0`, `true` or `false`. ```bash curl "https://odds-feed.on-forge.com/api/v2/matches?tier=T2&cup=0&gender=men" \ -H "Authorization: Bearer YOUR_KEY" ``` ```js const params = new URLSearchParams({ tier: 'T2', cup: '0', gender: 'men' }); const response = await fetch(`https://odds-feed.on-forge.com/api/v2/matches?${params}`, { headers: { Authorization: 'Bearer YOUR_KEY' }, }); console.log(JSON.stringify(await response.json(), null, 2)); ``` ```python import json import requests response = requests.get( 'https://odds-feed.on-forge.com/api/v2/matches', headers={'Authorization': 'Bearer YOUR_KEY'}, params={'tier': 'T2', 'cup': 0, 'gender': 'men'}, ) print(json.dumps(response.json(), indent=2)) ``` ```php use Illuminate\Support\Facades\Http; $response = Http::withToken('YOUR_KEY')->get('https://odds-feed.on-forge.com/api/v2/matches', ['tier' => 'T2', 'cup' => 0, 'gender' => 'men']); echo json_encode($response->json(), JSON_PRETTY_PRINT); ``` ```json { "data": [ { "home": { "name": "Leeds", "…": "…" }, "competition": { "name": "Championship", "tier": "T2", "is_cup": false, "…": "…" }, "…": "…" } ], "…": "…" } ``` ## 4. Keep only matches with odds `has_odds=1` keeps matches we hold prices for. `market` keeps matches that offer a market, using the keys from `/markets` (see [The market list](market-list.md)). Both read an index that is up to a minute old, and `meta.odds_index_at` says when it was built. ```bash curl "https://odds-feed.on-forge.com/api/v2/matches?has_odds=1&market=corners.race" \ -H "Authorization: Bearer YOUR_KEY" ``` ```js const params = new URLSearchParams({ has_odds: '1', market: 'corners.race' }); const response = await fetch(`https://odds-feed.on-forge.com/api/v2/matches?${params}`, { headers: { Authorization: 'Bearer YOUR_KEY' }, }); console.log(JSON.stringify(await response.json(), null, 2)); ``` ```python import json import requests response = requests.get( 'https://odds-feed.on-forge.com/api/v2/matches', headers={'Authorization': 'Bearer YOUR_KEY'}, params={'has_odds': 1, 'market': 'corners.race'}, ) print(json.dumps(response.json(), indent=2)) ``` ```php use Illuminate\Support\Facades\Http; $response = Http::withToken('YOUR_KEY')->get('https://odds-feed.on-forge.com/api/v2/matches', ['has_odds' => 1, 'market' => 'corners.race']); echo json_encode($response->json(), JSON_PRETTY_PRINT); ``` ```json { "data": [ { "home": { "name": "Brentford", "…": "…" }, "…": "…" } ], "meta": { "odds_index_at": "2026-11-27T10:41:00.000Z", "…": "…" }, "…": "…" } ``` ## 5. Sort `sort` is `kickoff` (the default), `-kickoff` for latest first, or `tier` for the top competitions first. ```bash curl "https://odds-feed.on-forge.com/api/v2/matches?status=scheduled&sort=-kickoff&limit=2" \ -H "Authorization: Bearer YOUR_KEY" ``` ```js const params = new URLSearchParams({ status: 'scheduled', sort: '-kickoff', limit: '2' }); const response = await fetch(`https://odds-feed.on-forge.com/api/v2/matches?${params}`, { headers: { Authorization: 'Bearer YOUR_KEY' }, }); console.log(JSON.stringify(await response.json(), null, 2)); ``` ```python import json import requests response = requests.get( 'https://odds-feed.on-forge.com/api/v2/matches', headers={'Authorization': 'Bearer YOUR_KEY'}, params={'status': 'scheduled', 'sort': '-kickoff', 'limit': 2}, ) print(json.dumps(response.json(), indent=2)) ``` ```php use Illuminate\Support\Facades\Http; $response = Http::withToken('YOUR_KEY')->get('https://odds-feed.on-forge.com/api/v2/matches', ['status' => 'scheduled', 'sort' => '-kickoff', 'limit' => 2]); echo json_encode($response->json(), JSON_PRETTY_PRINT); ``` ```json { "data": [ { "home": { "name": "Leeds", "…": "…" }, "…": "…" }, { "home": { "name": "Arsenal Women", "…": "…" }, "…": "…" }, "…" ], "meta": { "has_more": true, "…": "…" }, "…": "…" } ``` ## Reference Filters on `GET /matches`. | Parameter | Values | Notes | | --- | --- | --- | | `status` | `scheduled`, `live`, `ended`, `postponed`, `cancelled` | | | `from`, `to` | Date or date-time | `to` must be after `from`. `from` is inclusive, `to` is exclusive. | | `date`, `tz` | `YYYY-MM-DD`, IANA time zone | `tz` defaults to `UTC`. | | `competition` | Competition id or exact name | | | `team` | Team id | Home or away. | | `q` | 2 to 100 characters | Matches home, away and competition names. | | `tier` | `T1`, `T2`, `T3`, `T4` | `T1` is the top tier. | | `gender` | `men`, `women` | | | `age_group` | `senior`, `youth` | | | `cup`, `continental`, `friendly` | `1`, `0`, `true`, `false` | | | `has_odds` | `1`, `0`, `true`, `false` | | | `market` | Comma separated market keys | Keys from `/markets`, or a player market type. | | `sort` | `kickoff`, `-kickoff`, `tier` | | | `limit` | 1 to 500 | Default 100. | | `cursor` | Value of `meta.next_cursor` | See [Paging with cursors](paging-with-cursors.md). | The stats filters on this endpoint are covered in [Filtering matches by stats](filtering-by-stats.md). # Searching teams and competitions Use this page to find the id of a competition or a team from its name, and to search matches by name. The ids are what the filters on [Filtering games](filtering-games.md) take. ## 1. Find a competition Search competitions with `q`, which ignores case and accents. The `id` of a result is what `/matches` takes as `competition`. ```bash curl "https://odds-feed.on-forge.com/api/v2/competitions?q=premier" \ -H "Authorization: Bearer YOUR_KEY" ``` ```js const params = new URLSearchParams({ q: 'premier' }); const response = await fetch(`https://odds-feed.on-forge.com/api/v2/competitions?${params}`, { headers: { Authorization: 'Bearer YOUR_KEY' }, }); console.log(JSON.stringify(await response.json(), null, 2)); ``` ```python import json import requests response = requests.get( 'https://odds-feed.on-forge.com/api/v2/competitions', headers={'Authorization': 'Bearer YOUR_KEY'}, params={'q': 'premier'}, ) print(json.dumps(response.json(), indent=2)) ``` ```php use Illuminate\Support\Facades\Http; $response = Http::withToken('YOUR_KEY')->get('https://odds-feed.on-forge.com/api/v2/competitions', ['q' => 'premier']); echo json_encode($response->json(), JSON_PRETTY_PRINT); ``` ```json { "data": [ { "id": "0199c5a0-0000-7000-9000-000000000001", "name": "Premier League", "cc": "gb", "tier": "T1", "gender": "men", "age_group": "senior", "is_cup": false, "is_continental": false, "is_friendly": false, "upcoming_matches": 1 } ], "meta": { "next_cursor": null, "has_more": false }, "links": { "next": null } } ``` ## 2. Find a team Search teams with `q`. The `id` of a result is what `/matches` takes as `team`. ```bash curl "https://odds-feed.on-forge.com/api/v2/teams?q=brentford" \ -H "Authorization: Bearer YOUR_KEY" ``` ```js const params = new URLSearchParams({ q: 'brentford' }); const response = await fetch(`https://odds-feed.on-forge.com/api/v2/teams?${params}`, { headers: { Authorization: 'Bearer YOUR_KEY' }, }); console.log(JSON.stringify(await response.json(), null, 2)); ``` ```python import json import requests response = requests.get( 'https://odds-feed.on-forge.com/api/v2/teams', headers={'Authorization': 'Bearer YOUR_KEY'}, params={'q': 'brentford'}, ) print(json.dumps(response.json(), indent=2)) ``` ```php use Illuminate\Support\Facades\Http; $response = Http::withToken('YOUR_KEY')->get('https://odds-feed.on-forge.com/api/v2/teams', ['q' => 'brentford']); echo json_encode($response->json(), JSON_PRETTY_PRINT); ``` ```json { "data": [ { "id": "0199c5a0-0000-7000-8000-000000000001", "name": "Brentford", "gender": "men", "age_group": "senior", "refs": [] } ], "meta": { "next_cursor": null, "has_more": false }, "links": { "next": null } } ``` ## 3. Search matches by name `q` on `/matches` searches home team, away team and competition names. It needs at least two characters. ```bash curl "https://odds-feed.on-forge.com/api/v2/matches?q=sunderland" \ -H "Authorization: Bearer YOUR_KEY" ``` ```js const params = new URLSearchParams({ q: 'sunderland' }); const response = await fetch(`https://odds-feed.on-forge.com/api/v2/matches?${params}`, { headers: { Authorization: 'Bearer YOUR_KEY' }, }); console.log(JSON.stringify(await response.json(), null, 2)); ``` ```python import json import requests response = requests.get( 'https://odds-feed.on-forge.com/api/v2/matches', headers={'Authorization': 'Bearer YOUR_KEY'}, params={'q': 'sunderland'}, ) print(json.dumps(response.json(), indent=2)) ``` ```php use Illuminate\Support\Facades\Http; $response = Http::withToken('YOUR_KEY')->get('https://odds-feed.on-forge.com/api/v2/matches', ['q' => 'sunderland']); echo json_encode($response->json(), JSON_PRETTY_PRINT); ``` ```json { "data": [ { "home": { "name": "Aston Villa", "…": "…" }, "away": { "name": "Sunderland", "…": "…" }, "…": "…" } ], "…": "…" } ``` ## 4. Read one competition `GET /competitions/{id}` returns the competition on its own, with how many upcoming matches it has. ```bash curl "https://odds-feed.on-forge.com/api/v2/competitions/0199c5a0-0000-7000-9000-000000000001" \ -H "Authorization: Bearer YOUR_KEY" ``` ```js const response = await fetch('https://odds-feed.on-forge.com/api/v2/competitions/0199c5a0-0000-7000-9000-000000000001', { headers: { Authorization: 'Bearer YOUR_KEY' }, }); console.log(JSON.stringify(await response.json(), null, 2)); ``` ```python import json import requests response = requests.get( 'https://odds-feed.on-forge.com/api/v2/competitions/0199c5a0-0000-7000-9000-000000000001', headers={'Authorization': 'Bearer YOUR_KEY'}, ) print(json.dumps(response.json(), indent=2)) ``` ```php use Illuminate\Support\Facades\Http; $response = Http::withToken('YOUR_KEY')->get('https://odds-feed.on-forge.com/api/v2/competitions/0199c5a0-0000-7000-9000-000000000001'); echo json_encode($response->json(), JSON_PRETTY_PRINT); ``` ```json { "data": { "id": "0199c5a0-0000-7000-9000-000000000001", "name": "Premier League", "cc": "gb", "tier": "T1", "gender": "men", "age_group": "senior", "is_cup": false, "is_continental": false, "is_friendly": false, "upcoming_matches": 1 }, "meta": { "generated_at": "2026-11-27T14:06:24.722Z" }, "links": { "self": "/api/v2/competitions/0199c5a0-0000-7000-9000-000000000001" } } ``` ## 5. Read one team `GET /teams/{id}` returns the team with the ids other systems use for it in `refs`. ```bash curl "https://odds-feed.on-forge.com/api/v2/teams/0199c5a0-0000-7000-8000-000000000001" \ -H "Authorization: Bearer YOUR_KEY" ``` ```js const response = await fetch('https://odds-feed.on-forge.com/api/v2/teams/0199c5a0-0000-7000-8000-000000000001', { headers: { Authorization: 'Bearer YOUR_KEY' }, }); console.log(JSON.stringify(await response.json(), null, 2)); ``` ```python import json import requests response = requests.get( 'https://odds-feed.on-forge.com/api/v2/teams/0199c5a0-0000-7000-8000-000000000001', headers={'Authorization': 'Bearer YOUR_KEY'}, ) print(json.dumps(response.json(), indent=2)) ``` ```php use Illuminate\Support\Facades\Http; $response = Http::withToken('YOUR_KEY')->get('https://odds-feed.on-forge.com/api/v2/teams/0199c5a0-0000-7000-8000-000000000001'); echo json_encode($response->json(), JSON_PRETTY_PRINT); ``` ```json { "data": { "id": "0199c5a0-0000-7000-8000-000000000001", "name": "Brentford", "gender": "men", "age_group": "senior", "refs": [] }, "meta": { "generated_at": "2026-11-27T14:06:24.809Z" }, "links": { "self": "/api/v2/teams/0199c5a0-0000-7000-8000-000000000001" } } ``` ## Reference Filters on `GET /competitions`: `q`, `tier`, `gender`, `age_group`, `cup`, `cc` (a country code such as `gb`), `limit` and `cursor`. Filters on `GET /teams`: `q`, `competition` (a competition id), `limit` and `cursor`. # Paging with cursors Use this page to read a list that is longer than one page. Every list endpoint pages the same way, with an opaque cursor. ## 1. Read the first page A list holds up to `limit` items. The default is 100 and the maximum is 500 for matches, competitions and teams. When `meta.has_more` is true, there is another page. ```bash curl "https://odds-feed.on-forge.com/api/v2/matches?status=scheduled&limit=2" \ -H "Authorization: Bearer YOUR_KEY" ``` ```js const params = new URLSearchParams({ status: 'scheduled', limit: '2' }); const response = await fetch(`https://odds-feed.on-forge.com/api/v2/matches?${params}`, { headers: { Authorization: 'Bearer YOUR_KEY' }, }); console.log(JSON.stringify(await response.json(), null, 2)); ``` ```python import json import requests response = requests.get( 'https://odds-feed.on-forge.com/api/v2/matches', headers={'Authorization': 'Bearer YOUR_KEY'}, params={'status': 'scheduled', 'limit': 2}, ) print(json.dumps(response.json(), indent=2)) ``` ```php use Illuminate\Support\Facades\Http; $response = Http::withToken('YOUR_KEY')->get('https://odds-feed.on-forge.com/api/v2/matches', ['status' => 'scheduled', 'limit' => 2]); echo json_encode($response->json(), JSON_PRETTY_PRINT); ``` ```json { "data": [ { "…": "…" }, { "…": "…" } ], "meta": { "next_cursor": "eyJzIjoia2lja29mZiIs...", "has_more": true, "…": "…" }, "links": { "next": "/api/v2/matches?status=scheduled&limit=2&cursor=eyJzIjoia2lja29mZiIs..." } } ``` ## 2. Read the next page Send `meta.next_cursor` back as `cursor` with the same filters, and keep going until `has_more` is false. Treat the cursor as opaque and never build one yourself. ```bash curl "https://odds-feed.on-forge.com/api/v2/matches?status=scheduled&limit=2&cursor=YOUR_CURSOR" \ -H "Authorization: Bearer YOUR_KEY" ``` ```js const params = new URLSearchParams({ status: 'scheduled', limit: '2', cursor: 'YOUR_CURSOR' }); const response = await fetch(`https://odds-feed.on-forge.com/api/v2/matches?${params}`, { headers: { Authorization: 'Bearer YOUR_KEY' }, }); console.log(JSON.stringify(await response.json(), null, 2)); ``` ```python import json import requests response = requests.get( 'https://odds-feed.on-forge.com/api/v2/matches', headers={'Authorization': 'Bearer YOUR_KEY'}, params={'status': 'scheduled', 'limit': 2, 'cursor': 'YOUR_CURSOR'}, ) print(json.dumps(response.json(), indent=2)) ``` ```php use Illuminate\Support\Facades\Http; $response = Http::withToken('YOUR_KEY')->get('https://odds-feed.on-forge.com/api/v2/matches', ['status' => 'scheduled', 'limit' => 2, 'cursor' => 'YOUR_CURSOR']); echo json_encode($response->json(), JSON_PRETTY_PRINT); ``` ```json { "data": [ { "…": "…" }, { "…": "…" } ], "meta": { "next_cursor": null, "has_more": false, "…": "…" }, "…": "…" } ``` On the last page `next_cursor` is `null`. `links.next` is the same request for the next page as a relative path. ## 3. Start a feed from the beginning or from now [`GET /changes`](catching-up.md) is the one list that also accepts two special cursor values. Other endpoints reject them. | Cursor | Meaning | | --- | --- | | Empty, as in `cursor=` | Start from the latest change. The list is empty and `meta.cursor` is where to resume. | | `0` | Start from the oldest change we keep. | | A message id | Everything after that message. | ## Reference Page sizes. | Endpoint | Default `limit` | Maximum | | --- | --- | --- | | `GET /matches`, `/competitions`, `/teams` | 100 | 500 | | `GET /changes` | 500 | 2000 | | `GET /matches/{id}/odds/history` | 2000 | 2000 | | `GET /matches/{id}/odds/lines` | 1000 | 5000 | | `GET /refs/export` | 1000 | 5000 | # Game details and statuses Use this page to read one match and understand its status. Everything else on a match hangs off the match `id`. ## 1. Get a match Request a match by its id. The id comes from `/matches` or from a ref lookup on [External ids](external-ids.md). ```bash curl "https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70" \ -H "Authorization: Bearer YOUR_KEY" ``` ```js const response = await fetch('https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70', { headers: { Authorization: 'Bearer YOUR_KEY' }, }); console.log(JSON.stringify(await response.json(), null, 2)); ``` ```python import json import requests response = requests.get( 'https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70', headers={'Authorization': 'Bearer YOUR_KEY'}, ) print(json.dumps(response.json(), indent=2)) ``` ```php use Illuminate\Support\Facades\Http; $response = Http::withToken('YOUR_KEY')->get('https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70'); echo json_encode($response->json(), JSON_PRETTY_PRINT); ``` ```json { "data": { "id": "0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70", "kickoff_at": "2026-11-27T09:40:20.000Z", "status": "live", "competition": { "id": "0199c5a0-0000-7000-9000-000000000001", "name": "Premier League", "…": "…" }, "home": { "id": "0199c5a0-0000-7000-8000-000000000001", "name": "Brentford" }, "away": { "id": "0199c5a0-0000-7000-8000-000000000002", "name": "Everton" }, "venue": { "id": "0199c5a0-0000-7000-a000-000000000001", "name": "Gtech Community Stadium", "city": "London", "country": "England", "capacity": 17250, "location": { "lat": 51.4907, "lng": -0.2886 } }, "refs": [{ "source": "bet365", "type": "fixture", "id": "203186268" }] }, "meta": { "generated_at": "2026-11-27T10:41:00.000Z", "match": "0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70" }, "links": { "self": "/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70" } } ``` An unknown id, or one that is not a UUID, returns `404` with the code `match_not_found`. `venue` is the ground the match is played at, or `null` when we do not know it yet. See [Venues and weather](venues-and-weather.md). ## 2. Read the status `status` moves forward through the life of a match and does not go back. A match is `scheduled` until it kicks off, `live` while it is being played, and `ended` once it has finished. A `postponed` match returns to the schedule if it is replayed, and a `cancelled` match is final. | Status | Meaning | | --- | --- | | `scheduled` | Not started. `kickoff_at` is the planned kick-off. | | `live` | In play. Live odds, the tracker and stats are available. | | `ended` | Finished. Stats and history stay available. | | `postponed` | Called off for now. | | `cancelled` | Called off for good. | To follow status changes as they happen, subscribe to the `private-matches` channel described in [Channels](channels.md). ## 3. Read the match's data Each kind of data on a match has its own path, `/matches/{id}/{topic}`. When we hold nothing for a topic the answer is still `200`, with `data` set to `null` and the reason in `meta.availability`. | Topic | What it holds | Page | | --- | --- | --- | | `odds` | Prices for the match. | [Reading prices](reading-prices.md) | | `tracker` | The live tracker: score, ball, momentum, incidents. | [Score and tracker](score-and-tracker.md) | | `stats` | Counters such as corners. | [Stats](stats.md) | | `players` | Players and their live stats. | [Players](players.md) | | `table` | The league table the match belongs to. | [Live tables](live-tables.md) | | `betbuilder` | Bet Builder combinations. | [Bet Builder before the game](bet-builder-pre-match.md) | | `weather` | Forecasts for the venue, with attribution. | [Venues and weather](venues-and-weather.md) | ## Reference | Endpoint | Notes | | --- | --- | | `GET /matches/{id}` | `id` must be a UUID. Needs `fixtures:read`. | | `GET /matches/{id}/{topic}` | `topic` is one of the topics above. Each needs the ability on [Abilities](abilities.md). | # Venues and weather Use this page to read the ground a match is played at and the weather forecast for it. Both are read from the match, so you need the match `id` first. ## 1. Read the venue A match carries `venue` with the ground's `id`. `GET /venues/{id}` returns the same fields plus `refs`, the ids other systems use for the ground. `capacity` and `location` are `null` when we do not hold them, and `location` is never `0,0`. An unknown id returns `404` with the code `venue_not_found`. ```bash curl "https://odds-feed.on-forge.com/api/v2/venues/0199c5a0-0000-7000-a000-000000000002" \ -H "Authorization: Bearer YOUR_KEY" ``` ```js const response = await fetch('https://odds-feed.on-forge.com/api/v2/venues/0199c5a0-0000-7000-a000-000000000002', { headers: { Authorization: 'Bearer YOUR_KEY' }, }); console.log(JSON.stringify(await response.json(), null, 2)); ``` ```python import json import requests response = requests.get( 'https://odds-feed.on-forge.com/api/v2/venues/0199c5a0-0000-7000-a000-000000000002', headers={'Authorization': 'Bearer YOUR_KEY'}, ) print(json.dumps(response.json(), indent=2)) ``` ```php use Illuminate\Support\Facades\Http; $response = Http::withToken('YOUR_KEY')->get('https://odds-feed.on-forge.com/api/v2/venues/0199c5a0-0000-7000-a000-000000000002'); echo json_encode($response->json(), JSON_PRETTY_PRINT); ``` ```json { "data": { "id": "0199c5a0-0000-7000-a000-000000000002", "name": "Villa Park", "city": "Birmingham", "country": "England", "capacity": 42682, "location": { "lat": 52.5092, "lng": -1.8847 }, "…": "…" }, "meta": { "generated_at": "2026-11-27T14:11:47.229Z" }, "links": { "self": "/api/v2/venues/0199c5a0-0000-7000-a000-000000000002" } } ``` ## 2. Read the weather `GET /matches/{id}/weather` returns the forecasts for the ground. A match has up to two: `t24h` was taken about 24 hours before kick-off and `t3h` about three hours before. Each is the forecast hour nearest kick-off. ```bash curl "https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e71/weather" \ -H "Authorization: Bearer YOUR_KEY" ``` ```js const response = await fetch('https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e71/weather', { headers: { Authorization: 'Bearer YOUR_KEY' }, }); console.log(JSON.stringify(await response.json(), null, 2)); ``` ```python import json import requests response = requests.get( 'https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e71/weather', headers={'Authorization': 'Bearer YOUR_KEY'}, ) print(json.dumps(response.json(), indent=2)) ``` ```php use Illuminate\Support\Facades\Http; $response = Http::withToken('YOUR_KEY')->get('https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e71/weather'); echo json_encode($response->json(), JSON_PRETTY_PRINT); ``` ```json { "data": { "forecasts": [ { "horizon": "t24h", "forecast_for": "2026-11-28T14:11:22.000Z", "temperature_c": 7.4, "wind_speed_ms": 4.2, "wind_gust_ms": 9.1, "wind_from_deg": 230, "precipitation_mm": 0.4, "cloud_cover_pct": 80, "humidity_pct": 76, "symbol_code": "lightrain" }, "…" ] }, "meta": { "topic": "weather", "sources": [ { "name": "met_norway", "captured_at": "2026-11-27T13:11:22.000Z", "attribution": "Weather data from MET Norway (https://api.met.no/), licensed under CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Values were selected from the forecast hour nearest kick-off by OddsYorkie." } ], "availability": { "status": "available" }, "…": "…" }, "links": { "…": "…" } } ``` The forecasts come from MET Norway under a licence that needs credit. If you show the weather, show `meta.sources[].attribution` with it. A match with no known venue, or one too far away to forecast, answers `200` with `data` set to `null` and `meta.availability` set to `unavailable` with the reason `not_held`. ## Reference Fields of a forecast. | Field | Unit | | --- | --- | | `horizon` | `t24h` or `t3h`. | | `forecast_for` | UTC time the forecast is for. | | `temperature_c` | Degrees Celsius. | | `wind_speed_ms`, `wind_gust_ms` | Metres a second. | | `wind_from_deg` | Degrees the wind blows from. | | `precipitation_mm` | Millimetres in the hour. | | `cloud_cover_pct`, `humidity_pct` | Percent. | | `symbol_code` | A MET Norway weather symbol, such as `lightrain`. | `GET /venues/{id}` and `/matches/{id}/weather` need `fixtures:read`. # External ids Use this page to find a match from an id another system uses, to follow a merged match and to export every id we hold. Ids from other systems are called refs. ## 1. Find a match from another id Matches carry `refs`, the ids other systems use for the same match. Look a match up from one with `/refs`. `source` is `bet365`, `type` is `fixture`, and `id` is the bet365 fixture id. ```bash curl "https://odds-feed.on-forge.com/api/v2/refs?source=bet365&type=fixture&id=203186268" \ -H "Authorization: Bearer YOUR_KEY" ``` ```js const params = new URLSearchParams({ source: 'bet365', type: 'fixture', id: '203186268' }); const response = await fetch(`https://odds-feed.on-forge.com/api/v2/refs?${params}`, { headers: { Authorization: 'Bearer YOUR_KEY' }, }); console.log(JSON.stringify(await response.json(), null, 2)); ``` ```python import json import requests response = requests.get( 'https://odds-feed.on-forge.com/api/v2/refs', headers={'Authorization': 'Bearer YOUR_KEY'}, params={'source': 'bet365', 'type': 'fixture', 'id': 203186268}, ) print(json.dumps(response.json(), indent=2)) ``` ```php use Illuminate\Support\Facades\Http; $response = Http::withToken('YOUR_KEY')->get('https://odds-feed.on-forge.com/api/v2/refs', ['source' => 'bet365', 'type' => 'fixture', 'id' => 203186268]); echo json_encode($response->json(), JSON_PRETTY_PRINT); ``` ```json { "data": { "id": "0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70", "kickoff": "2026-11-27T09:40:20+00:00", "home": "Brentford", "away": "Everton", "competition": "Premier League", "status": "live", "refs": [{ "source": "bet365", "type": "fixture", "id": "203186268" }] }, "meta": {} } ``` An id we do not hold returns `404` with the code `match_not_found`. ## 2. Follow a merged match Two ids for the same match are merged into one. The old id keeps working: the response carries the surviving match and `meta.redirected_from` holds the id you asked for. Store the id in `meta.match`. ```bash curl "https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e7f" \ -H "Authorization: Bearer YOUR_KEY" ``` ```js const response = await fetch('https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e7f', { headers: { Authorization: 'Bearer YOUR_KEY' }, }); console.log(JSON.stringify(await response.json(), null, 2)); ``` ```python import json import requests response = requests.get( 'https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e7f', headers={'Authorization': 'Bearer YOUR_KEY'}, ) print(json.dumps(response.json(), indent=2)) ``` ```php use Illuminate\Support\Facades\Http; $response = Http::withToken('YOUR_KEY')->get('https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e7f'); echo json_encode($response->json(), JSON_PRETTY_PRINT); ``` ```json { "data": { "id": "0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70", "…": "…" }, "meta": { "generated_at": "2026-11-27T10:41:00.000Z", "match": "0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70", "redirected_from": "0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e7f" }, "links": { "self": "/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70" } } ``` ## 3. Export every ref Read `/refs/export` once to learn every match id, then again to catch up. Each row is one ref, in the order it was created. `next_cursor` is the last `seq`, and it is `null` on the last page. ```bash curl "https://odds-feed.on-forge.com/api/v2/refs/export?limit=2" \ -H "Authorization: Bearer YOUR_KEY" ``` ```js const params = new URLSearchParams({ limit: '2' }); const response = await fetch(`https://odds-feed.on-forge.com/api/v2/refs/export?${params}`, { headers: { Authorization: 'Bearer YOUR_KEY' }, }); console.log(JSON.stringify(await response.json(), null, 2)); ``` ```python import json import requests response = requests.get( 'https://odds-feed.on-forge.com/api/v2/refs/export', headers={'Authorization': 'Bearer YOUR_KEY'}, params={'limit': 2}, ) print(json.dumps(response.json(), indent=2)) ``` ```php use Illuminate\Support\Facades\Http; $response = Http::withToken('YOUR_KEY')->get('https://odds-feed.on-forge.com/api/v2/refs/export', ['limit' => 2]); echo json_encode($response->json(), JSON_PRETTY_PRINT); ``` ```json { "data": [ { "seq": 1, "match": "0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70", "source": "bet365", "type": "fixture", "id": "203186268" }, { "seq": 2, "match": "0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e71", "source": "bet365", "type": "fixture", "id": "203186237" } ], "meta": { "count": 2, "next": 2, "next_cursor": "2" } } ``` Send `next_cursor` back as `cursor`. ```bash curl "https://odds-feed.on-forge.com/api/v2/refs/export?limit=2&cursor=YOUR_SEQ" \ -H "Authorization: Bearer YOUR_KEY" ``` ```js const params = new URLSearchParams({ limit: '2', cursor: 'YOUR_SEQ' }); const response = await fetch(`https://odds-feed.on-forge.com/api/v2/refs/export?${params}`, { headers: { Authorization: 'Bearer YOUR_KEY' }, }); console.log(JSON.stringify(await response.json(), null, 2)); ``` ```python import json import requests response = requests.get( 'https://odds-feed.on-forge.com/api/v2/refs/export', headers={'Authorization': 'Bearer YOUR_KEY'}, params={'limit': 2, 'cursor': 'YOUR_SEQ'}, ) print(json.dumps(response.json(), indent=2)) ``` ```php use Illuminate\Support\Facades\Http; $response = Http::withToken('YOUR_KEY')->get('https://odds-feed.on-forge.com/api/v2/refs/export', ['limit' => 2, 'cursor' => 'YOUR_SEQ']); echo json_encode($response->json(), JSON_PRETTY_PRINT); ``` ```json { "data": [ { "seq": 3, "match": "…", "source": "bet365", "type": "fixture", "id": "…" }, "…" ], "meta": { "count": 2, "next": 4, "next_cursor": "4" } } ``` ## Reference | Endpoint | Parameters | Notes | | --- | --- | --- | | `GET /refs` | `source`, `type`, `id`, all required | `source` is `bet365`. `type` is `fixture`, `team` or `player` depending on what you hold. | | `GET /refs/export` | `source`, `type`, `include=historical`, `cursor` (or `after`), `limit` | `limit` is 1 to 5000, default 1000. `include=historical` adds refs that have been retired. | Ref types you will see on a match: `fixture` for the match itself, `team` and `player` inside tables and player lists. Both endpoints need `fixtures:read`. Refs from partner sources show only to keys with the `refs:partner` ability. # The market list Use this page to find which markets exist and what each one looks like. The list is the same for every match, and its keys are what the other odds endpoints take. ## 1. List the markets `/markets` is the catalogue of market keys. Each entry has a `key`, a `description` and the `shape` of the value under that key. ```bash curl "https://odds-feed.on-forge.com/api/v2/markets" \ -H "Authorization: Bearer YOUR_KEY" ``` ```js const response = await fetch('https://odds-feed.on-forge.com/api/v2/markets', { headers: { Authorization: 'Bearer YOUR_KEY' }, }); console.log(JSON.stringify(await response.json(), null, 2)); ``` ```python import json import requests response = requests.get( 'https://odds-feed.on-forge.com/api/v2/markets', headers={'Authorization': 'Bearer YOUR_KEY'}, ) print(json.dumps(response.json(), indent=2)) ``` ```php use Illuminate\Support\Facades\Http; $response = Http::withToken('YOUR_KEY')->get('https://odds-feed.on-forge.com/api/v2/markets'); echo json_encode($response->json(), JSON_PRETTY_PRINT); ``` ```json { "data": [ { "key": "corners.race", "description": "Which side reaches the target number of corners first (home, neither, away), one row per target.", "shape": "list of {target, home, neither, away}" }, "…" ], "meta": { "generated_at": "2026-11-27T10:41:00.000Z" }, "links": { "self": "/api/v2/markets" } } ``` ## 2. Pick a key Use a `key` from the list as `markets` on [Reading prices](reading-prices.md) and [Choosing markets](choosing-markets.md), as `market` on [Filtering games](filtering-games.md), and as `market` on [Price history](price-history.md). The [market keys](market-keys.md) page shows which plan each key needs. ## Reference Fields of a market in `/markets`. | Field | Notes | | --- | --- | | `key` | The key to use in `markets` and `market`. Keys look like `match.result` or `corners.1h.match`. | | `description` | What the market prices. | | `shape` | The shape of the value under the key in an odds response. | `GET /markets` needs `markets:read`. # Reading prices Use this page to read the odds of one match and to read a single price. Prices come from bet365 and are never rounded. ## 1. Read a match's odds Request `/matches/{id}/odds`. In play the response also carries the score, clock, team colours, scoreboard and incidents. Before kick-off those keys are `null`. ```bash curl "https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70/odds" \ -H "Authorization: Bearer YOUR_KEY" ``` ```js const response = await fetch('https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70/odds', { headers: { Authorization: 'Bearer YOUR_KEY' }, }); console.log(JSON.stringify(await response.json(), null, 2)); ``` ```python import json import requests response = requests.get( 'https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70/odds', headers={'Authorization': 'Bearer YOUR_KEY'}, ) print(json.dumps(response.json(), indent=2)) ``` ```php use Illuminate\Support\Facades\Http; $response = Http::withToken('YOUR_KEY')->get('https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70/odds'); echo json_encode($response->json(), JSON_PRETTY_PRINT); ``` ```json { "data": { "phase": "in_play", "state": { "score": { "home": 0, "away": 0 }, "minute": 0, "period": null, "clock_running": false }, "teams": { "home": { "name": "Brentford", "…": "…" }, "away": { "name": "Everton", "…": "…" } }, "scoreboard": { "goals": { "home": 0, "away": 0 }, "…": "…" }, "incidents": [], "markets": { "match.result": { "home": { "decimal": 2.1, "fractional": "11/10" }, "draw": { "decimal": 3.5, "fractional": "5/2" }, "away": { "decimal": 3.4, "fractional": "12/5" } }, "…": "…" }, "market_change_times": { "…": "…" } }, "meta": { "generated_at": "2026-11-27T10:41:00.000Z", "match": "0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70", "topic": "odds", "revision": 1795776019589, "changed_at": "2026-11-27T10:40:19.589Z", "sources": [{ "name": "bet365", "captured_at": "2026-11-27T10:41:00.000Z" }], "availability": { "status": "available" } }, "links": { "self": "/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70/odds" } } ``` ## 2. Read a price Every price is an object with `decimal` and `fractional`. Use `decimal` for maths. Both are exactly as the bookmaker published them, with no rounding or margin applied. A selection that is suspended or not offered is `null`, so test for `null` before reading `decimal`. In the list markets, such as `goals.asian`, each row is a line with its own prices. ```bash curl "https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70/odds?markets=goals.asian&fields=markets" \ -H "Authorization: Bearer YOUR_KEY" ``` ```js const params = new URLSearchParams({ markets: 'goals.asian', fields: 'markets' }); const response = await fetch(`https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70/odds?${params}`, { headers: { Authorization: 'Bearer YOUR_KEY' }, }); console.log(JSON.stringify(await response.json(), null, 2)); ``` ```python import json import requests response = requests.get( 'https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70/odds', headers={'Authorization': 'Bearer YOUR_KEY'}, params={'markets': 'goals.asian', 'fields': 'markets'}, ) print(json.dumps(response.json(), indent=2)) ``` ```php use Illuminate\Support\Facades\Http; $response = Http::withToken('YOUR_KEY')->get('https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70/odds', ['markets' => 'goals.asian', 'fields' => 'markets']); echo json_encode($response->json(), JSON_PRETTY_PRINT); ``` ```json { "data": { "markets": { "goals.asian": [ { "line": 2, "over": { "decimal": 1.42, "fractional": "17/40" }, "exactly": null, "under": { "decimal": 2.75, "fractional": "7/4" } }, "…" ] } }, "…": "…" } ``` ## 3. Check how fresh the odds are `meta.revision` rises when the odds change, `meta.changed_at` is when they last changed, and `meta.sources[].captured_at` is when we last read them. A match we hold no prices for answers `200` with `data` set to `null` and `meta.availability` set to `unavailable` with the reason `not_held`. ## Reference Price object. | Field | Type | Notes | | --- | --- | --- | | `decimal` | number | European odds. | | `fractional` | string or null | Fractional odds. `null` for prices recorded before we kept it, such as old history. | The price itself is `null` when the selection is suspended or not offered. In `groups` and `player_markets` the selection has a `suspended` flag as well. `GET /matches/{id}/odds` needs `markets:read`. Your plan decides which markets it shows. See [Plans and access](plans.md). # Choosing markets Use this page to ask for only the markets you need, and to read every bet365 group and every player market. Smaller requests are faster and stay inside your plan. ## 1. Select markets Pass `markets` as a comma separated list of keys to get only those. This keeps the response small. `fields` does the same for the top-level keys of `data`, and an unknown key returns `400` with the list of valid ones. ```bash curl "https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70/odds?markets=match.result,corners.race&fields=markets" \ -H "Authorization: Bearer YOUR_KEY" ``` ```js const params = new URLSearchParams({ markets: 'match.result,corners.race', fields: 'markets' }); const response = await fetch(`https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70/odds?${params}`, { headers: { Authorization: 'Bearer YOUR_KEY' }, }); console.log(JSON.stringify(await response.json(), null, 2)); ``` ```python import json import requests response = requests.get( 'https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70/odds', headers={'Authorization': 'Bearer YOUR_KEY'}, params={'markets': 'match.result,corners.race', 'fields': 'markets'}, ) print(json.dumps(response.json(), indent=2)) ``` ```php use Illuminate\Support\Facades\Http; $response = Http::withToken('YOUR_KEY')->get('https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70/odds', ['markets' => 'match.result,corners.race', 'fields' => 'markets']); echo json_encode($response->json(), JSON_PRETTY_PRINT); ``` ```json { "data": { "markets": { "match.result": { "home": { "decimal": 2.1, "fractional": "11/10" }, "draw": { "decimal": 3.5, "fractional": "5/2" }, "away": { "decimal": 3.4, "fractional": "12/5" } }, "corners.race": [ { "target": 3, "home": { "decimal": 1.53, "fractional": "8/15" }, "neither": { "decimal": 41, "fractional": "40/1" }, "away": { "decimal": 2.37, "fractional": "11/8" } }, "…" ] } }, "meta": { "…": "…", "availability": { "status": "available" } }, "links": { "…": "…" } } ``` ## 2. Read every group and player market `include=groups` adds `groups`, every bet365 market group with its selections and a `suspended` flag. `include=players` adds `player_markets`. `type` and `player` narrow the player markets to one type or one player, by name or by id. Both include options read the pre-match page before kick-off. Player markets need the Player props plan. ```bash curl "https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e71/odds?include=players&type=shots_on_target&fields=player_markets" \ -H "Authorization: Bearer YOUR_KEY" ``` ```js const params = new URLSearchParams({ include: 'players', type: 'shots_on_target', fields: 'player_markets' }); const response = await fetch(`https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e71/odds?${params}`, { headers: { Authorization: 'Bearer YOUR_KEY' }, }); console.log(JSON.stringify(await response.json(), null, 2)); ``` ```python import json import requests response = requests.get( 'https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e71/odds', headers={'Authorization': 'Bearer YOUR_KEY'}, params={'include': 'players', 'type': 'shots_on_target', 'fields': 'player_markets'}, ) print(json.dumps(response.json(), indent=2)) ``` ```php use Illuminate\Support\Facades\Http; $response = Http::withToken('YOUR_KEY')->get('https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e71/odds', ['include' => 'players', 'type' => 'shots_on_target', 'fields' => 'player_markets']); echo json_encode($response->json(), JSON_PRETTY_PRINT); ``` ```json { "data": { "player_markets": [ { "key": "g177704", "name": "Shots on Target", "type": "shots_on_target", "suspended": false, "players": [ { "name": "Nicolas Jackson", "team": "Aston Villa", "refs": [{ "source": "bet365", "type": "player", "id": "…" }], "selections": [ { "outcome": "…", "price": { "decimal": 1.5, "fractional": "1/2" }, "suspended": false, "…": "…" } ] }, "…" ], "other": [] } ] }, "…": "…" } ``` ## Reference Parameters on `GET /matches/{id}/odds`. | Parameter | Values | Notes | | --- | --- | --- | | `markets` | Comma separated market keys | Keys from `/markets`. | | `fields` | `phase`, `state`, `teams`, `scoreboard`, `incidents`, `markets`, `market_change_times`, `groups`, `player_markets` | Keeps only these keys of `data`. | | `include` | `groups`, `players` or both | Adds `groups` or `player_markets`. | | `type` | A player market type | With `include=players`. The types are on [Market keys](market-keys.md). | | `player` | Player name or bet365 player id | With `include=players`. | # Many games at once Use this page to read the odds of up to 50 matches in one request. It is the way to price a whole day without a request for each match. ## 1. Read many matches `/odds` takes up to 50 match ids in `matches` and returns each match's odds on its own, with the same `markets`, `fields`, `include`, `type` and `player` options as one match. A match we do not know comes back as unavailable with the reason `not_found`, and does not fail the rest. ```bash curl "https://odds-feed.on-forge.com/api/v2/odds?matches=0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70,0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e71,0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4eff&markets=match.result&fields=markets" \ -H "Authorization: Bearer YOUR_KEY" ``` ```js const params = new URLSearchParams({ matches: '0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70,0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e71,0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4eff', markets: 'match.result', fields: 'markets' }); const response = await fetch(`https://odds-feed.on-forge.com/api/v2/odds?${params}`, { headers: { Authorization: 'Bearer YOUR_KEY' }, }); console.log(JSON.stringify(await response.json(), null, 2)); ``` ```python import json import requests response = requests.get( 'https://odds-feed.on-forge.com/api/v2/odds', headers={'Authorization': 'Bearer YOUR_KEY'}, params={'matches': '0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70,0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e71,0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4eff', 'markets': 'match.result', 'fields': 'markets'}, ) print(json.dumps(response.json(), indent=2)) ``` ```php use Illuminate\Support\Facades\Http; $response = Http::withToken('YOUR_KEY')->get('https://odds-feed.on-forge.com/api/v2/odds', ['matches' => '0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70,0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e71,0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4eff', 'markets' => 'match.result', 'fields' => 'markets']); echo json_encode($response->json(), JSON_PRETTY_PRINT); ``` ```json { "data": [ { "match": "0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70", "data": { "markets": { "match.result": { "home": { "decimal": 2.1, "fractional": "11/10" }, "…": "…" } } }, "meta": { "revision": 1795776019589, "changed_at": "2026-11-27T10:40:19.589Z", "sources": [{ "name": "bet365", "captured_at": "2026-11-27T10:41:00.000Z" }], "availability": { "status": "available" } } }, { "match": "0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e71", "data": { "markets": { "match.result": { "home": { "decimal": 1.75, "fractional": "3/4" }, "…": "…" } } }, "meta": { "…": "…" } }, { "match": "0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4eff", "data": null, "meta": { "revision": null, "changed_at": null, "sources": [], "availability": { "status": "unavailable", "reason": "not_found" } } } ], "meta": { "generated_at": "2026-11-27T10:41:00.000Z", "count": 3 }, "links": { "self": "/api/v2/odds" } } ``` ## Reference Parameters on `GET /odds`. | Parameter | Values | Notes | | --- | --- | --- | | `matches` | 1 to 50 match ids, comma separated | Required. | | `markets`, `fields`, `include`, `type`, `player` | | As on [Choosing markets](choosing-markets.md). | `GET /odds` needs `markets:read`. # Half-time markets Use this page to read the markets for the first half and the second half. They have their own keys, so you ask for them by key like any other market. ## 1. Read half-time markets in play The half-time result and the first-half goal ladder are read with `markets`. ```bash curl "https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70/odds?markets=match.1h.result,goals.1h.match&fields=markets" \ -H "Authorization: Bearer YOUR_KEY" ``` ```js const params = new URLSearchParams({ markets: 'match.1h.result,goals.1h.match', fields: 'markets' }); const response = await fetch(`https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70/odds?${params}`, { headers: { Authorization: 'Bearer YOUR_KEY' }, }); console.log(JSON.stringify(await response.json(), null, 2)); ``` ```python import json import requests response = requests.get( 'https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70/odds', headers={'Authorization': 'Bearer YOUR_KEY'}, params={'markets': 'match.1h.result,goals.1h.match', 'fields': 'markets'}, ) print(json.dumps(response.json(), indent=2)) ``` ```php use Illuminate\Support\Facades\Http; $response = Http::withToken('YOUR_KEY')->get('https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70/odds', ['markets' => 'match.1h.result,goals.1h.match', 'fields' => 'markets']); echo json_encode($response->json(), JSON_PRETTY_PRINT); ``` ```json { "data": { "markets": { "match.1h.result": { "home": { "decimal": 2.62, "fractional": "13/8" }, "draw": { "decimal": 2.2, "fractional": "6/5" }, "away": { "decimal": 4, "fractional": "3/1" } }, "goals.1h.match": [ { "line": 0.5, "over": { "decimal": 1.36, "fractional": "4/11" }, "exactly": null, "under": { "decimal": 3, "fractional": "2/1" } }, "…" ] } }, "meta": { "match": "0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70", "topic": "odds", "…": "…" }, "links": { "…": "…" } } ``` ## 2. Read half-time markets before kick-off Goal ladders for both halves are held before kick-off for the matches we capture in depth. ```bash curl "https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e72/odds?markets=goals.1h.match,goals.2h.match&fields=markets" \ -H "Authorization: Bearer YOUR_KEY" ``` ```js const params = new URLSearchParams({ markets: 'goals.1h.match,goals.2h.match', fields: 'markets' }); const response = await fetch(`https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e72/odds?${params}`, { headers: { Authorization: 'Bearer YOUR_KEY' }, }); console.log(JSON.stringify(await response.json(), null, 2)); ``` ```python import json import requests response = requests.get( 'https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e72/odds', headers={'Authorization': 'Bearer YOUR_KEY'}, params={'markets': 'goals.1h.match,goals.2h.match', 'fields': 'markets'}, ) print(json.dumps(response.json(), indent=2)) ``` ```php use Illuminate\Support\Facades\Http; $response = Http::withToken('YOUR_KEY')->get('https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e72/odds', ['markets' => 'goals.1h.match,goals.2h.match', 'fields' => 'markets']); echo json_encode($response->json(), JSON_PRETTY_PRINT); ``` ```json { "data": { "markets": { "goals.1h.match": [ { "line": 0.5, "over": { "decimal": 1.28, "fractional": "2/7" }, "exactly": null, "under": { "decimal": 3.5, "fractional": "5/2" } }, "…" ], "goals.2h.match": [ { "line": 0.5, "over": { "decimal": 1.18, "fractional": "2/11" }, "exactly": null, "under": { "decimal": 4.5, "fractional": "7/2" } }, "…" ] } }, "meta": { "match": "0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e72", "topic": "odds", "…": "…" }, "links": { "…": "…" } } ``` A half-time market that is not held is left out of `markets`. ## Reference | Key | Prices | | --- | --- | | `match.1h.result` | The result at half time. | | `match.1h.asian_handicap` | The Asian handicap for the first half. | | `goals.1h.match`, `goals.2h.match` | Goals over and under in each half. | | `goals.1h.asian` | The Asian goal line for the first half. | | `corners.1h.match`, `corners.2h.match` | Corners over and under in each half. | | `corners.1h.asian` | The Asian corner line for the first half. | Main lines includes `match.1h.result`. The other half-time markets need Full depth. # Market keys Use this page to look up a market key and the plan that shows it. The tables are generated from the code, so they are always current. ## 1. Match and team markets Free and Main lines show the markets marked Main lines, and the rest need Full depth. | Key | Market | Paid plans that show it | | --- | --- | --- | | `corners.race` | Corners Race | Full depth and above | | `match.btts` | Both Teams to Score | Main lines and above | | `match.double_chance` | Double Chance | Main lines and above | | `match.result` | Fulltime Result | Main lines and above | | `match.1h.result` | Half Time Result | Main lines and above | | `goals.match` | Match Goals | Main lines and above | | `goals.asian` | Goal Line | Main lines and above | | `goals.1h.match` | 1st Half Goals | Full depth and above | | `goals.2h.match` | 2nd Half Goals | Full depth and above | | `goals.1h.asian` | 1st Half Goal Line | Full depth and above | | `match.asian_handicap` | Asian Handicap | Main lines and above | | `match.1h.asian_handicap` | 1st Half Asian Handicap | Full depth and above | | `match.handicap` | Handicap 2-Way | Full depth and above | | `corners.match` | Match Corners | Full depth and above | | `corners.asian` | Asian Corners | Full depth and above | | `corners.1h.match` | 1st Half Corners | Full depth and above | | `corners.2h.match` | 2nd Half Corners | Full depth and above | | `corners.1h.asian` | 1st Half Asian Corners | Full depth and above | | `corners.team` | Team Corners | Full depth and above | | `cards.match` | Number of Cards In Match | Full depth and above | | `cards.asian` | Asian Total Cards | Full depth and above | | `cards.team` | Team Cards | Full depth and above | | `shots.match` | Match Shots | Full depth and above | | `shots.team` | Team Shots | Full depth and above | | `sot.match` | Match Shots on Target | Full depth and above | | `sot.team` | Team Shots on Target | Full depth and above | | `offsides.match` | Match Offsides | Full depth and above | | `offsides.team` | Team Offsides | Full depth and above | | `tackles.match` | Match Tackles | Full depth and above | | `tackles.team` | Team Tackles | Full depth and above | | `corners.most` | Most Corners | Full depth and above | | `corners.handicap` | Corner Handicap | Full depth and above | | `corners.next` | Corners | Full depth and above | | `match.draw_no_bet` | Draw No Bet | Full depth and above | | `match.1h.btts` | Both Teams to Score in 1st Half | Full depth and above | | `match.2h.btts` | Both Teams to Score in 2nd Half | Full depth and above | | `match.ht_ft` | Half Time/Full Time | Full depth and above | | `match.correct_score` | Final Score | Full depth and above | | `goals.team` | {team} Goals | Full depth and above | | `cards.either_booked` | Either to be Booked | Full depth and above | | Player market type | Paid plans that show it | | --- | --- | | `goalscorer` | Player props and above | | `team_goalscorer` | Player props and above | | `multi_scorer` | Player props and above | | `score_or_assist` | Player props and above | | `last_goalscorer` | Player props and above | | `shots` | Player props and above | | `shots_on_target` | Player props and above | | `shots_on_target_outside_box` | Player props and above | | `headed_shots_on_target` | Player props and above | | `assists` | Player props and above | | `fouls_committed` | Player props and above | | `fouled` | Player props and above | | `tackles` | Player props and above | | `passes` | Player props and above | | `cards` | Player props and above | | `booked` | Player props and above | | `sent_off` | Player props and above | | `saves` | Player props and above | ## 2. Player markets The player market types in the second table are read with `include=players` and `type` on [Choosing markets](choosing-markets.md). They need Player props. # Score and tracker Use this page to read the live view of a match: the score, the clock, the ball and the incidents so far. The tracker is most useful for live matches. ## 1. Read the tracker `tracker` is the live view of the match: score and clock, the ball position, momentum, the scoreboard, counters for each side and the incidents so far. ```bash curl "https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70/tracker" \ -H "Authorization: Bearer YOUR_KEY" ``` ```js const response = await fetch('https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70/tracker', { headers: { Authorization: 'Bearer YOUR_KEY' }, }); console.log(JSON.stringify(await response.json(), null, 2)); ``` ```python import json import requests response = requests.get( 'https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70/tracker', headers={'Authorization': 'Bearer YOUR_KEY'}, ) print(json.dumps(response.json(), indent=2)) ``` ```php use Illuminate\Support\Facades\Http; $response = Http::withToken('YOUR_KEY')->get('https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70/tracker'); echo json_encode($response->json(), JSON_PRETTY_PRINT); ``` ```json { "data": { "state": { "score": { "home": 2, "away": 0 }, "minute": 26, "period": "first_half", "clock_running": true }, "ball": { "x": 0.9, "y": 0.61, "player": "J Branthwaite" }, "momentum": [1, -0.38, -0.13, "…"], "teams": { "home": { "name": "Brentford", "table_position": 10, "stats": { "shots_on_target": 4, "possession": 60, "xg": 0.84, "…": "…" } }, "away": { "name": "Everton", "table_position": 7, "stats": { "…": "…" } } }, "scoreboard": { "goals": { "home": 2, "away": 0 }, "corners": { "home": 3, "away": 2 }, "…": "…" }, "incidents": [ { "kind": "corner", "minute": 8, "side": "home", "player": null, "text": "8' - 1st Corner - Brentford" }, "…" ], "counters": { "sides": { "corners": { "home": 3, "away": 2 }, "…": "…" }, "match": { "corners": 5, "…": "…" } }, "players": [{ "refs": [{ "source": "bet365", "type": "player", "id": "765629" }], "stats": { "…": "…" } }, "…"] }, "meta": { "generated_at": "2026-11-27T10:41:00.000Z", "match": "0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70", "topic": "tracker", "revision": 12, "changed_at": null, "sources": [{ "name": "bet365", "captured_at": "2026-11-27T10:41:00.000Z" }], "availability": { "status": "available" } }, "links": { "self": "/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70/tracker" } } ``` `momentum` is a list of values from -1 to 1, where positive favours the home side. `x` and `y` place the ball on the pitch from 0 to 1. ## 2. Handle a tracker we do not hold If we hold nothing for a match, such as the tracker of a match that has ended, the answer is `200` with `data` set to `null`. ```bash curl "https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e73/tracker" \ -H "Authorization: Bearer YOUR_KEY" ``` ```js const response = await fetch('https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e73/tracker', { headers: { Authorization: 'Bearer YOUR_KEY' }, }); console.log(JSON.stringify(await response.json(), null, 2)); ``` ```python import json import requests response = requests.get( 'https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e73/tracker', headers={'Authorization': 'Bearer YOUR_KEY'}, ) print(json.dumps(response.json(), indent=2)) ``` ```php use Illuminate\Support\Facades\Http; $response = Http::withToken('YOUR_KEY')->get('https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e73/tracker'); echo json_encode($response->json(), JSON_PRETTY_PRINT); ``` ```json { "data": null, "meta": { "match": "0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e73", "topic": "tracker", "revision": null, "changed_at": null, "sources": [], "availability": { "status": "unavailable", "reason": "not_held" }, "…": "…" }, "links": { "…": "…" } } ``` ## Reference `GET /matches/{id}/tracker` needs `markets:read`, and the live tracker is part of Full depth and above. Tracker `incidents[].kind` includes `corner`, `shot_on_target`, `shot_off_target`, `goal`, `yellow_card`, `red_card` and others as bet365 reports them. Scoreboard counters: `goals`, `corners`, `yellow_cards`, `red_cards`, `throw_ins`, `free_kicks`, `goal_kicks`, `penalties` and `substitutions`, each as `{home, away}`. # Match stats Use this page to read the counters of a match, such as corners. Each counter says where it came from and when it was read. ## 1. Read the stats `stats` holds counters such as corners. Each side has a `value`, the `source` it came from, and `as_of`, the time it was read. When sources disagree the stat is listed in `disputed`. ```bash curl "https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70/stats" \ -H "Authorization: Bearer YOUR_KEY" ``` ```js const response = await fetch('https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70/stats', { headers: { Authorization: 'Bearer YOUR_KEY' }, }); console.log(JSON.stringify(await response.json(), null, 2)); ``` ```python import json import requests response = requests.get( 'https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70/stats', headers={'Authorization': 'Bearer YOUR_KEY'}, ) print(json.dumps(response.json(), indent=2)) ``` ```php use Illuminate\Support\Facades\Http; $response = Http::withToken('YOUR_KEY')->get('https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70/stats'); echo json_encode($response->json(), JSON_PRETTY_PRINT); ``` ```json { "data": { "stats": { "corners": { "home": { "value": 4, "source": "bet365", "as_of": "2026-11-27T10:39:20.000Z" }, "away": { "value": 2, "source": "bet365", "as_of": "2026-11-27T10:39:20.000Z" } } }, "disputed": [] }, "meta": { "topic": "stats", "availability": { "status": "available" }, "…": "…" }, "links": { "…": "…" } } ``` ## Reference `GET /matches/{id}/stats` needs `markets:read`. A match we hold nothing for answers `200` with `data` set to `null`. | Field | Notes | | --- | --- | | `stats.{name}.home`, `stats.{name}.away` | `value`, `source` and `as_of`. | | `disputed` | The names of stats whose sources disagree. | # Players Use this page to read the players of a match and their running stats. The same path returns the stored stats after the game. ## 1. Read the players `players` lists everyone on the team sheets with their running stats. `starter` marks the starting eleven and `slot` is the position on the sheet. After the game the same path returns the stored stats. ```bash curl "https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70/players" \ -H "Authorization: Bearer YOUR_KEY" ``` ```js const response = await fetch('https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70/players', { headers: { Authorization: 'Bearer YOUR_KEY' }, }); console.log(JSON.stringify(await response.json(), null, 2)); ``` ```python import json import requests response = requests.get( 'https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70/players', headers={'Authorization': 'Bearer YOUR_KEY'}, ) print(json.dumps(response.json(), indent=2)) ``` ```php use Illuminate\Support\Facades\Http; $response = Http::withToken('YOUR_KEY')->get('https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70/players'); echo json_encode($response->json(), JSON_PRETTY_PRINT); ``` ```json { "data": { "players": [ { "name": "Caoimhin Kelleher", "short_name": "C Kelleher", "side": "home", "team": "Brentford", "shirt": 1, "starter": true, "slot": 1, "stats": { "goals": 0, "yellow_cards": 0, "red_cards": 0 }, "refs": [{ "source": "bet365", "type": "player", "id": "805027" }] }, "…" ] }, "meta": { "topic": "players", "…": "…" }, "links": { "…": "…" } } ``` ## Reference `GET /matches/{id}/players` needs `markets:read`. Player prices are a separate thing: see [Choosing markets](choosing-markets.md). # Live tables Use this page to read the league table a match belongs to. The table updates as results come in. ## 1. Read the table `table` is the league table of the match's competition. ```bash curl "https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70/table" \ -H "Authorization: Bearer YOUR_KEY" ``` ```js const response = await fetch('https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70/table', { headers: { Authorization: 'Bearer YOUR_KEY' }, }); console.log(JSON.stringify(await response.json(), null, 2)); ``` ```python import json import requests response = requests.get( 'https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70/table', headers={'Authorization': 'Bearer YOUR_KEY'}, ) print(json.dumps(response.json(), indent=2)) ``` ```php use Illuminate\Support\Facades\Http; $response = Http::withToken('YOUR_KEY')->get('https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70/table'); echo json_encode($response->json(), JSON_PRETTY_PRINT); ``` ```json { "data": { "name": "Premier League", "rows": [ { "position": 1, "team": { "name": "Man City", "refs": [{ "source": "bet365", "type": "team", "id": "100011" }] }, "played": 12, "won": 9, "drawn": 1, "lost": 2, "goal_difference": 18, "points": 28, "zone": { "code": "1", "label": null } }, "…" ] }, "meta": { "topic": "table", "…": "…" }, "links": { "…": "…" } } ``` ## Reference `GET /matches/{id}/table` needs `fixtures:read`. It is also sent on `private-match.{id}.table` and `private-live.table`. See [Channels](channels.md). # The live snapshot Use this page to load the whole current state of a live topic, exactly as the WebSocket sends it. Load it first, then apply the messages that arrive. ## 1. Load a topic `GET /matches/{id}/live/{topic}` returns the whole current state of one topic of a live match. `topic` is `odds`, `stats`, `players`, `betbuilder` or `table`. Use it when you open a screen and again when a message says `refetch`. ```bash curl "https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70/live/odds" \ -H "Authorization: Bearer YOUR_KEY" ``` ```js const response = await fetch('https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70/live/odds', { headers: { Authorization: 'Bearer YOUR_KEY' }, }); console.log(JSON.stringify(await response.json(), null, 2)); ``` ```python import json import requests response = requests.get( 'https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70/live/odds', headers={'Authorization': 'Bearer YOUR_KEY'}, ) print(json.dumps(response.json(), indent=2)) ``` ```php use Illuminate\Support\Facades\Http; $response = Http::withToken('YOUR_KEY')->get('https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70/live/odds'); echo json_encode($response->json(), JSON_PRETTY_PRINT); ``` ```json { "data": { "source_id": "203186268", "phase": "in_play", "captured_at": "2026-11-27T14:02:27+00:00", "revision": 1795788117686, "changed_at": "2026-11-27T14:01:57.686Z", "state": { "name": "Brentford v Everton", "score": "0-0", "minute": 0, "period": "0" }, "teams": { "home": { "name": "Brentford", "…": "…" }, "away": { "name": "Everton", "…": "…" } }, "scoreboard": { "goals": [0, 0], "…": "…" }, "incidents": [], "markets": { "match.result": { "…": "…" }, "…": "…" }, "…": "…" }, "meta": { "match": "0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70", "topic": "odds", "sources": { "odds": { "source": "bet365", "captured_at": "2026-11-27T14:02:27.000Z", "age_ms": 493 } }, "availability": { "odds": { "status": "available" } } } } ``` ## 2. Handle a topic we do not hold When we hold nothing for the topic the answer is `404` with a `message` and `availability` saying `not_held`. ## Reference The route needs `stream:read`, `fixtures:read` and the ability of the topic. Unlike `/matches/{id}/odds`, it does not use the envelope: `meta.sources` and `meta.availability` are keyed by topic. See [Message types](message-types.md). # Connecting Use this page to open a WebSocket connection and authorise a private channel. The server speaks the Pusher protocol through Laravel Reverb, so any Pusher client works. ## 1. Check your key can connect Live updates need a key with the `stream:read` ability. Business includes it, and Main lines, Full depth and Player props get it with the WebSocket add-on. Every plan with the WebSocket can follow all live games, and `stream:firehose` is the ability for the channels that carry every live match at once. See [Plans and access](plans.md). Each account can hold a set number of connections at once: 1 on Main lines and Full depth, 2 on Player props and 5 on Business. Opening one more closes the account's oldest connection with the error code `4004`, so a client that reconnects after losing its network is never locked out by its own old connection. ## 2. Connect Create a `Pusher` client with your WebSocket host and app key, and point its channel authorisation at `https://odds-feed.on-forge.com/broadcasting/auth` with your API key as the bearer token. The WebSocket host and app key shown are the ones for this server, and the bearer token is your own key. ```js import Pusher from 'pusher-js'; const pusher = new Pusher('75f6d3a4cc8f73610c0c351d9199cf5a', { cluster: 'mt1', wsHost: '127.0.0.1', wsPort: 443, wssPort: 443, forceTLS: true, enabledTransports: ['ws', 'wss'], channelAuthorization: { endpoint: 'https://odds-feed.on-forge.com/broadcasting/auth', headers: { Authorization: 'Bearer YOUR_KEY' }, }, }); ``` ## 3. See how a channel is authorised Before a client joins a private channel it sends the channel name to the authorisation endpoint. A key that may read the channel gets an `auth` signature back, and any other key gets `403`. You do not make this request yourself, but you can see it. Then subscribe to a channel from [Channels](channels.md). ```bash curl -X POST "https://odds-feed.on-forge.com/broadcasting/auth" \ -H "Authorization: Bearer YOUR_KEY" \ -d "socket_id=1234.5678" \ -d "channel_name=private-match.0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70.odds" ``` ```js const response = await fetch('https://odds-feed.on-forge.com/broadcasting/auth', { method: 'POST', headers: { Authorization: 'Bearer YOUR_KEY' }, body: new URLSearchParams({ socket_id: '1234.5678', channel_name: 'private-match.0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70.odds' }), }); console.log(JSON.stringify(await response.json(), null, 2)); ``` ```python import json import requests response = requests.post( 'https://odds-feed.on-forge.com/broadcasting/auth', headers={'Authorization': 'Bearer YOUR_KEY'}, data={'socket_id': '1234.5678', 'channel_name': 'private-match.0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70.odds'}, ) print(json.dumps(response.json(), indent=2)) ``` ```php use Illuminate\Support\Facades\Http; $response = Http::withToken('YOUR_KEY')->asForm()->post('https://odds-feed.on-forge.com/broadcasting/auth', ['socket_id' => '1234.5678', 'channel_name' => 'private-match.0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70.odds']); echo json_encode($response->json(), JSON_PRETTY_PRINT); ``` ```json { "auth": "docs-key:3f1c0b9d5e0c4a7e2b8e9a1d6c4f5b7a8e9d0c1b2a3f4e5d6c7b8a9f0e1d2c3b" } ``` ## Reference | Setting | Value | | --- | --- | | Protocol | Pusher, over a secure WebSocket | | Authorisation endpoint | `https://odds-feed.on-forge.com/broadcasting/auth` | | Authorisation header | `Authorization: Bearer YOUR_KEY` | | Cluster | `mt1`, which the client needs but the server ignores | | Connections at once | 1 on Main lines and Full depth, 2 on Player props, 5 on Business | | Error `4004` | Closed because the account opened a newer connection over its limit | | Error `4009` | Closed because the plan no longer includes the WebSocket | # Channels Use this page to pick the channels to subscribe to. A channel name always starts with `private-`. ## 1. Follow one match `private-match.{id}.{topic}` carries one topic of one match, with the event `update`. Subscribe to `odds` for prices and to the other topics for what is happening in the game. ```js const matchId = '0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70'; const channel = pusher.subscribe(`private-match.${matchId}.odds`); channel.bind('update', (message) => { console.log(message.type, message.topic, message.revision); }); ``` ## 2. Follow every live match `private-live.{topic}` carries the same messages for every live match, so one subscription covers the whole board. It needs the `stream:firehose` ability, which every plan with the WebSocket includes. ```js const live = pusher.subscribe('private-live.odds'); live.bind('update', (message) => { console.log(message.match, message.type); }); ``` ## 3. Use your plan's odds channel The odds topic carries only your plan's markets, so Main lines and Full depth have odds channels of their own. Add your plan to the channel name: `private-match.{id}.odds.main-lines` or `private-match.{id}.odds.full-depth`, and `private-live.odds.main-lines` or `private-live.odds.full-depth` for every live match. Player props and Business use the names without a suffix. A key can join its own plan's channel or a smaller plan's, and asking for a bigger plan's channel answers `403` with the name of yours. ```js const matchId = '0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70'; const odds = pusher.subscribe(`private-match.${matchId}.odds.main-lines`); odds.bind('update', (message) => { console.log(message.type, message.data.markets); }); ``` The other topics are the same on every plan, so they have no suffix. ## 4. Follow matches being added or changing status `private-matches` announces catalogue changes. The event is `match`, `type` is `match.added`, `match.status`, `match.merged`, `match.unmerged` or `ref.attached`, and `data` holds the details. ```js const matches = pusher.subscribe('private-matches'); matches.bind('match', (message) => { console.log(message.type, message.match, message.data); }); ``` A status message looks like this. ```json { "id": "1795724584512-0", "type": "match.status", "match": "0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70", "data": { "status": "live" }, "changed_at": "2026-11-26T20:23:04.512Z" } ``` `private-fixtures` carries the same catalogue events in an older shape, with the event named `change` and `event` in place of `type`. Use `private-matches` in new code. ## Reference | Channel | Event | Topics | | --- | --- | --- | | `private-match.{id}.odds` | `update` | Prices. | | `private-match.{id}.stats` | `update` | Counters such as corners. | | `private-match.{id}.tracker` | `update` | Score, clock, ball and incidents. | | `private-match.{id}.players` | `update` | Players and their stats. | | `private-match.{id}.betbuilder` | `update` | In-play Bet Builder combinations. | | `private-match.{id}.table` | `update` | The league table. | | `private-live.odds`, `private-live.stats`, `private-live.table` | `update` | The same topics for every live match. | | `private-match.{id}.odds.main-lines`, `private-live.odds.main-lines` | `update` | Prices for Main lines. | | `private-match.{id}.odds.full-depth`, `private-live.odds.full-depth` | `update` | Prices for Full depth. | | `private-matches` | `match` | Matches added, changing status or merged. | | `private-fixtures` | `change` | The older form of `private-matches`. | Abilities for each channel. A key needs every ability listed for the channel. | Channel | Abilities | | --- | --- | | `private-match.{id}.odds`, `stats`, `tracker`, `players` | `stream:read` and `markets:read` | | `private-match.{id}.betbuilder` | `stream:read`, `markets:read` and Player props or Business | | `private-match.{id}.table` | `stream:read` and `fixtures:read` | | `private-live.odds`, `private-live.stats` | `stream:firehose` and `markets:read` | | `private-live.table` | `stream:firehose` and `fixtures:read` | | `private-matches`, `private-fixtures` | `stream:read` and `fixtures:read` | Odds updates carry the markets of the channel's plan, the same markets your plan reads over REST. # Message types Use this page to read a message and keep your own copy of a topic up to date. There are four types, and each says what to do with `data`. ## 1. Read a message Every message on a match or live channel has the same fields. `type` tells you what to do with `data`. | Field | Meaning | | --- | --- | | `id` | The message id. Keep the last one you handled. | | `type` | `snapshot`, `patch`, `removed` or `refetch`. | | `match` | The match id. | | `topic` | The topic the message is about. | | `revision` | A number that rises with each change to the topic, or `null`. | | `changed_at` | When the change happened, in UTC. | | `data` | The payload. `null` for `removed` and `refetch`. | | `sources` | Where the data was read and when. | | `availability` | Whether we hold the topic. | | `links.self` | Only on `refetch`. The path to request instead. | ## 2. Replace on a snapshot A `snapshot` is the whole topic. Replace what you hold. ```json { "id": "1795724584512-0", "type": "snapshot", "match": "0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70", "topic": "stats", "revision": null, "changed_at": "2026-11-26T20:23:04.512Z", "data": { "stats": { "corners": { "home": { "value": 4, "source": "bet365", "as_of": "2026-11-26T20:23:04.000Z" }, "away": { "value": 2, "source": "bet365", "as_of": "2026-11-26T20:23:04.000Z" } } }, "disputed": [] }, "sources": [ { "name": "bet365", "captured_at": "2026-11-26T20:23:04.000Z" } ], "availability": { "status": "available" } } ``` ## 3. Merge a patch A `patch` is only what changed. A key that is missing from `data` has not changed, and a key set to `null` was removed. In the example, the home price of one market has changed and `draw_no_bet` is gone. Merge objects key by key. Arrays and other values replace what you hold. ```json { "id": "1795724584512-0", "type": "patch", "match": "0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70", "topic": "odds", "revision": 41, "changed_at": "2026-11-26T20:23:04.512Z", "data": { "markets": { "match.result": { "home": { "decimal": 1.62, "fractional": "8/13" } }, "draw_no_bet": null } }, "sources": [ { "name": "bet365", "captured_at": "2026-11-26T20:23:04.000Z" } ], "availability": { "status": "available" } } ``` Player prices are too big to send in every patch. When a player market changes, an `odds` patch carries `player_market_change_times` instead: the key of each changed player market and when it changed. Fetch the odds with `include=players&fields=player_markets` to read the new prices. ```json { "type": "patch", "topic": "odds", "data": { "player_market_change_times": { "g177920": "2026-11-26T20:23:04.512Z" } } } ``` ## 4. Drop a removed topic A `removed` message means we no longer hold the topic. `data` is `null`, `sources` is empty and `availability` is `unavailable` with the reason `not_held`. Drop what you hold. ```json { "id": "1795724584512-0", "type": "removed", "match": "0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70", "topic": "tracker", "revision": 12, "changed_at": "2026-11-26T20:23:04.512Z", "data": null, "sources": [], "availability": { "status": "unavailable", "reason": "not_held" } } ``` ## 5. Fetch again on a refetch A `refetch` means the message was too large to send, or could not be built. `data` is `null`. Request `links.self` to get the whole topic, or load it with [the live snapshot](live-snapshot.md). ```json { "id": "1795724584512-0", "type": "refetch", "match": "0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70", "topic": "stats", "revision": null, "changed_at": "2026-11-26T20:23:04.512Z", "data": null, "sources": [ { "name": "bet365", "captured_at": "2026-11-26T20:23:04.000Z" } ], "availability": { "status": "available" }, "links": { "self": "/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70/stats" } } ``` ## 6. Apply messages Keep one state per match and topic. Skip a message whose `revision` is lower than the one you hold, since it arrived late. ```js const state = {}; const revisions = {}; function merge(target, patch) { for (const [key, value] of Object.entries(patch)) { const isObject = (item) => item !== null && typeof item === 'object' && !Array.isArray(item); if (value === null) { delete target[key]; } else if (isObject(value) && isObject(target[key])) { merge(target[key], value); } else { target[key] = value; } } } async function handle(message) { const key = `${message.match}.${message.topic}`; if (message.revision !== null && message.revision < (revisions[key] ?? 0)) { return; } if (message.type === 'snapshot') { state[key] = message.data; } else if (message.type === 'patch') { merge((state[key] ??= {}), message.data); } else if (message.type === 'removed') { delete state[key]; } else if (message.type === 'refetch') { const response = await fetch(`https://odds-feed.on-forge.com${message.links.self}`, { headers: { Authorization: 'Bearer YOUR_KEY' }, }); state[key] = (await response.json()).data; } revisions[key] = message.revision ?? revisions[key]; } ``` ## Reference | Limit | Value | | --- | --- | | Message size | A message over 32 KB is sent as `refetch`. | # Catching up with changes Use this page to recover what you missed while you were disconnected. `/changes` lists what changed, without the data, so you refetch only the topics that moved. ## 1. Resume after a disconnect Keep the `id` of the last message you handled. After you reconnect, ask `/changes` for everything sent after it. Each row says which topic of which match changed, without the data, so refetch those topics with `/matches/{id}/{topic}`. ```bash curl "https://odds-feed.on-forge.com/api/v2/changes?cursor=0" \ -H "Authorization: Bearer YOUR_KEY" ``` ```js const params = new URLSearchParams({ cursor: '0' }); const response = await fetch(`https://odds-feed.on-forge.com/api/v2/changes?${params}`, { headers: { Authorization: 'Bearer YOUR_KEY' }, }); console.log(JSON.stringify(await response.json(), null, 2)); ``` ```python import json import requests response = requests.get( 'https://odds-feed.on-forge.com/api/v2/changes', headers={'Authorization': 'Bearer YOUR_KEY'}, params={'cursor': 0}, ) print(json.dumps(response.json(), indent=2)) ``` ```php use Illuminate\Support\Facades\Http; $response = Http::withToken('YOUR_KEY')->get('https://odds-feed.on-forge.com/api/v2/changes', ['cursor' => 0]); echo json_encode($response->json(), JSON_PRETTY_PRINT); ``` ```json { "data": [ { "id": "1795775960589-0", "type": "patch", "match": "0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70", "topic": "odds", "revision": 40, "changed_at": "2026-11-27T10:39:20.589Z" }, "…" ], "meta": { "generated_at": "2026-11-27T10:41:00.000Z", "cursor": "1795776010589-0", "gap": false, "next_cursor": null, "has_more": false }, "links": { "next": null, "self": "/api/v2/changes?cursor=0-0" } } ``` `meta.cursor` is where to resume next time. When `meta.gap` is `true` your cursor is older than the changes we keep, so refetch every topic you follow. Use `cursor=0` to start from the oldest change we keep. ## 2. Filter by topic and page on `topic` keeps some topics only, as a comma separated list of `odds`, `stats`, `tracker`, `players`, `betbuilder`, `table` and `match`. `limit` is 1 to 2000 and defaults to 500. While `meta.has_more` is true, send `meta.next_cursor` as `cursor`. ```bash curl "https://odds-feed.on-forge.com/api/v2/changes?cursor=0&topic=odds&limit=1" \ -H "Authorization: Bearer YOUR_KEY" ``` ```js const params = new URLSearchParams({ cursor: '0', topic: 'odds', limit: '1' }); const response = await fetch(`https://odds-feed.on-forge.com/api/v2/changes?${params}`, { headers: { Authorization: 'Bearer YOUR_KEY' }, }); console.log(JSON.stringify(await response.json(), null, 2)); ``` ```python import json import requests response = requests.get( 'https://odds-feed.on-forge.com/api/v2/changes', headers={'Authorization': 'Bearer YOUR_KEY'}, params={'cursor': 0, 'topic': 'odds', 'limit': 1}, ) print(json.dumps(response.json(), indent=2)) ``` ```php use Illuminate\Support\Facades\Http; $response = Http::withToken('YOUR_KEY')->get('https://odds-feed.on-forge.com/api/v2/changes', ['cursor' => 0, 'topic' => 'odds', 'limit' => 1]); echo json_encode($response->json(), JSON_PRETTY_PRINT); ``` ```json { "data": [ { "id": "1795775960589-0", "type": "patch", "match": "0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70", "topic": "odds", "revision": 40, "changed_at": "2026-11-27T10:39:20.589Z" } ], "meta": { "cursor": "1795775960589-0", "gap": false, "next_cursor": "1795775960589-0", "has_more": true, "…": "…" }, "links": { "next": "/api/v2/changes?topic=odds&cursor=1795775960589-0", "self": "/api/v2/changes?topic=odds&cursor=0-0" } } ``` ## 3. Start from now Send `cursor` with no value to start from the latest change. The list is empty and `meta.cursor` is the id to resume from. ```bash curl "https://odds-feed.on-forge.com/api/v2/changes?cursor=" \ -H "Authorization: Bearer YOUR_KEY" ``` ```js const params = new URLSearchParams({ cursor: '' }); const response = await fetch(`https://odds-feed.on-forge.com/api/v2/changes?${params}`, { headers: { Authorization: 'Bearer YOUR_KEY' }, }); console.log(JSON.stringify(await response.json(), null, 2)); ``` ```python import json import requests response = requests.get( 'https://odds-feed.on-forge.com/api/v2/changes', headers={'Authorization': 'Bearer YOUR_KEY'}, params={'cursor': ''}, ) print(json.dumps(response.json(), indent=2)) ``` ```php use Illuminate\Support\Facades\Http; $response = Http::withToken('YOUR_KEY')->get('https://odds-feed.on-forge.com/api/v2/changes', ['cursor' => '']); echo json_encode($response->json(), JSON_PRETTY_PRINT); ``` ```json { "data": [], "meta": { "cursor": "1795776010589-0", "gap": false, "next_cursor": null, "has_more": false, "…": "…" }, "links": { "…": "…" } } ``` ## Reference Parameters on `GET /changes`. | Parameter | Notes | | --- | --- | | `cursor` | A message id, or `0` for the oldest change kept. Empty starts from now. | | `topic` | Comma separated topics. | | `limit` | 1 to 2000. Default 500. | | Limit | Value | | --- | --- | | Changes kept for resume | 6 hours. | `GET /changes` needs `fixtures:read`. # Bet Builder before the game Use this page to check whether a match has a Bet Builder and to read it before kick-off. The Bet Builder is a topic of the match, so it has the same envelope as odds. ## 1. Check whether a match has one The match list carries `bet_builder` on each match. `available` means a capture is held, `partial` means only part is, and `unavailable` comes with a `reason`. ```bash curl "https://odds-feed.on-forge.com/api/v2/matches?status=scheduled&limit=1" \ -H "Authorization: Bearer YOUR_KEY" ``` ```js const params = new URLSearchParams({ status: 'scheduled', limit: '1' }); const response = await fetch(`https://odds-feed.on-forge.com/api/v2/matches?${params}`, { headers: { Authorization: 'Bearer YOUR_KEY' }, }); console.log(JSON.stringify(await response.json(), null, 2)); ``` ```python import json import requests response = requests.get( 'https://odds-feed.on-forge.com/api/v2/matches', headers={'Authorization': 'Bearer YOUR_KEY'}, params={'status': 'scheduled', 'limit': 1}, ) print(json.dumps(response.json(), indent=2)) ``` ```php use Illuminate\Support\Facades\Http; $response = Http::withToken('YOUR_KEY')->get('https://odds-feed.on-forge.com/api/v2/matches', ['status' => 'scheduled', 'limit' => 1]); echo json_encode($response->json(), JSON_PRETTY_PRINT); ``` ```json { "data": [ { "id": "0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e71", "bet_builder": { "status": "available" }, "…": "…" } ], "…": "…" } ``` ## 2. Read the pre-match Bet Builder Before kick-off `phase` is `prematch` and `sections` lists the Bet Builder sections. Player sections hold a list of players with their last five results and the prices of each option. Other sections hold rows of selections. ```bash curl "https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e71/betbuilder" \ -H "Authorization: Bearer YOUR_KEY" ``` ```js const response = await fetch('https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e71/betbuilder', { headers: { Authorization: 'Bearer YOUR_KEY' }, }); console.log(JSON.stringify(await response.json(), null, 2)); ``` ```python import json import requests response = requests.get( 'https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e71/betbuilder', headers={'Authorization': 'Bearer YOUR_KEY'}, ) print(json.dumps(response.json(), indent=2)) ``` ```php use Illuminate\Support\Facades\Http; $response = Http::withToken('YOUR_KEY')->get('https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e71/betbuilder'); echo json_encode($response->json(), JSON_PRETTY_PRINT); ``` ```json { "data": { "phase": "prematch", "sections": [ { "name": "Score or Assist", "players": [ { "name": "Nicolas Jackson", "team": "Aston Villa", "last_five": [1, 1, 2, 0, 1], "thresholds": [], "periods": [], "options": { "Score": { "decimal": 2.1, "fractional": null }, "Assist": { "decimal": 5.5, "fractional": null }, "Score or Assist": { "decimal": 1.72, "fractional": null } } }, "…" ], "…": "…" }, "…" ] }, "meta": { "match": "0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e71", "topic": "betbuilder", "sources": [{ "name": "bet365", "captured_at": "2026-11-27T10:41:00.000Z" }], "availability": { "status": "available" }, "…": "…" }, "links": { "…": "…" } } ``` ## Reference The status words, and where each one appears. | Where | Word | Meaning | | --- | --- | --- | | `bet_builder.status` on a match | `available` | A capture is held. | | | `partial` | Only part of it is held. The `reason` is `basic_only`. | | | `unavailable` | The `reason` is `not_upcoming` (the match has started or ended), `not_offered` or `not_captured`. | | `meta.availability.status` on the topic | `available`, `partial`, `unavailable` | The same three words, with the same reasons. | | `data.status` after a capture request | `captured` | A capture is held. HTTP `200`. | | | `queued` | The request is queued, with the reason `capture_queued`. HTTP `202`. | | | `unavailable` | bet365 offers no Bet Builder for the match, with the reason `not_offered`. HTTP `200`. | | | `unknown` | The match is not one we list as upcoming, with the reason `not_listed`. HTTP `200`. | The Bet Builder needs Full depth, and Main lines answers `403`. Player sections need Player props and are left out for lower plans. `GET /matches/{id}/betbuilder` needs `markets:read`. # Bet Builder in play Use this page to read the Bet Builder once a match is live. The path is the same, and the response changes from sections to combinations. ## 1. Read the in-play Bet Builder Once the match is live the same path returns `phase` set to `inplay` and `combos`, each a ranked combination of legs with its price. `price_current` is false when the combination price was not refreshed with the legs. ```bash curl "https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70/betbuilder" \ -H "Authorization: Bearer YOUR_KEY" ``` ```js const response = await fetch('https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70/betbuilder', { headers: { Authorization: 'Bearer YOUR_KEY' }, }); console.log(JSON.stringify(await response.json(), null, 2)); ``` ```python import json import requests response = requests.get( 'https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70/betbuilder', headers={'Authorization': 'Bearer YOUR_KEY'}, ) print(json.dumps(response.json(), indent=2)) ``` ```php use Illuminate\Support\Facades\Http; $response = Http::withToken('YOUR_KEY')->get('https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70/betbuilder'); echo json_encode($response->json(), JSON_PRETTY_PRINT); ``` ```json { "data": { "phase": "inplay", "combos": [ { "id": "1770450513", "rank": 1, "price": { "decimal": 4.6, "fractional": "18/5" }, "price_current": false, "legs": [ { "id": "537634486", "market": "Team 1 Shots on Target", "name": "Over 4.5 Shots on Target for Brentford", "line": 4.5, "price": { "decimal": 1.83, "fractional": null }, "suspended": false }, "…" ] }, "…" ] }, "meta": { "topic": "betbuilder", "…": "…" }, "links": { "…": "…" } } ``` ## 2. Follow it live The `betbuilder` topic is also sent on `private-match.{id}.betbuilder`. See [Channels](channels.md). ## Reference In-play combinations need Player props. `GET /matches/{id}/betbuilder` needs `markets:read`. For the status words see [Bet Builder before the game](bet-builder-pre-match.md). # Asking for a capture Use this page to ask for a pre-match Bet Builder to be captured sooner than the schedule. Capture is a `POST`, and it is limited to 20 requests a minute per key. ## 1. Ask for a capture Pre-match Bet Builders are captured on a schedule. To ask for a match sooner, send a `POST` to `/matches/{id}/betbuilder/capture`. The collector usually takes the request within a minute. Then read the topic again. ```bash curl -X POST "https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e72/betbuilder/capture" \ -H "Authorization: Bearer YOUR_KEY" ``` ```js const response = await fetch('https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e72/betbuilder/capture', { method: 'POST', headers: { Authorization: 'Bearer YOUR_KEY' }, }); console.log(JSON.stringify(await response.json(), null, 2)); ``` ```python import json import requests response = requests.post( 'https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e72/betbuilder/capture', headers={'Authorization': 'Bearer YOUR_KEY'}, ) print(json.dumps(response.json(), indent=2)) ``` ```php use Illuminate\Support\Facades\Http; $response = Http::withToken('YOUR_KEY')->post('https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e72/betbuilder/capture'); echo json_encode($response->json(), JSON_PRETTY_PRINT); ``` ```json { "data": { "status": "queued" }, "meta": { "generated_at": "2026-11-27T10:41:00.000Z", "match": "0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e72", "topic": "betbuilder", "availability": { "status": "unavailable", "reason": "capture_queued" } }, "links": { "self": "/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e72/betbuilder" } } ``` ## 2. Read the answer A queued request answers `202`. A match that already has a capture answers `200` with the status `captured`. ```bash curl -X POST "https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e71/betbuilder/capture" \ -H "Authorization: Bearer YOUR_KEY" ``` ```js const response = await fetch('https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e71/betbuilder/capture', { method: 'POST', headers: { Authorization: 'Bearer YOUR_KEY' }, }); console.log(JSON.stringify(await response.json(), null, 2)); ``` ```python import json import requests response = requests.post( 'https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e71/betbuilder/capture', headers={'Authorization': 'Bearer YOUR_KEY'}, ) print(json.dumps(response.json(), indent=2)) ``` ```php use Illuminate\Support\Facades\Http; $response = Http::withToken('YOUR_KEY')->post('https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e71/betbuilder/capture'); echo json_encode($response->json(), JSON_PRETTY_PRINT); ``` ```json { "data": { "status": "captured" }, "meta": { "match": "0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e71", "topic": "betbuilder", "availability": { "status": "available" }, "…": "…" }, "links": { "…": "…" } } ``` ## Reference The capture endpoint needs the `markets:read` ability and the Full depth plan, and is limited to 20 requests a minute per key. See [Rate limits](rate-limits.md). The status words are on [Bet Builder before the game](bet-builder-pre-match.md). # Opening and closing lines Use this page to read the first, latest and closing price of each pre-match selection. It needs the `history:read` ability, which Business has. ## 1. Read the lines `/matches/{id}/odds/lines` returns one row for each pre-match selection with the first price bet365 offered, the latest price and, once the match has kicked off, the closing price. `moved` is the latest decimal price minus the opening one. ```bash curl "https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e71/odds/lines" \ -H "Authorization: Bearer YOUR_KEY" ``` ```js const response = await fetch('https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e71/odds/lines', { headers: { Authorization: 'Bearer YOUR_KEY' }, }); console.log(JSON.stringify(await response.json(), null, 2)); ``` ```python import json import requests response = requests.get( 'https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e71/odds/lines', headers={'Authorization': 'Bearer YOUR_KEY'}, ) print(json.dumps(response.json(), indent=2)) ``` ```php use Illuminate\Support\Facades\Http; $response = Http::withToken('YOUR_KEY')->get('https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e71/odds/lines'); echo json_encode($response->json(), JSON_PRETTY_PRINT); ``` ```json { "data": [ { "group": { "key": "goal_line", "name": "Goal Line" }, "selection": { "name": "Over", "column": null, "line": 2.25, "team": null, "player": null }, "opening": { "price": { "decimal": 1.9, "fractional": "9/10" }, "at": "2026-11-26T10:40:20.000Z" }, "latest": { "price": { "decimal": 1.8, "fractional": "4/5" }, "at": "2026-11-27T10:30:20.000Z" }, "closing": null, "moved": -0.1 }, "…" ], "meta": { "match": "0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e71", "topic": "odds", "kickoff_at": "2026-11-28T10:40:20.000Z", "lines_status": "open", "availability": { "status": "available" }, "next_cursor": null, "has_more": false, "…": "…" }, "links": { "…": "…" } } ``` `meta.lines_status` is `open` before kick-off and `closed` after, when `closing` is filled in. ## 2. Filter the lines `group` keeps one market group by its key, `player` keeps one player's selections by bet365 player id, and `closed=1` keeps only selections that have a closing price. ```bash curl "https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e71/odds/lines?group=goal_line&closed=1" \ -H "Authorization: Bearer YOUR_KEY" ``` ```js const params = new URLSearchParams({ group: 'goal_line', closed: '1' }); const response = await fetch(`https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e71/odds/lines?${params}`, { headers: { Authorization: 'Bearer YOUR_KEY' }, }); console.log(JSON.stringify(await response.json(), null, 2)); ``` ```python import json import requests response = requests.get( 'https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e71/odds/lines', headers={'Authorization': 'Bearer YOUR_KEY'}, params={'group': 'goal_line', 'closed': 1}, ) print(json.dumps(response.json(), indent=2)) ``` ```php use Illuminate\Support\Facades\Http; $response = Http::withToken('YOUR_KEY')->get('https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e71/odds/lines', ['group' => 'goal_line', 'closed' => 1]); echo json_encode($response->json(), JSON_PRETTY_PRINT); ``` ```json { "data": [], "meta": { "availability": { "status": "unavailable", "reason": "not_held" }, "…": "…" }, "links": { "…": "…" } } ``` Nothing has closed yet because the match has not kicked off, so the list is empty. ## Reference Parameters on `GET /matches/{id}/odds/lines`. | Parameter | Values | Notes | | --- | --- | --- | | `group` | Group key | For example `goal_line`. | | `player` | bet365 player id | Digits only. | | `closed` | `1`, `0`, `true`, `false` | `1` keeps closed selections. | | `limit` | 1 to 5000 | Default 1000. | | `cursor` | Value of `meta.next_cursor` | See [Paging with cursors](paging-with-cursors.md). | Fields of a line. | Field | Notes | | --- | --- | | `group` | `key` and `name` of the market group. | | `selection` | `name`, `column`, `line`, `team` and `player`. | | `opening`, `latest`, `closing` | `price` and `at`. `closing` is `null` until the match has kicked off. | | `moved` | Latest decimal price minus the opening one. | Lines start from when we began recording a match. A match with nothing recorded answers `200` with an empty `data` and the reason `not_held`. # Price history Use this page to read every price change of one market, oldest first. It needs the `history:read` ability, which Business has. ## 1. Read the history of a market `/matches/{id}/odds/history` returns every price change recorded for one market, oldest first. `market` is required and is a key from [the market list](market-list.md). `from` and `to` narrow the window. ```bash curl "https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e71/odds/history?market=goals.asian" \ -H "Authorization: Bearer YOUR_KEY" ``` ```js const params = new URLSearchParams({ market: 'goals.asian' }); const response = await fetch(`https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e71/odds/history?${params}`, { headers: { Authorization: 'Bearer YOUR_KEY' }, }); console.log(JSON.stringify(await response.json(), null, 2)); ``` ```python import json import requests response = requests.get( 'https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e71/odds/history', headers={'Authorization': 'Bearer YOUR_KEY'}, params={'market': 'goals.asian'}, ) print(json.dumps(response.json(), indent=2)) ``` ```php use Illuminate\Support\Facades\Http; $response = Http::withToken('YOUR_KEY')->get('https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e71/odds/history', ['market' => 'goals.asian']); echo json_encode($response->json(), JSON_PRETTY_PRINT); ``` ```json { "data": [ { "at": "2026-11-27T07:40:20.000Z", "phase": "pre_match", "prices": [ { "line": 2.25, "over": { "decimal": 1.9, "fractional": null }, "under": { "decimal": 1.95, "fractional": null } } ] }, "…" ], "meta": { "generated_at": "2026-11-27T10:41:00.000Z", "match": "0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e71", "topic": "odds", "market": "goals.asian", "availability": { "status": "available" }, "next_cursor": null, "has_more": false }, "links": { "next": null, "self": "/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e71/odds/history?market=goals.asian" } } ``` `prices` has the same form as the market has in `/odds`. `fractional` is `null` on history, so work from `decimal`. ## 2. Read the first page A page holds up to `limit` ticks (default 2000, maximum 2000). While `meta.has_more` is true, there is more to read. ```bash curl "https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e71/odds/history?market=goals.asian&limit=2" \ -H "Authorization: Bearer YOUR_KEY" ``` ```js const params = new URLSearchParams({ market: 'goals.asian', limit: '2' }); const response = await fetch(`https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e71/odds/history?${params}`, { headers: { Authorization: 'Bearer YOUR_KEY' }, }); console.log(JSON.stringify(await response.json(), null, 2)); ``` ```python import json import requests response = requests.get( 'https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e71/odds/history', headers={'Authorization': 'Bearer YOUR_KEY'}, params={'market': 'goals.asian', 'limit': 2}, ) print(json.dumps(response.json(), indent=2)) ``` ```php use Illuminate\Support\Facades\Http; $response = Http::withToken('YOUR_KEY')->get('https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e71/odds/history', ['market' => 'goals.asian', 'limit' => 2]); echo json_encode($response->json(), JSON_PRETTY_PRINT); ``` ```json { "data": [{ "at": "…", "phase": "pre_match", "prices": ["…"] }, "…"], "meta": { "next_cursor": "eyJhdCI6IjIwMjYt...", "has_more": true, "…": "…" }, "links": { "…": "…" } } ``` ## 3. Read the next page Send `meta.next_cursor` as `cursor` with the same `market`. ```bash curl "https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e71/odds/history?market=goals.asian&limit=2&cursor=YOUR_CURSOR" \ -H "Authorization: Bearer YOUR_KEY" ``` ```js const params = new URLSearchParams({ market: 'goals.asian', limit: '2', cursor: 'YOUR_CURSOR' }); const response = await fetch(`https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e71/odds/history?${params}`, { headers: { Authorization: 'Bearer YOUR_KEY' }, }); console.log(JSON.stringify(await response.json(), null, 2)); ``` ```python import json import requests response = requests.get( 'https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e71/odds/history', headers={'Authorization': 'Bearer YOUR_KEY'}, params={'market': 'goals.asian', 'limit': 2, 'cursor': 'YOUR_CURSOR'}, ) print(json.dumps(response.json(), indent=2)) ``` ```php use Illuminate\Support\Facades\Http; $response = Http::withToken('YOUR_KEY')->get('https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e71/odds/history', ['market' => 'goals.asian', 'limit' => 2, 'cursor' => 'YOUR_CURSOR']); echo json_encode($response->json(), JSON_PRETTY_PRINT); ``` ```json { "data": [{ "at": "…", "phase": "pre_match", "prices": ["…"] }], "meta": { "next_cursor": null, "has_more": false, "…": "…" }, "links": { "…": "…" } } ``` ## Reference Parameters on `GET /matches/{id}/odds/history`. | Parameter | Values | Notes | | --- | --- | --- | | `market` | A key from `/markets` | Required. | | `from`, `to` | Date-time | `to` must not be before `from`. | | `limit` | 1 to 2000 | Default 2000. | | `cursor` | Value of `meta.next_cursor` | See [Paging with cursors](paging-with-cursors.md). | History starts from when we began recording a match. A match with nothing recorded answers `200` with an empty `data` and the reason `not_held`. # Team stats Use this page to read a team's recent form and averages: goals, corners, cards, shots and more. These endpoints need the `stats:read` ability, which comes with the stats pack on any paid plan and with Business. ## 1. Read a team's stats `/teams/{id}/stats` summarises a team's last games. `window` is the number of games (default 10, maximum 50) and `venue` is `all`, `home` or `away`. By default friendlies and short formats are left out. ```bash curl "https://odds-feed.on-forge.com/api/v2/teams/0199c5a0-0000-7000-8000-000000000001/stats?window=10" \ -H "Authorization: Bearer YOUR_KEY" ``` ```js const params = new URLSearchParams({ window: '10' }); const response = await fetch(`https://odds-feed.on-forge.com/api/v2/teams/0199c5a0-0000-7000-8000-000000000001/stats?${params}`, { headers: { Authorization: 'Bearer YOUR_KEY' }, }); console.log(JSON.stringify(await response.json(), null, 2)); ``` ```python import json import requests response = requests.get( 'https://odds-feed.on-forge.com/api/v2/teams/0199c5a0-0000-7000-8000-000000000001/stats', headers={'Authorization': 'Bearer YOUR_KEY'}, params={'window': 10}, ) print(json.dumps(response.json(), indent=2)) ``` ```php use Illuminate\Support\Facades\Http; $response = Http::withToken('YOUR_KEY')->get('https://odds-feed.on-forge.com/api/v2/teams/0199c5a0-0000-7000-8000-000000000001/stats', ['window' => 10]); echo json_encode($response->json(), JSON_PRETTY_PRINT); ``` ```json { "data": { "team": { "id": "0199c5a0-0000-7000-8000-000000000001", "name": "Brentford" }, "window": { "size": 10, "venue": "all", "competition": null, "competitive_only": true, "games": 6 }, "form": { "string": "WDLWWD", "wins": 3, "draws": 2, "losses": 1, "win_rate": 0.5, "points_per_game": 1.83 }, "goals": { "sample": 6, "avg_for": 1.33, "avg_against": 0.83, "avg_total": 2.17, "over": { "0.5": 1, "1.5": 0.833, "2.5": 0.167, "3.5": 0.167, "4.5": 0 }, "btts_rate": 0.5, "…": "…" }, "corners": { "sample": 6, "avg_for": 5, "avg_against": 4.17, "avg_total": 9.17, "…": "…" }, "cards": null, "shots": null, "other": null }, "meta": { "generated_at": "2026-11-27T10:41:00.000Z", "team": "0199c5a0-0000-7000-8000-000000000001", "sources": [{ "name": "bet365", "captured_at": "2026-11-27T10:40:20.000Z" }], "availability": { "status": "available" } }, "links": { "self": "/api/v2/teams/0199c5a0-0000-7000-8000-000000000001/stats" } } ``` A block is `null` when we have no readings for it. `over` maps a line to the share of games that finished over it. `availability` is `partial` with the reason `thin_sample` when the team has fewer than 3 games in the window, and `unavailable` with `no_history` when it has none. ## 2. Narrow the window `venue`, `competition` (a competition id) and `all_games=1` change which games count. `include=games` adds the list of games behind the numbers, and `include=timing` adds goal and corner timing where we hold it. ```bash curl "https://odds-feed.on-forge.com/api/v2/teams/0199c5a0-0000-7000-8000-000000000001/stats?window=5&venue=home&include=games" \ -H "Authorization: Bearer YOUR_KEY" ``` ```js const params = new URLSearchParams({ window: '5', venue: 'home', include: 'games' }); const response = await fetch(`https://odds-feed.on-forge.com/api/v2/teams/0199c5a0-0000-7000-8000-000000000001/stats?${params}`, { headers: { Authorization: 'Bearer YOUR_KEY' }, }); console.log(JSON.stringify(await response.json(), null, 2)); ``` ```python import json import requests response = requests.get( 'https://odds-feed.on-forge.com/api/v2/teams/0199c5a0-0000-7000-8000-000000000001/stats', headers={'Authorization': 'Bearer YOUR_KEY'}, params={'window': 5, 'venue': 'home', 'include': 'games'}, ) print(json.dumps(response.json(), indent=2)) ``` ```php use Illuminate\Support\Facades\Http; $response = Http::withToken('YOUR_KEY')->get('https://odds-feed.on-forge.com/api/v2/teams/0199c5a0-0000-7000-8000-000000000001/stats', ['window' => 5, 'venue' => 'home', 'include' => 'games']); echo json_encode($response->json(), JSON_PRETTY_PRINT); ``` ```json { "data": { "window": { "size": 5, "venue": "home", "competition": null, "competitive_only": true, "games": 3 }, "games": [ { "match": "0199c5a0-7b1e-7c3a-9f4e-000000000001", "kickoff_at": "2026-11-26T10:45:40.000Z", "opponent": { "id": "0199c5a0-0000-7000-8000-000000000002", "name": "Everton" }, "venue": "home", "score": { "home": 2, "away": 0 }, "result": "W", "competitive": true }, "…" ], "…": "…" }, "…": "…" } ``` ## Reference Parameters on `GET /teams/{id}/stats`. | Parameter | Values | Notes | | --- | --- | --- | | `window` | 1 to 50 | Default 10. | | `venue` | `all`, `home`, `away` | Default `all`. | | `competition` | Competition id | Only that competition's games. | | `all_games` | `1`, `0`, `true`, `false` | `1` counts friendlies and short formats. | | `include` | `games`, `timing` | Comma separated. | # Team form Use this page to read how a team has been playing over its last games. It is the stats window with only the form block. ## 1. Read a team's form `/teams/{id}/form` is the same window as [Team stats](team-stats.md) with only the form block. It takes the same parameters. ```bash curl "https://odds-feed.on-forge.com/api/v2/teams/0199c5a0-0000-7000-8000-000000000001/form?window=5" \ -H "Authorization: Bearer YOUR_KEY" ``` ```js const params = new URLSearchParams({ window: '5' }); const response = await fetch(`https://odds-feed.on-forge.com/api/v2/teams/0199c5a0-0000-7000-8000-000000000001/form?${params}`, { headers: { Authorization: 'Bearer YOUR_KEY' }, }); console.log(JSON.stringify(await response.json(), null, 2)); ``` ```python import json import requests response = requests.get( 'https://odds-feed.on-forge.com/api/v2/teams/0199c5a0-0000-7000-8000-000000000001/form', headers={'Authorization': 'Bearer YOUR_KEY'}, params={'window': 5}, ) print(json.dumps(response.json(), indent=2)) ``` ```php use Illuminate\Support\Facades\Http; $response = Http::withToken('YOUR_KEY')->get('https://odds-feed.on-forge.com/api/v2/teams/0199c5a0-0000-7000-8000-000000000001/form', ['window' => 5]); echo json_encode($response->json(), JSON_PRETTY_PRINT); ``` ```json { "data": { "team": { "id": "0199c5a0-0000-7000-8000-000000000001", "name": "Brentford" }, "window": { "size": 5, "…": "…" }, "form": { "string": "WDLWW", "wins": 3, "draws": 1, "losses": 1, "win_rate": 0.6, "points_per_game": 1.8 } }, "meta": { "…": "…" }, "links": { "…": "…" } } ``` ## Reference `GET /teams/{id}/form` needs `stats:read` and takes `window`, `venue`, `competition`, `all_games` and `include`. # Match preview Use this page to read both teams, the competition and their meetings in one response. It is the quickest way to preview a match. ## 1. Preview a match `/matches/{id}/preview` puts both teams' stats, the competition's averages and the head to head in one response. `venue` defaults to `auto`, which uses the home team's home games and the away team's away games. `meetings` is how many head to head games to list (default 10). ```bash curl "https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70/preview?meetings=3" \ -H "Authorization: Bearer YOUR_KEY" ``` ```js const params = new URLSearchParams({ meetings: '3' }); const response = await fetch(`https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70/preview?${params}`, { headers: { Authorization: 'Bearer YOUR_KEY' }, }); console.log(JSON.stringify(await response.json(), null, 2)); ``` ```python import json import requests response = requests.get( 'https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70/preview', headers={'Authorization': 'Bearer YOUR_KEY'}, params={'meetings': 3}, ) print(json.dumps(response.json(), indent=2)) ``` ```php use Illuminate\Support\Facades\Http; $response = Http::withToken('YOUR_KEY')->get('https://odds-feed.on-forge.com/api/v2/matches/0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70/preview', ['meetings' => 3]); echo json_encode($response->json(), JSON_PRETTY_PRINT); ``` ```json { "data": { "match": { "id": "0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70", "…": "…" }, "home": { "…": "…" }, "away": { "…": "…" }, "competition": { "competition": { "name": "Premier League", "…": "…" }, "avg_goals": 2, "…": "…" }, "head_to_head": { "sample": 6, "home_wins": 3, "draws": 2, "away_wins": 1, "meetings": [ { "match": "0199c5a0-7b1e-7c3a-9f4e-000000000001", "kickoff_at": "2026-11-26T10:45:40.000Z", "opponent": { "name": "Everton", "…": "…" }, "venue": "home", "score": { "home": 2, "away": 0 }, "result": "W", "competitive": true }, "…" ], "…": "…" } }, "meta": { "match": "0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70", "availability": { "status": "available" }, "…": "…" }, "links": { "…": "…" } } ``` ## Reference `GET /matches/{id}/preview` needs `stats:read`. It takes the parameters of [Team stats](team-stats.md), with `venue` also accepting `auto` (the default), and `meetings` (1 to 50). # Competition stats Use this page to read the averages of a whole competition. They show what is normal for goals, results, corners and cards. ## 1. Read a competition's averages `/competitions/{id}/stats` gives goals, results, corners and cards across the competition's last games. `window` is 1 to 200 games (default 50). ```bash curl "https://odds-feed.on-forge.com/api/v2/competitions/0199c5a0-0000-7000-9000-000000000001/stats" \ -H "Authorization: Bearer YOUR_KEY" ``` ```js const response = await fetch('https://odds-feed.on-forge.com/api/v2/competitions/0199c5a0-0000-7000-9000-000000000001/stats', { headers: { Authorization: 'Bearer YOUR_KEY' }, }); console.log(JSON.stringify(await response.json(), null, 2)); ``` ```python import json import requests response = requests.get( 'https://odds-feed.on-forge.com/api/v2/competitions/0199c5a0-0000-7000-9000-000000000001/stats', headers={'Authorization': 'Bearer YOUR_KEY'}, ) print(json.dumps(response.json(), indent=2)) ``` ```php use Illuminate\Support\Facades\Http; $response = Http::withToken('YOUR_KEY')->get('https://odds-feed.on-forge.com/api/v2/competitions/0199c5a0-0000-7000-9000-000000000001/stats'); echo json_encode($response->json(), JSON_PRETTY_PRINT); ``` ```json { "data": { "competition": { "id": "0199c5a0-0000-7000-9000-000000000001", "name": "Premier League" }, "window": { "size": 50, "games": 5 }, "avg_goals": 2, "over_2_5_rate": 0.2, "btts_rate": 0.4, "home_win_rate": 0.6, "draw_rate": 0.4, "away_win_rate": 0, "avg_corners": 9, "corners_sample": 5, "avg_cards": null, "cards_sample": 0 }, "meta": { "competition": "0199c5a0-0000-7000-9000-000000000001", "availability": { "status": "available" }, "…": "…" }, "links": { "…": "…" } } ``` ## Reference `GET /competitions/{id}/stats` needs `stats:read` and takes `window`. # Filtering matches by stats Use this page to find matches by what the teams' recent games say. The filters are on `GET /matches`, next to the ones on [Filtering games](filtering-games.md). ## 1. Filter by a stat `/matches` takes a minimum or maximum for each of the stats below, calculated over the last `stats_window` games (5 or 10, default 10) of both teams. A match is left out when either team has fewer than 3 games or no stats. `include=stats` adds each team's numbers to the match. ```bash curl "https://odds-feed.on-forge.com/api/v2/matches?corners_avg_total_min=7&include=stats&limit=1" \ -H "Authorization: Bearer YOUR_KEY" ``` ```js const params = new URLSearchParams({ corners_avg_total_min: '7', include: 'stats', limit: '1' }); const response = await fetch(`https://odds-feed.on-forge.com/api/v2/matches?${params}`, { headers: { Authorization: 'Bearer YOUR_KEY' }, }); console.log(JSON.stringify(await response.json(), null, 2)); ``` ```python import json import requests response = requests.get( 'https://odds-feed.on-forge.com/api/v2/matches', headers={'Authorization': 'Bearer YOUR_KEY'}, params={'corners_avg_total_min': 7, 'include': 'stats', 'limit': 1}, ) print(json.dumps(response.json(), indent=2)) ``` ```php use Illuminate\Support\Facades\Http; $response = Http::withToken('YOUR_KEY')->get('https://odds-feed.on-forge.com/api/v2/matches', ['corners_avg_total_min' => 7, 'include' => 'stats', 'limit' => 1]); echo json_encode($response->json(), JSON_PRETTY_PRINT); ``` ```json { "data": [ { "id": "0199c5a0-7b1e-7c3a-9f4e-2d6b8a1c4e70", "stats": { "window": 10, "home": { "as_of": "2026-11-27T10:40:20.000Z", "sample": 3, "form_win_rate": 0.667, "points_per_game": 2, "goals_avg_total": 1.67, "corners_avg_total": 9, "cards_avg_total": null, "…": "…" }, "away": { "sample": 4, "…": "…" } }, "…": "…" } ], "meta": { "next_cursor": null, "has_more": false, "…": "…" }, "links": { "…": "…" } } ``` ## 2. Filter teams by a stat `GET /teams` takes the same kind of bounds for a team's own figures: `form_win_rate`, `ppg`, `goals_avg_for`, `goals_avg_against`, `goals_avg_total`, `over_2_5_rate`, `btts_rate`, `corners_avg_for`, `corners_avg_against`, `corners_avg_total` and `cards_avg_total`, each with `_min` or `_max`. `stats_window` is 5 or 10 games (default 10) and `stats_venue` is `all`, `home` or `away` (default `all`). A team with fewer than 3 games in the window is left out. For example, `/teams?corners_avg_total_min=11&stats_venue=home` lists teams whose home games average 11 or more corners. ## Reference Stats filters on `GET /matches`. They need `fixtures:read` and `stats:read`. | Parameters | Notes | | --- | --- | | `home_form_win_rate_min`, `home_form_win_rate_max` | Home team's win rate in its home games. | | `away_form_win_rate_min`, `away_form_win_rate_max` | Away team's win rate in its away games. | | `goals_avg_total_min`, `goals_avg_total_max` | Average of both teams' average total goals. | | `over_2_5_rate_min`, `over_2_5_rate_max` | Average of both teams' share of games over 2.5 goals. | | `btts_rate_min`, `btts_rate_max` | Average of both teams' both teams to score rate. | | `corners_avg_total_min`, `corners_avg_total_max` | Average of both teams' average total corners. | | `cards_avg_total_min`, `cards_avg_total_max` | Average of both teams' average total cards. | | `stats_window` | `5` or `10`. | | `include=stats` | Adds a `stats` block to each match. | # Responses Use this page to look up what is in a response. Most responses have the same three keys, so one reader covers most endpoints. ## 1. Read the envelope `data` holds the result, `meta` describes it and `links` holds paths. Lists add `next_cursor` and `has_more` to `meta`, and topics add the keys below. | Key | Where | Meaning | | --- | --- | --- | | `meta.generated_at` | Every response | When the response was built, in UTC. | | `meta.next_cursor` | Lists | Send it as `cursor` for the next page. `null` on the last page. | | `meta.has_more` | Lists | `true` while there are more pages. | | `meta.match`, `meta.topic` | Topics | The match and topic the data is for. | | `meta.revision` | Topics | A number that rises when the topic changes, or `null`. | | `meta.changed_at` | Topics | When the topic last changed. | | `meta.sources` | Topics | Where the data came from, with `name` and `captured_at`. | | `meta.availability` | Topics | `status` and, unless it is `available`, a `reason`. | | `meta.redirected_from` | Matches | The id you asked for when the match was merged into another. | | `links.self` | Most responses | The path of this response. | | `links.next` | Lists | The path of the next page, or `null`. | `GET /refs` and `GET /refs/export` use a smaller envelope: `data` and `meta` only, and `refs/export` pages with `meta.next` and `meta.next_cursor` instead of `has_more`. ## 2. Read the availability `meta.availability.status` is `available`, `partial` or `unavailable`. These reasons are used. | Reason | Meaning | | --- | --- | | `not_held` | We hold nothing for this topic. | | `not_found` | A match id in a batch request is unknown. | | `not_upcoming` | The match has started or ended, so it has no pre-match Bet Builder. | | `not_captured` | A Bet Builder has not been captured yet. | | `not_offered` | bet365 offers no Bet Builder for the match. | | `basic_only` | Only the basic Bet Builder exists. | | `capture_queued` | A capture has been requested and is queued. | | `not_listed` | The match is not listed as upcoming. | | `thin_sample` | Fewer than 3 games behind the stats. | | `no_history` | No games behind the stats. | | `team_not_linked`, `teams_not_linked` | One or both teams are not linked to a team record. | ## Reference Formats. | Item | Format | | --- | --- | | Time | UTC, ISO 8601 with milliseconds | | Ids | UUID for matches, competitions, teams and venues | | Yes/no parameters | `1`, `0`, `true` or `false` | | Lists in a parameter | Comma separated, for example `markets=match.result,corners.race` | | Cursors | Opaque. Use the value you were given. See [Paging with cursors](paging-with-cursors.md). | # Error codes Use this page to look up an error code. How to read and handle an error is on [Errors](errors.md). ## 1. Find the code Every error has `status`, `code` and `message`. Branch on `code`, which is stable. A `400` also carries `fields`, a list of problems for each parameter. | Status | Code | Meaning | | --- | --- | --- | | 400 | `bad_request` | A parameter is missing or invalid. See `fields`. | | 401 | `unauthenticated` | The key is missing or not valid. | | 403 | `not_entitled` | The key lacks an ability the endpoint needs, or your plan does not include the markets you asked for. The message names it. | | 404 | `match_not_found` | No match has this id. Also used for a path that does not exist. | | 404 | `competition_not_found` | No competition has this id. | | 404 | `team_not_found` | No team has this id. | | 404 | `venue_not_found` | No venue has this id. | | 429 | `rate_limited` | Too many requests. Wait for the time in the `Retry-After` header. | | 500 | `server_error` | Something went wrong on our side. Retry later. | ## Reference For the plan behind a `403`, see [Plans and access](plans.md). For the limits behind a `429`, see [Rate limits](rate-limits.md). # Status endpoint Use this page to check that the feed is healthy. Any key can read it, whatever its abilities. ## 1. Read the status `GET /status` says whether the feed is healthy and how many matches are live. Check it before you raise an alarm about missing data. ```bash curl "https://odds-feed.on-forge.com/api/v2/status" \ -H "Authorization: Bearer YOUR_KEY" ``` ```js const response = await fetch('https://odds-feed.on-forge.com/api/v2/status', { headers: { Authorization: 'Bearer YOUR_KEY' }, }); console.log(JSON.stringify(await response.json(), null, 2)); ``` ```python import json import requests response = requests.get( 'https://odds-feed.on-forge.com/api/v2/status', headers={'Authorization': 'Bearer YOUR_KEY'}, ) print(json.dumps(response.json(), indent=2)) ``` ```php use Illuminate\Support\Facades\Http; $response = Http::withToken('YOUR_KEY')->get('https://odds-feed.on-forge.com/api/v2/status'); echo json_encode($response->json(), JSON_PRETTY_PRINT); ``` ```json { "data": { "healthy": true, "live_matches": 12, "…": "…", "checked_at": "2026-11-27T14:02:26.822Z" }, "meta": { "generated_at": "2026-11-27T14:02:26.823Z" }, "links": { "self": "/api/v2/status" } } ``` ## Reference | Field | Meaning | | --- | --- | | `healthy` | `true` when the feed is up to date. | | `live_matches` | How many live matches we hold. | | `coverage` | The share of live matches we hold, or `null` when none are live. | | `pre_match_matches` | How many upcoming matches we hold prices for, or `null`. | | `checked_at` | When the status was read, in UTC. | # Abilities Use this page to look up the ability an endpoint needs. A key without it gets `403` with the code `not_entitled`. ## 1. Find the ability | Endpoint | Ability | | --- | --- | | `GET /matches`, `/matches/{id}`, `/competitions`, `/competitions/{id}`, `/teams`, `/teams/{id}`, `/venues/{id}` | `fixtures:read` | | `GET /refs`, `/refs/export`, `/changes` | `fixtures:read` | | `GET /status` | None. Any key can read it. | | `GET /markets` | `markets:read` | | `GET /odds` | `markets:read` | | `GET /matches/{id}/odds`, `/stats`, `/tracker`, `/players`, `/betbuilder` | `markets:read` | | `GET /matches/{id}/table`, `/weather` | `fixtures:read` | | `GET /matches/{id}/live/{topic}` | `stream:read` and the ability of the topic | | `POST /matches/{id}/betbuilder/capture` | `markets:read` | | `GET /matches/{id}/odds/history`, `/odds/lines` | `history:read` | | `GET /teams/{id}/stats`, `/teams/{id}/form` | `stats:read` | | `GET /matches/{id}/preview`, `GET /competitions/{id}/stats` | `stats:read` | | `GET /matches` with a stats filter or `include=stats` | `fixtures:read` and `stats:read` | | Private channels | `stream:read`, `stream:firehose` and the topic's ability. See [Channels](channels.md). | `refs:partner` shows refs from partner sources on matches and refs endpoints. Most keys do not need it. ## Reference The abilities each plan grants are on [Plans and access](plans.md). # Glossary Use this page to look up a word the documentation uses. Words are in alphabetical order. ## Terms | Term | Meaning | | --- | --- | | Ability | A permission on a key, such as `markets:read`. See [Abilities](abilities.md). | | Availability | Whether we hold a topic: `available`, `partial` or `unavailable`. See [Responses](responses.md). | | Bet Builder | A combination of selections in one match with a single price. | | Capture | A saved copy of a bet365 page. You can ask for a Bet Builder capture sooner than the schedule. | | Closing line | The last price before kick-off. See [Opening and closing lines](opening-and-closing-lines.md). | | Cursor | An opaque value that says where the next page starts. See [Paging with cursors](paging-with-cursors.md). | | Decimal odds | The price as a single number, such as `2.5`. Use it for maths. | | Fractional odds | The price as a fraction, such as `3/2`. | | Group | A bet365 market group with its selections. | | Key | Either an API key, or a market key such as `match.result`. | | Line | The number a market is priced at, such as `2.5` goals. | | Market | Something prices are offered on, such as the match result. | | Match | One game. Its `id` is a UUID. | | Patch | A message with only what changed. See [Message types](message-types.md). | | Plan | What a customer pays for. It decides the markets and abilities a key can use. See [Plans and access](plans.md). | | Ref | An id another system uses for the same match, team or player. See [External ids](external-ids.md). | | Revision | A number that rises each time a topic changes. | | Selection | One thing you can back in a market, such as the home win. | | Snapshot | A message with the whole topic. | | Topic | One kind of data on a match, such as `odds` or `tracker`. | # Using with AI Use this page to give Claude Code, Codex or another coding assistant what it needs to write code against the API. We publish three files, and every example in these docs has a tab with a prompt for an assistant. ## 1. Know the three files We publish these files as plain text next to the documentation. | File | What it is | | --- | --- | | `llms.txt` | An index of the documentation: a title, a one-line summary and a link to each page. | | `llms-full.txt` | Every page in one file, with the code examples for all four languages. | | `AGENTS.md` | Short instructions for coding agents: base URL, authentication, paging, abilities and the rules for live data. | They are at: ``` https://odds-feed.on-forge.com/docs/llms.txt https://odds-feed.on-forge.com/docs/llms-full.txt https://odds-feed.on-forge.com/docs/AGENTS.md ``` Every page is also available as Markdown at `/docs/{page}.md`, and the Copy page for AI button on a page copies it. ## 2. Point your assistant at them Most assistants can read a URL. Give it `llms.txt` to let it pick pages, or `llms-full.txt` when it should read everything. To keep the rules in a project, save `AGENTS.md` in the root of your repository, where coding agents look for it. ```bash curl -o AGENTS.md https://odds-feed.on-forge.com/docs/AGENTS.md ``` ## 3. Use the Claude Code / Codex tab The last tab of every example is a prompt for that step. It names the request, links the page and the full documentation, and tells the assistant to read the key from an environment variable. Copy it into Claude Code or Codex. ## 4. Paste a starting prompt Use this prompt as a starting point. Replace the values in brackets. ```text You are writing code against the OddsYorkie API. Read https://odds-feed.on-forge.com/docs/llms-full.txt before you write any code. Rules: - The base URL is https://odds-feed.on-forge.com/api/v2. - Authenticate with the header "Authorization: Bearer ". Read the key from the ODDSYORKIE_KEY environment variable. Never put it in code. - Page lists with the cursor in meta.next_cursor until meta.has_more is false. - Prices are objects with decimal and fractional. A null price is suspended or not offered. Never round a price. - For live data use the WebSocket described in the live updates pages instead of polling. - Handle the error codes on the error codes page. Retry a 429 after the Retry-After header. Task: [describe what you want to build] ``` ## Reference What `AGENTS.md` covers. | Section | Contents | | --- | --- | | Base URL and authentication | The `/api/v2` base and the bearer header. | | Paging | Cursor and `has_more`. | | Abilities | Which ability each group of endpoints needs. | | Live updates | How to apply `snapshot`, `patch`, `removed` and `refetch`, and how to resume. | | Prices | Never round, `null` means suspended. |