# Nansen Polymarket OHLCV Candles

> Nansen Polymarket OHLCV Candles is a paid API for AI agents from Nansen at api.nansen.ai, paid per call via MPP, $0.01/call, status unknown (last checked 2026-10-12).

Returns 1-hour OHLCV (Open, High, Low, Close, Volume) price candles for a Polymarket prediction market outcome, derived from on-chain OrderFilled events on Polygon.

## Facts

- Endpoint: POST https://api.nansen.ai/api/v1/prediction-market/ohlcv?utm_source=zero.xyz
- Price: $0.01/call
- Payment: MPP
- Status: unknown
- Last checked: 2026-10-12
- Activations on Zero: 0
- Provider: Nansen
- Docs: https://docs.nansen.ai
- Website: https://nansen.ai
- Tags: blockchain, smart-money, wallet, tokens, defi, analytics, profiler, dex, pnl, onchain, prediction-market, data
- Canonical page: https://www.zero.xyz/c/nansen-ohlcv-45c08244
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_tosod9p9szImppFUvAY0E

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability nansen-ohlcv-45c08244 -d '<json body>'
```

Example prompt: Pull the hourly OHLCV candles for Polymarket market ID 654412 from January 1, 2025 to January 31, 2025, sorted by period start descending, so I can chart the price and volume history.

## When to prefer this

Use this endpoint when you need granular hourly price history, volume trends, or candlestick chart data for a specific Polymarket prediction market outcome. Prefer this over snapshot or screener endpoints when time-series price analysis is required rather than a current-state summary.

## Known failure modes

- Missing required market_id returns a 422 validation error
- Invalid date format (non-ISO 8601) causes a 422 validation error
- market_id not found or with no trading history returns an empty data array
- Pagination page out of range returns empty results
- is_last_page flag can be used to detect end of data; missing pagination handling may cause infinite loops

## How this service works

Get 1-hour OHLCV (Open, High, Low, Close, Volume) candles for a Polymarket
prediction market. Candles are computed from on-chain OrderFilled events on Polygon.

**What it helps to answer:**

1. **What is the price history of a prediction market outcome?**
2. **How has trading volume changed over time?**
3. **What were the high and low prices in each time period?**

## Output

A paginated list of hourly OHLCV candle records, each containing open, high, low, close prices, USD volume, trade count, unique traders, outcome side label (Yes/No), token ID, outcome index, and the ISO-format period start timestamp for that candle.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "title": "OhlcvRequest",
 "required": [
  "market_id"
 ],
 "properties": {
  "date": {
   "anyOf": [
    {
     "type": "object",
     "title": "DateRange",
     "properties": {
      "to": {
       "anyOf": [
        {
         "type": "string"
        }
       ],
       "title": "To",
       "examples": [
        "2025-01-31T23:59:59Z"
       ],
       "description": "End date in ISO 8601 format (e.g., 2025-01-31T23:59:59Z or 2025-01-31)"
      },
      "from": {
       "anyOf": [
        {
         "type": "string"
        }
       ],
       "title": "From",
       "examples": [
        "2025-01-01T00:00:00Z"
       ],
       "description": "Start date in ISO 8601 format (e.g., 2025-01-01T00:00:00Z or 2025-01-01)"
      }
     },
     "description": "Date range model matching the API schema."
    }
   ],
   "examples": [
    {
     "to": "2024-12-31T23:59:59Z",
     "from": "2024-01-01T00:00:00Z"
    }
   ],
   "description": "Date range filter (ISO 8601 date-time)"
  },
  "sort": {
   "anyOf": [
    {
     "type": "array",
     "items": {
      "type": "object",
      "title": "OhlcvSortOrder",
      "required": [
       "field",
       "direction"
      ],
      "properties": {
       "field": {
        "enum": [
         "period_start",
         "volume_usd",
         "trade_count"
        ],
        "type": "string",
        "title": "OhlcvSortField",
        "description": "Sortable fields for OHLCV endpoint."
       },
       "direction": {
        "enum": [
         "ASC",
         "DESC"
        ],
        "type": "string",
        "title": "SortDirection",
        "description": "Enum for sort directions."
       }
      }
     }
    }
   ],
   "title": "Sort",
   "deprecated": true,
   "description": "Deprecated: use 'order_by' instead."
  },
  "order_by": {
   "anyOf": [
    {
     "type": "array",
     "items": {
      "type": "object",
      "title": "OhlcvSortOrder",
      "required": [
       "field",
       "direction"
      ],
      "properties": {
       "field": {
        "enum": [
         "period_start",
         "volume_usd",
         "trade_count"
        ],
        "type": "string",
        "title": "OhlcvSortField",
        "description": "Sortable fields for OHLCV endpoint."
       },
       "direction": {
        "enum": [
         "ASC",
         "DESC"
        ],
        "type": "string",
        "title": "SortDirection",
        "description": "Enum for sort directions."
       }
      }
     }
    }
 
… (truncated)
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "title": "OhlcvResponse",
 "required": [
  "data"
 ],
 "properties": {
  "data": {
   "type": "array",
   "items": {
    "type": "object",
    "title": "OhlcvCandle",
    "required": [
     "market_id"
    ],
    "properties": {
     "low": {
      "anyOf": [
       {
        "type": "number"
       }
      ],
      "title": "Low",
      "examples": [
       0.48
      ],
      "description": "Low price"
     },
     "high": {
      "anyOf": [
       {
        "type": "number"
       }
      ],
      "title": "High",
      "examples": [
       0.55
      ],
      "description": "High price"
     },
     "open": {
      "anyOf": [
       {
        "type": "number"
       }
      ],
      "title": "Open",
      "examples": [
       0.5
      ],
      "description": "Open price"
     },
     "side": {
      "anyOf": [
       {
        "type": "string"
       }
      ],
      "title": "Side",
      "examples": [
       "Yes"
      ],
      "description": "Side label (Yes/No)"
     },
     "close": {
      "anyOf": [
       {
        "type": "number"
       }
      ],
      "title": "Close",
      "examples": [
       0.53
      ],
      "description": "Close price"
     },
     "token_id": {
      "anyOf": [
       {
        "type": "string"
       }
      ],
      "title": "Token Id",
      "examples": [
       "71321045679252212"
      ],
      "description": "CLOB token ID"
     },
     "market_id": {
      "type": "string",
      "title": "Market Id",
      "examples": [
       "654412"
      ],
      "description": "Market ID"
     },
     "volume_usd": {
      "anyOf": [
       {
        "type": "number"
       }
      ],
      "title": "Volume Usd",
      "examples": [
       12500
      ],
      "description": "Volume in USD"
     },
     "trade_count": {
      "anyOf": [
       {
        "type": "integer"
       }
      ],
      "title": "Trade Count",
      "examples": [
       150
      ],
      "description": "Number of trades"
     },
     "period_start": {
      "anyOf": [
       {
        "type": "string",
        "format": "date-time"
       }
      ],
      "title": "Period Start",
      "examples": [
       "2024-11-01T00:00:00"
      ],
      "description": "Candle period start (ISO format)"
     },
     "outcome_index": {
      "anyOf": [
       {
        "type": "integer"
       }
      ],
      "title": "Outcome Index",
      "examples": [
       1
      ],
      "description": "Outcome index (1/2)"
     },
     "uni
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/nansen-ohlcv-45c08244/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.nansen.ai](https://www.zero.xyz/host/api.nansen.ai/llms.txt)
