{
  "openapi": "3.1.0",
  "info": {
    "title": "Sports odds data API",
    "version": "1.0.0",
    "summary": "bet365 pre-match and live odds, graded results, a bet-slip calculator, live stream, match tracker and VAR signals.",
    "description": "Sports betting data of a major European bookmaker for football, basketball, ice hockey and tennis: pre-match and live odds with about 400 markets per top football match, results with every market already graded (WON / LOST / VOID / HALF_WIN / HALF_LOSS), a bet-slip calculator, a Server-Sent Events stream of live changes, a football match tracker and VAR / dangerous-moment signals. Every request carries an API key in the X-API-Key header. Sign up for a key (3 days of Pro free). AI agents can also connect over MCP at /api/data/mcp."
  },
  "servers": [{ "url": "/api/data/v1" }],
  "security": [{ "apiKey": [] }],
  "tags": [
    { "name": "Matches" }, { "name": "Results" }, { "name": "Live" }, { "name": "Account" }
  ],
  "paths": {
    "/me": {
      "get": { "tags": ["Account"], "operationId": "getMe", "summary": "Your plan, limits and today's requests", "x-plan": "all",
        "responses": { "200": { "description": "The caller's plan", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Me" } } } }, "401": { "$ref": "#/components/responses/Error" }, "402": { "$ref": "#/components/responses/Error" } } }
    },
    "/sports": {
      "get": { "tags": ["Matches"], "operationId": "listSports", "summary": "Sports offered", "x-plan": "Start",
        "responses": { "200": { "description": "Sports", "content": { "application/json": { "schema": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "examples": ["football"] } } } } } } } } }
    },
    "/events": {
      "get": { "tags": ["Matches"], "operationId": "listEvents", "summary": "Matches", "description": "Without status: everything on sale (pre-match not started, plus live).", "x-plan": "Start",
        "parameters": [
          { "name": "sport", "in": "query", "schema": { "type": "string", "examples": ["football"] } },
          { "name": "status", "in": "query", "schema": { "type": "string", "enum": ["prematch", "live", "finished", "cancelled"] } },
          { "name": "league", "in": "query", "description": "Exact league name", "schema": { "type": "string", "examples": ["England - Premier League"] } },
          { "name": "from", "in": "query", "description": "Kick-off from (ISO 8601, UTC)", "schema": { "type": "string", "format": "date-time" } },
          { "name": "to", "in": "query", "description": "Kick-off to (ISO 8601, UTC)", "schema": { "type": "string", "format": "date-time" } },
          { "name": "limit", "in": "query", "schema": { "type": "integer", "minimum": 1, "maximum": 500, "default": 200 } },
          { "name": "offset", "in": "query", "schema": { "type": "integer", "minimum": 0, "default": 0 } }
        ],
        "responses": { "200": { "description": "A page of matches", "content": { "application/json": { "schema": { "type": "object", "properties": { "total": { "type": "integer" }, "limit": { "type": "integer" }, "offset": { "type": "integer" }, "events": { "type": "array", "items": { "$ref": "#/components/schemas/Event" } } } } } } }, "401": { "$ref": "#/components/responses/Error" }, "402": { "$ref": "#/components/responses/Error" }, "429": { "$ref": "#/components/responses/Error" } } }
    },
    "/events/{id}": {
      "get": { "tags": ["Matches"], "operationId": "getEvent", "summary": "A match with every market", "description": "A selection's status \"open\" is on sale, \"locked\" is suspended by the source for now. The match's \"open\" says whether bets can be taken right now (fresh prices, no dangerous moment).", "x-plan": "Start",
        "parameters": [ { "$ref": "#/components/parameters/Id" }, { "name": "margin", "in": "query", "description": "Your margin in %, 0–30 (default 0 = the source's prices)", "schema": { "type": "number", "minimum": 0, "maximum": 30 } } ],
        "responses": { "200": { "description": "The match", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/EventDetail" } } } }, "404": { "$ref": "#/components/responses/Error" } } }
    },
    "/events/{id}/result": {
      "get": { "tags": ["Results"], "operationId": "getResult", "summary": "The result with every market graded", "x-plan": "Start",
        "parameters": [ { "$ref": "#/components/parameters/Id" } ],
        "responses": { "200": { "description": "Score, stats and the result of every selection", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Result" } } } }, "404": { "$ref": "#/components/responses/Error" } } }
    },
    "/settle": {
      "post": { "tags": ["Results"], "operationId": "settleSlip", "summary": "Bet-slip calculator", "description": "single = each leg a bet of the full stake; multiple = odds multiplied, one lost leg loses; system = k of n, the stake split over the combinations. PENDING while a leg is not decided.", "x-plan": "Start",
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Slip" } } } },
        "responses": { "201": { "description": "The settled slip", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SlipResult" } } } }, "400": { "$ref": "#/components/responses/Error" } } }
    },
    "/stream": {
      "get": { "tags": ["Live"], "operationId": "liveStream", "summary": "Server-Sent Events of live matches", "description": "Messages: odds (new prices), score (score, minute, corners, cards), suspend (lines closed / reopened), resync (re-read your data), ping (every 25 s). The key may come as ?key= (EventSource cannot send headers).", "x-plan": "Pro",
        "parameters": [ { "name": "events", "in": "query", "description": "Only these match ids (comma-separated, ≤ 100); none = every live match", "schema": { "type": "string" } }, { "name": "margin", "in": "query", "schema": { "type": "number", "minimum": 0, "maximum": 30 } } ],
        "responses": { "200": { "description": "text/event-stream", "content": { "text/event-stream": { "schema": { "type": "string" } } } }, "403": { "$ref": "#/components/responses/Error" } } }
    },
    "/events/{id}/tracker": {
      "get": { "tags": ["Live"], "operationId": "getTracker", "summary": "A football match's live tracker", "description": "Ball position, attacks, events, stats, line-ups. { \"live\": false } when the match is not in play or has no tracker.", "x-plan": "Max",
        "parameters": [ { "$ref": "#/components/parameters/Id" } ],
        "responses": { "200": { "description": "Tracker", "content": { "application/json": { "schema": { "type": "object", "properties": { "live": { "type": "boolean" } }, "additionalProperties": true } } } } } }
    },
    "/events/{id}/var": {
      "get": { "tags": ["Live"], "operationId": "getVar", "summary": "VAR checks and dangerous moments", "description": "A check in progress, the check log, decisions (goal_cancelled, goal_confirmed, pen_confirmed, pen_cancelled, card_upgrade) and dangerHold — a dangerous moment during which betting should be closed.", "x-plan": "Max",
        "parameters": [ { "$ref": "#/components/parameters/Id" } ],
        "responses": { "200": { "description": "VAR", "content": { "application/json": { "schema": { "type": "object", "properties": { "checkActive": { "type": ["string", "null"] }, "checks": { "type": "array", "items": { "type": "object" } }, "decisions": { "type": "array", "items": { "type": "object" } }, "dangerHold": { "type": "boolean" } } } } } } } }
    }
  },
  "components": {
    "securitySchemes": { "apiKey": { "type": "apiKey", "in": "header", "name": "X-API-Key" } },
    "parameters": { "Id": { "name": "id", "in": "path", "required": true, "description": "Match id from /events", "schema": { "type": "string", "format": "uuid" } } },
    "responses": { "Error": { "description": "401 bad key · 402 no paid plan / trial ended · 403 not in your plan · 404 not found · 429 over the requests-a-minute limit", "content": { "application/json": { "schema": { "type": "object", "properties": { "statusCode": { "type": "integer" }, "message": { "type": "string" } } } } } } },
    "schemas": {
      "Me": { "type": "object", "properties": { "email": { "type": "string" }, "plan": { "type": "string" }, "paidUntil": { "type": "string", "format": "date-time" }, "limits": { "type": "object", "properties": { "perMinute": { "type": "integer" }, "streams": { "type": "integer" }, "features": { "type": "array", "items": { "type": "string" } } } } } },
      "Score": { "type": "object", "properties": { "home": { "type": ["integer", "null"] }, "away": { "type": ["integer", "null"] } } },
      "Event": { "type": "object", "properties": { "id": { "type": "string" }, "sport": { "type": "string" }, "league": { "type": "string" }, "home": { "type": "string" }, "away": { "type": "string" }, "startTime": { "type": "string", "format": "date-time" }, "status": { "type": "string", "enum": ["prematch", "live", "finished", "cancelled"] }, "score": { "$ref": "#/components/schemas/Score" }, "minute": { "type": ["integer", "null"] } } },
      "Selection": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string", "examples": ["1", "X", "Over 2.5"] }, "odds": { "type": "string", "examples": ["1.52"] }, "status": { "type": "string", "enum": ["open", "locked"] } } },
      "Market": { "type": "object", "properties": { "key": { "type": "string", "description": "Stable market key, the same for every match: 1x2, dc, dnb, btts, ou_<line>, eh_<line>, cs, htft, ht_<key>, h2_<key>, tg1_ou_<line>, tg2_ou_<line>, cor_ou_<line>, cor3_<n>, card_ou_<line>, ng_<n>, gs_any, gs_first, gs_last, lgl_<score>_<line> …", "examples": ["1x2", "ou_2.5"] }, "name": { "type": "string" }, "selections": { "type": "array", "items": { "$ref": "#/components/schemas/Selection" } } } },
      "EventDetail": { "allOf": [ { "$ref": "#/components/schemas/Event" }, { "type": "object", "properties": { "open": { "type": "boolean" }, "margin": { "type": "number" }, "live": { "type": "object", "description": "Live counts: corners, yellow, red per team" }, "markets": { "type": "array", "items": { "$ref": "#/components/schemas/Market" } } } } ] },
      "Result": { "type": "object", "properties": { "status": { "type": "string" }, "settled": { "type": "boolean" }, "score": { "$ref": "#/components/schemas/Score" }, "stats": { "type": "object", "description": "halfTime, corners, cards, extra time, penalties, goals with minute / team / scorer / method" }, "markets": { "type": "array", "items": { "type": "object", "properties": { "key": { "type": "string" }, "name": { "type": "string" }, "selections": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "result": { "$ref": "#/components/schemas/Outcome" } } } } } } } } },
      "Outcome": { "type": "string", "enum": ["WON", "LOST", "VOID", "HALF_WIN", "HALF_LOSS", "PENDING"] },
      "Slip": { "type": "object", "required": ["type", "stake", "legs"], "properties": { "type": { "type": "string", "enum": ["single", "multiple", "system"] }, "stake": { "type": "number", "exclusiveMinimum": 0 }, "k": { "type": "integer", "description": "System only: legs per combination" }, "legs": { "type": "array", "maxItems": 30, "items": { "type": "object", "required": ["eventId", "market", "selection", "odds"], "properties": { "eventId": { "type": "string" }, "market": { "type": "string" }, "selection": { "type": "string" }, "odds": { "type": "number", "minimum": 1 } } } } } },
      "SlipResult": { "type": "object", "properties": { "status": { "$ref": "#/components/schemas/Outcome" }, "payout": { "type": ["string", "null"], "examples": ["288.80"] }, "legs": { "type": "array", "items": { "type": "object", "properties": { "eventId": { "type": "string" }, "market": { "type": "string" }, "selection": { "type": "string" }, "odds": { "type": "number" }, "result": { "$ref": "#/components/schemas/Outcome" } } } } } }
    }
  }
}
