Get Polymarket historical prices

Query price history for both outcome tokens at a chosen fidelity.

GET /markets/{id}/history

Request both sides of a market and choose the sampling interval in minutes. An empty upstream history is reported as empty; it is not interpolated or filled with invented prices.

Authentication

Send your key in the X-API-Key header. Keep the key out of URLs and shared logs.

Parameters

NameLocationTypeRequiredDetails
idpathstringYes minLength: 1. maxLength: 160. pattern: ^[A-Za-z0-9_.-]+$.
fidelityqueryintegerNo Default: 60. minimum: 1. maximum: 10080.

Example request

curl --fail-with-body -X GET \
  "https://polymarket.omray.dev/markets/YOUR_WALLET_OR_MARKET_ID/history" \
  -H "X-API-Key: $PM_API_KEY"

Responses

StatusMeaning
200Successful Response
422Validation Error

Authenticated requests can return 401 for an invalid key or 429 when a plan limit is reached. Upstream failures may return a server error; do not treat an error as an empty dataset.

OpenAPI operation schema
{
  "tags": [
    "Markets"
  ],
  "summary": "Polymarket historical prices for both outcomes",
  "description": "Return each outcome token's price series at the requested minute fidelity, with source coverage.",
  "operationId": "market_history",
  "security": [
    {
      "APIKeyHeader": []
    }
  ],
  "parameters": [
    {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string",
        "minLength": 1,
        "maxLength": 160,
        "pattern": "^[A-Za-z0-9_.-]+$",
        "title": "Id"
      }
    },
    {
      "name": "fidelity",
      "in": "query",
      "required": false,
      "schema": {
        "type": "integer",
        "maximum": 10080,
        "minimum": 1,
        "default": 60,
        "title": "Fidelity"
      }
    }
  ],
  "responses": {
    "200": {
      "description": "Successful Response",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/MarketHistory"
          }
        }
      }
    },
    "422": {
      "description": "Validation Error",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/HTTPValidationError"
          }
        }
      }
    }
  }
}