# PinnFeed API spec for AI assistants # Generated from the PinnFeed source code. Plain text: https://pinnfeed.io/build-with-ai/spec.txt # Paste this whole block into Claude, ChatGPT, Cursor, Lovable, Replit, v0, bolt.new or base44 BEFORE asking for code. ## What PinnFeed is Real-time Pinnacle sports betting odds (live and prematch, 13 sports) as a REST API, a WebSocket stream and a hosted MCP server. Independent service, not affiliated with Pinnacle. Odds data only: no bets are placed. ## Base URL and auth (do not guess these) - REST base URL: https://pinnfeed.io (all endpoints start with /v1/; there is no api. subdomain and no /api prefix) - Auth: send the key in the header x-api-key: YOUR_KEY Also accepted: Authorization: Bearer YOUR_KEY, or ?key=YOUR_KEY in the URL (only when headers are impossible). - Keys start with ps_live_. Read the key from an environment variable (PINNFEED_KEY) or a server-side secret. Never put it in frontend/browser code, a public repo or a shared chat. - Every response is JSON. Errors: {"error":{"code":"...","message":"...", ...}}. - CORS is open (*) on /v1, but a key in browser code is visible to everyone: call PinnFeed from a backend, serverless function or edge function. ## Plans (what each key can do) - Free: $0; data delayed 30 s; 1 req/s sustained, burst 10; 1,000 requests/day per account (all keys), reset 00:00 UTC; 2 sports (chosen in the dashboard); main markets only; no WebSocket. - Realtime REST: $49/mo (3-day free trial, card required); real-time; 5 req/s sustained, burst 10; no daily cap; all 13 sports; main markets only; no WebSocket. - Builder: $139/mo (3-day free trial, card required); real-time; 10 req/s sustained, burst 20; no daily cap; all 13 sports; all markets incl. alternates; specials/props/futures; WebSocket: 3 connections; closing-odds history. - Pro: $179/mo (3-day free trial, card required); real-time; 30 req/s sustained, burst 60; no daily cap; all 13 sports; all markets incl. alternates; specials/props/futures; WebSocket: 10 connections; closing-odds history; raw Pinnacle frames. - Enterprise: custom limits, bulk closing-odds exports, SLA. Contact sales. Feature requirements: - REST /v1 (events, odds, drops, sports, account): all plans. - Real-time (no delay) data: Realtime REST and above. - WebSocket wss://pinnfeed.io/v1/stream: Builder and above. - Alternate lines and all markets: Builder and above. Specials/props/futures: Builder and above. - Closing odds /v1/closing: Builder and above. - Raw Pinnacle frames (WebSocket format "raw"): Pro and above. - Hosted MCP https://pinnfeed.io/mcp: all plans (same limits as REST; each tool call = 1 request). ## Free plan limits (most AI-built prototypes start here) - 1 request/second sustained, burst 10. - 1,000 requests per day per account (shared by all keys), reset at 00:00 UTC. - Data delayed 30 seconds (header X-Data-Delay-Seconds: 30). - 2 sports, chosen in the dashboard; other sports return 403 sport_not_in_plan. - Main markets only (moneyline, spread, total). No WebSocket (403 plan_lacks_ws). No closing odds (403 plan_lacks_history). ## REST endpoints GET /v1/account Returns your plan, limits (sports, rate, daily quota, delay, history) and usage today. GET /v1/sports Returns every sport with id, slug, inPlan and live/prematch event counts. GET /v1/events Returns fixtures without prices (events:[event]), current events first. Shape: {asOf, count, offset, limit, events}. limit default 500, max 1000. - sport: sport slug or id, comma-separated for several. Allowed: soccer, tennis, basketball, hockey, american-football, baseball, rugby, mma, boxing, volleyball-handball, esports, golf, cricket (ids 1-13 in that order). Alias: sports. - league: numeric league id(s), comma-separated (ids come from /v1/events). Alias: leagues. - event: numeric event id(s), comma-separated. Alias: events. - market: market type(s), comma-separated. Allowed: moneyline, spread, total, team_total. Alias: markets. - live: true = in-play only, false = prematch only, omit = both. - main: true = main lines only (non-alternate moneyline/spread/total). Forced on plans with main markets only. - specials: false = drop specials/props/futures (they are only sent on plans that include them). - q: case-insensitive text match on home, away or league name, e.g. q=arsenal. - limit: max rows returned. - offset: rows to skip (paging). - include_started: true = also keep prematch events that have kicked off and markets past their cut-off. Aliases: includeStarted, include_closed. GET /v1/odds Returns events with their markets and prices (events:[event + markets:[market]]). Shape: {asOf, count, offset, limit, events}. sport is required. limit default 200, max 1000. - sport: sport slug or id, comma-separated for several. Allowed: soccer, tennis, basketball, hockey, american-football, baseball, rugby, mma, boxing, volleyball-handball, esports, golf, cricket (ids 1-13 in that order). Alias: sports. - league: numeric league id(s), comma-separated (ids come from /v1/events). Alias: leagues. - event: numeric event id(s), comma-separated. Alias: events. - market: market type(s), comma-separated. Allowed: moneyline, spread, total, team_total. Alias: markets. - live: true = in-play only, false = prematch only, omit = both. - main: true = main lines only (non-alternate moneyline/spread/total). Forced on plans with main markets only. - specials: false = drop specials/props/futures (they are only sent on plans that include them). - q: case-insensitive text match on home, away or league name, e.g. q=arsenal. - limit: max rows returned. - offset: rows to skip (paging). - include_started: true = also keep prematch events that have kicked off and markets past their cut-off. Aliases: includeStarted, include_closed. - include_empty: true = also return events that have no priced market right now (default: only events with at least one priced market). Alias: includeEmpty. GET /v1/drops Returns biggest price drops (drops:[{eventId, sport, league, home, away, startTime, live, marketId, market, period, line, outcome, points, from, to, dropPct, movedAt}]). Shape: {minutes, minPct, count, drops}. minutes default 15 (1-60); min_pct default 3 (0.5-90); limit default 50, max 200. - sport: sport slug or id, comma-separated for several. Allowed: soccer, tennis, basketball, hockey, american-football, baseball, rugby, mma, boxing, volleyball-handball, esports, golf, cricket (ids 1-13 in that order). Alias: sports. - league: numeric league id(s), comma-separated (ids come from /v1/events). Alias: leagues. - event: numeric event id(s), comma-separated. Alias: events. - market: market type(s), comma-separated. Allowed: moneyline, spread, total, team_total. Alias: markets. - live: true = in-play only, false = prematch only, omit = both. - main: true = main lines only (non-alternate moneyline/spread/total). Forced on plans with main markets only. - specials: false = drop specials/props/futures (they are only sent on plans that include them). - minutes: look-back window in minutes. - min_pct: minimum drop in percent (decimal price, from the window high). Alias: minPct. - limit: max rows returned. GET /v1/events/{id} Returns one event with all its markets: {event}. 404 not_found once it has finished. - {id} (path): numeric id. - sport: sport slug or id, comma-separated for several. Allowed: soccer, tennis, basketball, hockey, american-football, baseball, rugby, mma, boxing, volleyball-handball, esports, golf, cricket (ids 1-13 in that order). Alias: sports. - league: numeric league id(s), comma-separated (ids come from /v1/events). Alias: leagues. - event: numeric event id(s), comma-separated. Alias: events. - market: market type(s), comma-separated. Allowed: moneyline, spread, total, team_total. Alias: markets. - live: true = in-play only, false = prematch only, omit = both. - main: true = main lines only (non-alternate moneyline/spread/total). Forced on plans with main markets only. - specials: false = drop specials/props/futures (they are only sent on plans that include them). - include_started: true = also keep prematch events that have kicked off and markets past their cut-off. Aliases: includeStarted, include_closed. GET /v1/closing/{eventId} [Builder and above] Returns closing odds (last prematch price at kickoff) of one event: {eventId, markets:[{eventId, sportId, league, home, away, startTime, capturedAt, market}]}. - {eventId} (path): numeric id. GET /v1/closing [Builder and above] Returns closing odds of a whole UTC day: {date, offset, limit, count, closing:[...]}. limit default 500, max 2000. - date: UTC day YYYY-MM-DD (default today). - sport: sport slug or id, comma-separated for several. Allowed: soccer, tennis, basketball, hockey, american-football, baseball, rugby, mma, boxing, volleyball-handball, esports, golf, cricket (ids 1-13 in that order). Alias: sports. - main: true = main lines only (non-alternate moneyline/spread/total). Forced on plans with main markets only. - limit: max rows returned. - offset: rows to skip (paging). ## Response fields top level: asOf = the moment the data describes (ISO 8601 UTC; 30 s in the past on Free). event: - id: event id (number, stable) - sportId: sport id - sport: sport slug - league: {id, name, group} - home: home team/player - away: away team/player - startTime: ISO 8601 UTC - status: Pinnacle status code - live: true when in-play - parentId: parent event id (periods/specials) or null - units: Regular, Corners, Bookings, ... - special: null, or {category, description} for specials/props/futures - participants: specials only: [{id, name}] - score: live only: {home, away} - clock: live only: minutes played market: - id: market id ":" (stable; use it as your map key) - eventId: event id - key: market key - type: moneyline | spread | total | team_total - period: 0 = full game, 1 = first half/period, ... - side: team_total only: home | away - line: handicap or total points (null for moneyline) - alternate: true for alternate lines - main: true for the main line of a regular event - live: market belongs to an in-play event - maxStake: Pinnacle max stake for the market - cutoffAt: betting cut-off time - margin: bookmaker margin (overround - 1), e.g. 0.0357 = 3.57 % - outcomes: array, see below - updatedAt: last price change, ISO 8601 UTC outcome (market.outcomes[]): - name: home | away | draw | over | under (or participant name on specials) - american: American odds - decimal: decimal odds - fair: no-vig (fair) decimal price, multiplicative de-vig - fairProb: no-vig probability 0-1 - points: spread/total points when the market has a line - participantId: specials only Example GET /v1/odds?sport=soccer&market=moneyline&main=true&limit=20 (illustrative values, not live prices): {"asOf":"2026-11-22T14:00:00.000Z","count":1,"offset":0,"limit":20,"events":[{"id":1640278226,"sportId":1,"sport":"soccer","league":{"id":1980,"name":"England - Premier League","group":"England"},"home":"Home FC","away":"Away United","startTime":"2026-11-22T15:00:00Z","status":"O","live":false,"parentId":null,"units":"Regular","special":null,"score":null,"clock":null,"markets":[{"id":"1640278226:s;0;m","eventId":1640278226,"key":"s;0;m","type":"moneyline","period":0,"side":null,"line":null,"alternate":false,"main":true,"live":false,"maxStake":5000,"cutoffAt":"2026-11-22T15:00:00Z","margin":0.03565,"outcomes":[{"name":"home","american":-128,"decimal":1.7813,"fair":1.8448,"fairProb":0.54206},{"name":"draw","american":262,"decimal":3.62,"fair":3.7491,"fairProb":0.26673},{"name":"away","american":405,"decimal":5.05,"fair":5.23,"fairProb":0.1912}],"updatedAt":"2026-11-22T14:00:00.000Z"}]}]} ## RESPONSE-SIZE NOTE (important for AI fetch/browse tools) A full /v1/odds response can be several megabytes and will overflow an AI tool's context or get truncated. Always filter: sport=..., plus league=... or q=..., market=moneyline (or the markets you need), main=true, and limit=10 to 20. Page with offset. Ask for one event by id with /v1/events/{id}. MCP tools already cap their output. ## Rate-limit headers and errors - Headers on metered responses (plans with a daily quota): X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset (Unix seconds of the next 00:00 UTC). Browsers can read: X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-PinnFeed-Notice, X-Plan, X-Data-Delay-Seconds, Retry-After. - X-Plan: your plan id. X-Data-Delay-Seconds: delay on Free. X-PinnFeed-Notice: plain-text usage notice (from 80 % of the daily quota). - 400 invalid_filter: unknown sport/market or bad value; the message lists the allowed values. - 401 missing_key: no key sent. 401 invalid_key: unknown or revoked key. - 403 sport_not_in_plan: sport outside your plan. 403 plan_lacks_history: /v1/closing below Builder. 403 plan_lacks_ws: WebSocket below Builder. 403 bodies include upgrade_url. - 404 not_found: event finished or not in your plan. - 429 rate_limited: too many requests per second; wait Retry-After seconds (also retryAfterMs in the body). - 429 daily_quota: daily requests used up; body has limit, reset_at (ISO time) and upgrade_url. Do not retry before reset_at. - WebSocket: 429 connection_limit (too many open sockets for your plan); in-socket {"type":"error","code":...}: invalid_json, unknown_message_type, no_sports, plan_lacks_raw, invalid_filter, sport_not_in_plan. ## WebSocket wss://pinnfeed.io/v1/stream [Builder and above] 1. Connect with header x-api-key: YOUR_KEY (browsers cannot set headers: use wss://pinnfeed.io/v1/stream?key=YOUR_KEY from a trusted page only). 2. Server sends {"type":"welcome","plan":...,"limits":{...}}. Send a subscribe message within 30 seconds or the socket closes (4002 no_subscription): {"type":"subscribe","sports":["soccer"],"live":true,"markets":["moneyline","total"],"main":true} Optional fields: leagues:[ids], events:[ids], specials:false, snapshot:false, format:"raw" (Pro and above). Send subscribe again to change filters; {"type":"unsubscribe"} stops data. 3. Server replies {"type":"subscribed","filters":{...}} then the snapshot in chunks of up to 400 events: {"type":"snapshot","seq":n,"part":1,"parts":3,"final":false,"events":[event],"markets":[market]} ... until "final":true. 4. Then deltas: {"type":"delta","seq":n,"ts":epochMillis,"changes":[...]} where each change is one of {"kind":"event","op":"upsert","event":{...}} {"kind":"event","op":"remove","id":eventId} {"kind":"market","op":"upsert","market":{...full market...}} {"kind":"market","op":"remove","id":marketId,"eventId":eventId} Keep two maps (events by id, markets by market.id): upsert replaces the whole object, remove deletes it. 5. Heartbeat: the server sends {"type":"ping","ts":...} every 20 seconds. Reply {"type":"pong"} every time; no pong for 60 seconds = disconnected. You may also send {"type":"ping"} and get {"type":"pong"}. 6. Close codes: 1001 server_shutdown, 4001 key_revoked, 4002 no_subscription, 4008 slow_consumer. 7. Reconnect: on close, wait 1 s and retry with exponential backoff up to 30 s, resubscribe, and treat the new snapshot as the full state (clear your maps first). permessage-deflate compression is supported if your client offers it. Do not open more sockets than your plan allows. ## Hosted MCP server (no code: AI assistants call PinnFeed directly) - URL: https://pinnfeed.io/mcp (Streamable HTTP, JSON-RPC over POST). Auth: Authorization: Bearer YOUR_KEY, x-api-key, or https://pinnfeed.io/mcp?key=YOUR_KEY for clients that cannot send headers (Claude and ChatGPT custom connectors). - Tools: - get_account: Your PinnFeed plan, limits (sports, rate, daily quota, data delay) and requests used today. Call first to know what you can query. - list_sports: All sports with live and prematch event counts and whether each is in your plan. - search_events: Find events (fixtures) by sport, team or league text, live or prematch (prematch = not kicked off yet; live first, then soonest first). Returns ids, teams, league, start time, score/clock when live. No prices: use get_event or get_*_odds for prices. - get_live_odds(sport): Current in-play Pinnacle odds for a sport (decimal + American prices, no-vig fair odds, margin, max stake). Main markets by default. - get_prematch_odds(sport): Current prematch (pre-game) Pinnacle odds for a sport: only events that have not kicked off yet, with open markets, soonest first. Same fields as get_live_odds; each market has updatedAt (last price change, ISO 8601 UTC) and the response has asOf. - get_event(event_id): One event with all its markets and prices by event id. - get_drops: Biggest odds drops (prices shortening) in the last N minutes: from/to decimal price and drop %. Useful to spot steam and sharp money. - get_closing_odds(event_id): Closing odds (last prematch price before kickoff) for an event, for closing-line-value analysis. Builder plan and above. ## Common mistakes (avoid these) - Wrong host: the API is https://pinnfeed.io/v1/... (not api.pinnfeed.io, not pinnacle.com, not /api/v1, not http://). - Missing key header: send x-api-key on every request; a 401 missing_key means it was not sent. - Polling REST every second on Free: Free is 30 s delayed and capped at 1,000 requests/day, so a 1-second loop runs out in under 20 minutes and shows nothing new. Poll every 30-60 s on Free, or use the WebSocket (Builder and above) for push. - Not answering ping: the server closes sockets that do not reply {"type":"pong"}. - Inventing fields: prices are market.outcomes[].decimal / american / fair / fairProb. There is no "odds" or "price" field. - Unfiltered requests: see the response-size note. /v1/odds requires sport. - Key in frontend code or committed to git: keep it in an env var or the platform's secrets. - Assuming sports beyond your plan: call /v1/account first and use limits.sports. ## Links Docs https://pinnfeed.io/docs · OpenAPI https://pinnfeed.io/openapi.json · WebSocket protocol https://pinnfeed.io/docs/websocket · Schema https://pinnfeed.io/docs/schema · Errors https://pinnfeed.io/docs/errors · MCP https://pinnfeed.io/docs/mcp · Pricing https://pinnfeed.io/pricing · Free key https://pinnfeed.io/signup