# Nansen Prediction Market OHLCV Candles

> Nansen Prediction Market OHLCV Candles is a paid API for AI agents from api.nansen.ai, paid per call via x402, $0.01/call, status unknown (last checked 2026-09-14).

Retrieves OHLCV (open, high, low, close, volume) candlestick price data for prediction market contracts

## Facts

- Endpoint: GET https://api.nansen.ai/api/v1/prediction-market/ohlcv
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/api-nansen-ai-109e4695
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_-lLdClTrNTUON_MdTOfyY

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 api-nansen-ai-109e4695
```

Example prompt: Pull the OHLCV candlestick data for the Polymarket contract at address 0xabc123 on daily intervals for the past 30 days so I can see how the price and volume moved over time.

## When to prefer this

Choose this endpoint when you need structured candlestick (OHLCV) price and volume history for prediction market contracts, especially Polymarket positions, and want Nansen's on-chain smart money analytics context rather than raw DEX data. Ideal for charting, backtesting, or analyzing market sentiment over time.

## Known failure modes

- Invalid or unrecognized market contract address returns 404 or empty result
- Unsupported time interval parameter returns validation error
- Date range too large may result in timeout or rate limit error
- Market not indexed by Nansen returns empty dataset
- Malformed POST body returns 400 bad request

## How this service works

Get Prediction Market OHLCV Candles

## Output

Returns an array of OHLCV candlestick records for the specified prediction market, each containing open, high, low, close prices and trading volume over the requested time intervals, enabling chart rendering and price trend analysis.

## 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": "SortOrder[OhlcvSortField]",
      "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",
   "description": "Deprecated: use 'order_by' instead."
  },
  "order_by": {
   "anyOf": [
    {
     "type": "array",
     "items": {
      "type": "object",
      "title": "SortOrder[OhlcvSortField]",
      "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/api-nansen-ai-109e4695/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)
