{
 "openapi": "3.0.3",
 "info": {
  "title": "PinnRadar REST API",
  "version": "1.0.0",
  "description": "HTTP endpoints for Pinnacle prices tracked by PinnRadar: in-play and pre-game boards per sport, single-event lookups with every alternate line (quarter handicaps too), optional props and futures rows, and a rolling buffer of recent price falls you can filter. Push delivery (two SSE alert streams, /odds-drop and /odds-drop-prematch, and the wss /ws/feed socket) has no OpenAPI form, so it is described in the guide at https://pinnradar.com/docs. Get a free test key on https://pinnradar.com with an email address; a Pinnacle login is not needed.",
  "contact": {
   "name": "PinnRadar",
   "url": "https://pinnradar.com",
   "email": "info@pinnradar.com"
  },
  "license": {
   "name": "Terms of service",
   "url": "https://pinnradar.com/terms"
  }
 },
 "servers": [
  {
   "url": "https://pinnradar.com"
  }
 ],
 "security": [
  {
   "ApiKeyHeader": []
  }
 ],
 "components": {
  "securitySchemes": {
   "ApiKeyHeader": {
    "type": "apiKey",
    "in": "header",
    "name": "x-api-key",
    "description": "Key issued in your PinnRadar panel. The same key signs you in to the panel."
   }
  }
 },
 "paths": {
  "/kit/v1/markets": {
   "get": {
    "summary": "Board of one sport, in-play or pre-game",
    "operationId": "getMarkets",
    "description": "Returns every event and market PinnRadar holds for the chosen sport. Sport ids: 1 Soccer, 2 Tennis, 3 Basketball, 4 Hockey, 5 Football, 6 Baseball, 7 Rugby, 8 MMA, 9 Boxing, 10 Other (volleyball and handball together), 11 Esports, 12 Golf, 13 Cricket, 14 Volleyball, 15 Handball. 14 and 15 are subsets of 10, so asking for all three gives you the same events twice.",
    "parameters": [
     {
      "name": "sport_id",
      "in": "query",
      "description": "Numeric sport id from the list above",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "example": 1
     },
     {
      "name": "event_type",
      "in": "query",
      "description": "Which board to read: live (the default) or prematch",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "live",
        "prematch"
       ]
      },
      "example": "live"
     },
     {
      "name": "since",
      "in": "query",
      "description": "Incremental cursor: send back the `last` number from your previous call to receive only what changed",
      "required": false,
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "include_specials",
      "in": "query",
      "description": "Set to 1 to add props, correct-score and outright markets as additional event rows, or nested to attach them under their parent event. Boards get much larger (a soccer prematch board goes from roughly 1.5k to 12k rows)",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "1",
        "nested"
       ]
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Object with sport_id, sport_name, a `last` cursor and the events array",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "The x-api-key header is absent or not recognised"
     },
     "429": {
      "description": "Too many requests for your plan; the body says how long to wait (retry_after_ms)"
     }
    }
   }
  },
  "/kit/v1/details": {
   "get": {
    "summary": "One in-play event",
    "operationId": "getDetails",
    "parameters": [
     {
      "name": "event_id",
      "in": "query",
      "description": "Id of an event taken from a board",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "An events array holding the requested event",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "The x-api-key header is absent or not recognised"
     },
     "429": {
      "description": "Too many requests for your plan; the body says how long to wait (retry_after_ms)"
     }
    }
   }
  },
  "/kit/v1/prematch/fixtures": {
   "get": {
    "summary": "Pre-game fixture list of one sport",
    "operationId": "getPrematchFixtures",
    "parameters": [
     {
      "name": "sport_id",
      "in": "query",
      "description": "Numeric sport id (same ids as the board endpoint)",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "example": 1
     },
     {
      "name": "since",
      "in": "query",
      "description": "Incremental cursor from the previous response",
      "required": false,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Fixtures, each with its markets",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "The x-api-key header is absent or not recognised"
     },
     "429": {
      "description": "Too many requests for your plan; the body says how long to wait (retry_after_ms)"
     }
    }
   }
  },
  "/kit/v1/prematch/markets": {
   "get": {
    "summary": "Every market of one pre-game event",
    "operationId": "getPrematchMarkets",
    "parameters": [
     {
      "name": "event_id",
      "in": "query",
      "description": "Id of a pre-game event",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The event's markets",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "The x-api-key header is absent or not recognised"
     },
     "429": {
      "description": "Too many requests for your plan; the body says how long to wait (retry_after_ms)"
     }
    }
   }
  },
  "/kit/v1/prematch/lines": {
   "get": {
    "summary": "Condensed prices of one pre-game event",
    "operationId": "getPrematchLines",
    "parameters": [
     {
      "name": "event_id",
      "in": "query",
      "description": "Id of a pre-game event",
      "required": true,
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "market_type",
      "in": "query",
      "description": "Restrict to one market kind: money_line, spreads, totals or team_total",
      "required": false,
      "schema": {
       "type": "string",
       "enum": ["money_line", "spreads", "totals", "team_total"]
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Lines in a short, flat form",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "The x-api-key header is absent or not recognised"
     },
     "429": {
      "description": "Too many requests for your plan; the body says how long to wait (retry_after_ms)"
     }
    }
   }
  },
  "/api/drops": {
   "get": {
    "summary": "Search recent price falls",
    "operationId": "getDrops",
    "description": "Polling access to the buffer of recently shortened prices. Always pass max_age_sec: a request without it returns no rows. If you want falls delivered as they happen, subscribe to an SSE stream instead (see /docs).",
    "parameters": [
     {
      "name": "mode",
      "in": "query",
      "description": "Buffer to search: live (the default) or prematch",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "live",
        "prematch"
       ]
      },
      "example": "live"
     },
     {
      "name": "max_age_sec",
      "in": "query",
      "description": "Look-back window in seconds; rows older than this are skipped. Send it on every call.",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "example": 3600
     },
     {
      "name": "min_drop_pct",
      "in": "query",
      "description": "Smallest fall to include, in percent",
      "required": false,
      "schema": {
       "type": "number"
      },
      "example": 5
     },
     {
      "name": "sport_id",
      "in": "query",
      "description": "Restrict to a single sport id",
      "required": false,
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "limit",
      "in": "query",
      "description": "Upper bound on returned rows",
      "required": false,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Object with total, a drops array and meta; each row names the market, the selection, the old and new price and the percent change (drop_pct)",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "The x-api-key header is absent or not recognised"
     },
     "429": {
      "description": "Too many requests for your plan; the body says how long to wait (retry_after_ms)"
     }
    }
   }
  },
  "/health": {
   "get": {
    "summary": "Feed and service state",
    "operationId": "getHealth",
    "responses": {
     "200": {
      "description": "How many events are held, where the feed comes from and how many SSE clients are connected",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "The x-api-key header is absent or not recognised"
     },
     "429": {
      "description": "Too many requests for your plan; the body says how long to wait (retry_after_ms)"
     }
    }
   }
  },
  "/ping": {
   "get": {
    "summary": "Up check, no key needed",
    "operationId": "getPing",
    "security": [],
    "responses": {
     "200": {
      "description": "The text \"ok\" (text/plain)"
     }
    }
   }
  }
 }
}
