> ## 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 Price History

> Reading the historical price time series for one outcome token, including resolved markets. Includes inputs, outputs, SDK V2 examples, and Deepline cost.

Reading the historical price time series for one outcome token, including resolved markets.

<Info>
  Tool ID: `polymarket_get_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_price_history',
  {
    "market": "example"
  },
);

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

### CLI

```bash theme={null}
deepline tools execute polymarket_get_price_history --input '{
  "market": "example"
}' --json
```

## Example response

The SDK exposes this shape at `result.toolResponse.raw`. Values below are representative.

```json theme={null}
{
  "data": {
    "history": [
      {
        "t": 123,
        "p": 123
      }
    ]
  }
}
```

Use `deepline tools get polymarket_get_price_history --json` for the latest machine-readable contract.

## Input reference

Retrieve historical price data for a market.

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `payload.market` | `string` | Yes | — | The market (asset id) to query. |
| `payload.startTs` | `number` | No | — | Filter by items after this unix timestamp. Format: `double`. |
| `payload.endTs` | `number` | No | — | Filter by items before this unix timestamp. 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 a market.",
    "properties": {
      "market": {
        "type": "string",
        "description": "The market (asset id) to query."
      },
      "startTs": {
        "type": "number",
        "description": "Filter by items after this unix timestamp.",
        "format": "double"
      },
      "endTs": {
        "type": "number",
        "description": "Filter by items before this unix timestamp.",
        "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": [
      "market"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Output reference

Standard tool result payload.

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `result.data` | `object` | Yes | — | Provider response payload. |
| `result.data.history` | `array` | No | — | — |
| `result.data.history[].t` | `integer` | No | — | Format: `uint32`. |
| `result.data.history[].p` | `number` | No | — | Format: `float`. |
| `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": "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.