# OddsYorkie API Instructions for coding agents that write code against the OddsYorkie API. Read https://odds-feed.on-forge.com/docs/llms-full.txt for the full documentation. ## Base URL and authentication - Base URL: `https://odds-feed.on-forge.com/api/v2`. - Send `Authorization: Bearer ` on every request. Read the key from an environment variable and never write it into code. - Times are UTC ISO 8601 with milliseconds. Ids are UUIDs. - Boolean parameters take `1`, `0`, `true` or `false`. ## Paging - Lists return `meta.next_cursor` and `meta.has_more`. - Send `meta.next_cursor` as `cursor` with the same filters until `has_more` is false. The cursor is opaque. - On `/changes` only, an empty `cursor` starts from the latest change and `cursor=0` from the oldest one kept. - Maximum `limit`: 500 for matches, competitions and teams, 2000 for changes and odds history, 5000 for odds lines and refs export. ## Abilities - `fixtures:read`: matches, competitions, teams, refs, changes, table. - `markets:read`: markets, odds, stats, tracker, players, bet builder, capture. - `history:read`: odds history and odds lines. - `stats:read`: team stats, form, match preview, competition stats and stats filters on matches. - `stream:read` and `stream:firehose`: private WebSocket channels and `GET /matches/{id}/live/{topic}`. - A missing ability, or a market outside the plan, returns `403` with the code `not_entitled`. ## Prices - A price is `{decimal, fractional}`. Use `decimal` for maths and never round a price. - A price of `null` means the selection is suspended or not offered. Check for `null` before reading it. - History prices have `fractional` set to `null`. ## Live updates - Use the Pusher protocol WebSocket, not polling. Channels are `private-match.{id}.{topic}`, `private-live.{topic}`, `private-matches` and `private-fixtures`. On Main lines and Full depth the odds channels end in the plan: `.odds.main-lines` or `.odds.full-depth`. Authorise them at `https://odds-feed.on-forge.com/broadcasting/auth` with the bearer key. - `snapshot`: replace the topic. `patch`: merge into the topic, where a key set to `null` is removed and a missing key is unchanged. `removed`: drop the topic. `refetch`: request `links.self` and replace the topic. - Skip a message whose `revision` is lower than the one you hold. - Keep the last message `id`. After a reconnect call `GET /api/v2/changes?cursor=` and refetch the topics it lists. If `meta.gap` is true, refetch everything you follow. ## Errors - Every error is `{error: {status, code, message, fields?}}`. Branch on `code`. - Retry `429` after the number of seconds in `Retry-After`. Do not retry `400`, `401`, `403` or `404`. ## Pages - [Introduction](https://odds-feed.on-forge.com/docs/introduction.md): OddsYorkie is a REST API and a WebSocket for football odds, stats and live match data. - [Quickstart](https://odds-feed.on-forge.com/docs/quickstart.md): Use this page to get a key, make a request and see where live updates come from. - [Authentication and keys](https://odds-feed.on-forge.com/docs/authentication.md): Use this page to send your key and to see what a failed request looks like. - [Plans and access](https://odds-feed.on-forge.com/docs/plans.md): Use this page to see what each plan shows and what happens when a key asks for more. - [Rate limits](https://odds-feed.on-forge.com/docs/rate-limits.md): Use this page to see how many requests a key may make and what to do when you reach the limit. - [Errors](https://odds-feed.on-forge.com/docs/errors.md): Use this page to handle a failed request. - [Live and upcoming games](https://odds-feed.on-forge.com/docs/live-and-upcoming.md): Use this page to list the matches that are live, the matches in a time window and the matches on one local day. - [Filtering games](https://odds-feed.on-forge.com/docs/filtering-games.md): Use this page to narrow `GET /matches` by competition, team, competition type or odds, and to change the order. - [Searching teams and competitions](https://odds-feed.on-forge.com/docs/searching-teams-and-competitions.md): Use this page to find the id of a competition or a team from its name, and to search matches by name. - [Paging with cursors](https://odds-feed.on-forge.com/docs/paging-with-cursors.md): Use this page to read a list that is longer than one page. - [Game details and statuses](https://odds-feed.on-forge.com/docs/game-details.md): Use this page to read one match and understand its status. - [Venues and weather](https://odds-feed.on-forge.com/docs/venues-and-weather.md): Use this page to read the ground a match is played at and the weather forecast for it. - [External ids](https://odds-feed.on-forge.com/docs/external-ids.md): 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. - [The market list](https://odds-feed.on-forge.com/docs/market-list.md): Use this page to find which markets exist and what each one looks like. - [Reading prices](https://odds-feed.on-forge.com/docs/reading-prices.md): Use this page to read the odds of one match and to read a single price. - [Choosing markets](https://odds-feed.on-forge.com/docs/choosing-markets.md): Use this page to ask for only the markets you need, and to read every bet365 group and every player market. - [Many games at once](https://odds-feed.on-forge.com/docs/many-games.md): Use this page to read the odds of up to 50 matches in one request. - [Half-time markets](https://odds-feed.on-forge.com/docs/half-time-markets.md): Use this page to read the markets for the first half and the second half. - [Market keys](https://odds-feed.on-forge.com/docs/market-keys.md): Use this page to look up a market key and the plan that shows it. - [Score and tracker](https://odds-feed.on-forge.com/docs/score-and-tracker.md): Use this page to read the live view of a match: the score, the clock, the ball and the incidents so far. - [Match stats](https://odds-feed.on-forge.com/docs/stats.md): Use this page to read the counters of a match, such as corners. - [Players](https://odds-feed.on-forge.com/docs/players.md): Use this page to read the players of a match and their running stats. - [Live tables](https://odds-feed.on-forge.com/docs/live-tables.md): Use this page to read the league table a match belongs to. - [The live snapshot](https://odds-feed.on-forge.com/docs/live-snapshot.md): Use this page to load the whole current state of a live topic, exactly as the WebSocket sends it. - [Connecting](https://odds-feed.on-forge.com/docs/connecting.md): Use this page to open a WebSocket connection and authorise a private channel. - [Channels](https://odds-feed.on-forge.com/docs/channels.md): Use this page to pick the channels to subscribe to. - [Message types](https://odds-feed.on-forge.com/docs/message-types.md): Use this page to read a message and keep your own copy of a topic up to date. - [Catching up with changes](https://odds-feed.on-forge.com/docs/catching-up.md): Use this page to recover what you missed while you were disconnected. - [Bet Builder before the game](https://odds-feed.on-forge.com/docs/bet-builder-pre-match.md): Use this page to check whether a match has a Bet Builder and to read it before kick-off. - [Bet Builder in play](https://odds-feed.on-forge.com/docs/bet-builder-in-play.md): Use this page to read the Bet Builder once a match is live. - [Asking for a capture](https://odds-feed.on-forge.com/docs/bet-builder-capture.md): Use this page to ask for a pre-match Bet Builder to be captured sooner than the schedule. - [Opening and closing lines](https://odds-feed.on-forge.com/docs/opening-and-closing-lines.md): Use this page to read the first, latest and closing price of each pre-match selection. - [Price history](https://odds-feed.on-forge.com/docs/price-history.md): Use this page to read every price change of one market, oldest first. - [Team stats](https://odds-feed.on-forge.com/docs/team-stats.md): Use this page to read a team's recent form and averages: goals, corners, cards, shots and more. - [Team form](https://odds-feed.on-forge.com/docs/team-form.md): Use this page to read how a team has been playing over its last games. - [Match preview](https://odds-feed.on-forge.com/docs/match-preview.md): Use this page to read both teams, the competition and their meetings in one response. - [Competition stats](https://odds-feed.on-forge.com/docs/competition-stats.md): Use this page to read the averages of a whole competition. - [Filtering matches by stats](https://odds-feed.on-forge.com/docs/filtering-by-stats.md): Use this page to find matches by what the teams' recent games say. - [Responses](https://odds-feed.on-forge.com/docs/responses.md): Use this page to look up what is in a response. - [Error codes](https://odds-feed.on-forge.com/docs/error-codes.md): Use this page to look up an error code. - [Status endpoint](https://odds-feed.on-forge.com/docs/status.md): Use this page to check that the feed is healthy. - [Abilities](https://odds-feed.on-forge.com/docs/abilities.md): Use this page to look up the ability an endpoint needs. - [Glossary](https://odds-feed.on-forge.com/docs/glossary.md): Use this page to look up a word the documentation uses. - [Using with AI](https://odds-feed.on-forge.com/docs/using-ai.md): Use this page to give Claude Code, Codex or another coding assistant what it needs to write code against the API.