# Polymarket — Get Klines

Get Polymarket Perps Candles data via REST or OpenAny MCP—with pay-per-use pricing and no subscription. Powered by Polymarket, pass parameters such as end_timestamp, instrument_id, interval, and retrieve structured data including structured JSON records, identifiers, and response metadata for historical charts, and windowed collection, ready for production pipelines and AI agent automation.

Documentation: https://openany.si/polymarket/polymarket-get-klines/86a5d9e2-94a9-4593-afdc-cfb8c8360a28/
API ID: 86a5d9e2-94a9-4593-afdc-cfb8c8360a28
Provider: Polymarket
Contract revision: 4
Method: GET
Endpoint: https://api.openany.si/v1/agent-apis/polymarket/v1/info/klines
Page update time: 2026-12-03T02:49:31.149Z
Access: OpenAny REST
OpenAny MCP: availability is not supplied by this REST contract. Check get_api on the configured OpenAny MCP server before execution.
Request content type: none
Execution mode: sync
Authentication: Authorization: Bearer $OPENANY_API_KEY

## Billing
Price: $0 / call
The published contract currently has no usage charge. Authentication and service limits still apply.
Price source: OpenAny public API contract.
Contract update time: 2026-12-03T02:49:30.712Z. This is not a price-change timestamp.
```json
{
  "currency": "USD",
  "mode": "fixed",
  "priceMicroUsd": "0",
  "rounding": null,
  "unit": "call",
  "unitQuantity": null
}
```

## Usage and limits
## Polymarket Perps Candles API

instrument\_id, interval and start\_timestamp are required. end\_timestamp is optional, and both timestamps use milliseconds. The response data array can be empty and more reports further source data. The interval uses the documented literal choices, from 1s through 1w.

## What You Can Build

- **Historical charts**: Display available candle records for the selected instrument.
- **Windowed collection**: Retain interval and millisecond bounds with each result.

## Documented Response Fields

| Field | Meaning |
| --- | --- |
| `data` | Candle records; the array can be empty |
| `more` | Whether further source data is reported |

## Request parameters
```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Polymarket — Get Klines request inputs",
  "$comment": "Declared input types grouped by HTTP location. Path, query and header values describe decoded inputs and are serialized as text on the wire; body is the payload. This is not an exhaustive provider contract or a schema for the raw HTTP request.",
  "type": "object",
  "properties": {
    "path": {
      "type": "object",
      "properties": {}
    },
    "query": {
      "type": "object",
      "properties": {
        "instrument_id": {
          "type": "integer",
          "description": "Instrument ID",
          "minimum": 0,
          "maximum": 4294967295
        },
        "interval": {
          "type": "string",
          "description": "Kline interval",
          "enum": [
            "1s",
            "1m",
            "5m",
            "15m",
            "30m",
            "1h",
            "4h",
            "6h",
            "12h",
            "1d",
            "1w"
          ]
        },
        "start_timestamp": {
          "type": "integer",
          "description": "Start timestamp in milliseconds"
        },
        "end_timestamp": {
          "type": "integer",
          "description": "End timestamp in milliseconds"
        }
      },
      "required": [
        "instrument_id",
        "interval",
        "start_timestamp"
      ]
    },
    "headers": {
      "type": "object",
      "properties": {}
    }
  },
  "required": [
    "path",
    "query",
    "headers"
  ]
}
```

## Response fields
Source: Inferred from examples; not an exhaustive provider schema.
```json
{
  "type": "object",
  "properties": {
    "data": {
      "type": "array",
      "items": {}
    },
    "more": {
      "type": "boolean"
    }
  }
}
```

## Request example
Scenario: Documentation example
```bash
curl \
  'https://api.openany.si/v1/agent-apis/polymarket/v1/info/klines?end_timestamp=1793282423000&instrument_id=0&interval=1h&start_timestamp=1793278823000' \
  -X GET \
  -H "Authorization: Bearer $OPENANY_API_KEY" \
  -H 'Content-Type: application/json'
```

## Response example
Published documentation example. Verify the actual response after an approved call.
Sample response · Documented HTTP 200
```json
{
  "data": [],
  "more": false
}
```

## Error handling
400: Check the request fields.
401 / 403: Verify credentials and access permissions.
402: Inspect payment requirements and balance.
429: Respect returned retry guidance.
5xx: Inspect the error and usage record before retrying a paid operation.

## Common questions
### Which interval values are accepted?
Use 1s, 1m, 5m, 15m, 30m, 1h, 4h, 6h, 12h, 1d or 1w with exact spelling.

### Is start_timestamp optional?
No. This implementation requires start_timestamp together with instrument_id and interval, even if an upstream SDK offers a default lookback. Time bounds are in milliseconds.

### Can I send a cursor or limit?
This implementation exposes the instrument, interval and timestamp bounds. It has no cursor or limit input; inspect more when managing time-scoped reads.

### What does an empty data array mean?
It contains no returned observations. Preserve an empty-series state rather than constructing zero-price records.

### Which API key should I use?
Use your OpenAny API key as Bearer authentication on the documented OpenAny route.

### Where can I check the current request price?
Check the pricing area for the selected implementation. Follow its billing unit and any request-dependent rules before sending the request.

## Available implementations
- Polymarket: https://openany.si/polymarket/polymarket-get-klines/86a5d9e2-94a9-4593-afdc-cfb8c8360a28/

Integration guide: https://openany.si/docs/
Agent setup: https://openany.si/SKILL.md
