> ## Documentation Index
> Fetch the complete documentation index at: https://deepline.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Polymarket: Get Batch Price History

> Reading historical price time series for up to 20 outcome tokens in one call. Includes SDK V2 examples, input constraints, response fields, and Deepline cost.

Reading historical price time series for up to 20 outcome tokens in one call.

<Info>
  Tool ID: `polymarket_get_batch_price_history`
</Info>

## Run this action

Use the TypeScript SDK for a single call. Put `ctx.tools.execute(...)` inside a Play when the call should be durable, scheduled, or run across a CSV.

```ts theme={null}
import { Deepline } from 'deepline';

const deepline = await Deepline.connect();
const result = await deepline.tools.execute(
  'polymarket_get_batch_price_history',
  {
    "markets": [
      "example"
    ]
  },
);

console.log(result.toolResponse.raw);
```

### CLI

```bash theme={null}
deepline tools execute polymarket_get_batch_price_history --input '{
  "markets": [
    "example"
  ]
}' --json
```

## Example response

The static output schema is not detailed enough to generate a reliable example. Use `deepline tools get polymarket_get_batch_price_history --json` for the complete live contract.

## Input reference

Retrieve historical price data for multiple markets in a single request.

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `payload.markets` | `array` | Yes | — | List of market asset ids to query. Maximum 20. Maximum items: 20. |
| `payload.start_ts` | `number` | No | — | Filter by items after this unix timestamp (seconds). Format: `double`. |
| `payload.end_ts` | `number` | No | — | Filter by items before this unix timestamp (seconds). Format: `double`. |
| `payload.interval` | `"max" \| "all" \| "1m" \| "1w" \| "1d" \| "6h" \| "1h"` | No | — | Time interval for data aggregation. Allowed: `max`, `all`, `1m`, `1w`, `1d`, `6h`, `1h`. |
| `payload.fidelity` | `integer` | No | — | Accuracy of the data expressed in minutes. Default is 1 minute. |

<details>
  <summary>Show raw input schema</summary>

  ### Input JSON Schema

  ```json theme={null}
  {
    "type": "object",
    "description": "Retrieve historical price data for multiple markets in a single request.",
    "properties": {
      "markets": {
        "type": "array",
        "description": "List of market asset ids to query. Maximum 20.",
        "maxItems": 20,
        "items": {
          "type": "string"
        }
      },
      "start_ts": {
        "type": "number",
        "description": "Filter by items after this unix timestamp (seconds).",
        "format": "double"
      },
      "end_ts": {
        "type": "number",
        "description": "Filter by items before this unix timestamp (seconds).",
        "format": "double"
      },
      "interval": {
        "type": "string",
        "description": "Time interval for data aggregation.",
        "enum": [
          "max",
          "all",
          "1m",
          "1w",
          "1d",
          "6h",
          "1h"
        ]
      },
      "fidelity": {
        "type": "integer",
        "description": "Accuracy of the data expressed in minutes. Default is 1 minute."
      }
    },
    "required": [
      "markets"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Output reference

Standard tool result payload.

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `result.data` | `object` | Yes | — | Provider response payload. |
| `result.data.history` | `record` | No | — | Map of market asset id to array of price data points. |
| `result.meta` | `object` | No | — | Additional response metadata (status, paging). |

<details>
  <summary>Show raw output schema</summary>

  ### Output JSON Schema

  ```json theme={null}
  {
    "type": "object",
    "description": "Standard tool result payload.",
    "properties": {
      "data": {
        "type": "object",
        "description": "Provider response payload.",
        "properties": {
          "history": {
            "type": "object",
            "description": "Map of market asset id to array of price data points.",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "t": {
                    "type": "integer",
                    "format": "uint32"
                  },
                  "p": {
                    "type": "number",
                    "format": "float"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "additionalProperties": false
      },
      "meta": {
        "type": "object",
        "description": "Additional response metadata (status, paging).",
        "additionalProperties": true
      }
    },
    "required": [
      "data"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Deepline cost

* Pricing model: `fixed` (per call).
* Estimated Deepline credits: `0` per pricing unit.
* Provider-native pricing may still exist outside Deepline credit billing.

## Related documentation

* [Polymarket provider guide](/docs/providers/polymarket/guide)
* [SDK V2 quickstart](/docs/sdk-v2/quickstart)
* [SDK reference](/docs/sdk-v2/sdk-reference)
* [Run tools across a CSV](/docs/sdk-v2/batch-csv)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.