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

# 预测市场概率历史

> 查询单个预测市场 outcome token 的小时或日度隐含概率历史。

<Note icon="sparkles">
  **已暴露为 MCP 工具**：`polymarket_price_history` - 在 Claude / Cursor / 任意 MCP 客户端中直接调用。详见 [MCP Server](/zh-CN/integration/mcp-server) 60 秒配置。
</Note>

<Badge color="green" icon="circle-check">已上线</Badge>
 
<Badge color="gray" size="sm">免费</Badge>

## 它为 Agent 做什么

`polymarket_price_history` 返回某个 outcome 的隐含概率如何随时间变化。Agent 选好 market outcome 后，如果要画时间线、复盘事件、或解释概率变化，就调用它。

传入 `outcome_token_id`，选择 `1h` 或 `1d`，也可以指定 UTC 时间范围。返回值会按时间给出 `time`、`probability` 和 `price`。

## 返回值

<ResponseField name="data" type="PolymarketPriceHistory" required>
  单个 outcome token 的概率历史。

  <Expandable title="PolymarketPriceHistory 字段">
    <ResponseField name="outcome_token_id" type="string" required>
      你请求的 outcome token。
    </ResponseField>

    <ResponseField name="interval" type="string" required>
      `1h` 或 `1d`。
    </ResponseField>

    <ResponseField name="points" type="PolymarketPricePoint[]" required>
      按时间排列的概率点。每个点包含 `time`、`probability` 和 `price`。
    </ResponseField>

    <ResponseField name="coverage_status" type="string" required>
      这个 token 和时间范围的数据可用状态。
    </ResponseField>

    <ResponseField name="coverage_notice" type="string" required>
      简短说明这次查到了哪些数据。
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="data.count" type="number">返回的数据点数量。</ResponseField>

<ResponseField name="meta.creditsUsed" type="number">本次调用固定为 `0`。</ResponseField>
<ResponseField name="meta.remainingCredits" type="number">账户剩余 credit。</ResponseField>

```json title="200 OK · polymarket_price_history" expandable theme={null}
{
  "data": {
    "outcome_token_id": "98787006152320761811798607481686168525551752574583108841982899511109091268658",
    "interval": "1d",
    "points": [
      { "time": "2024-01-01T00:00:00Z", "probability": 0.39, "price": 0.39 },
      { "time": "2024-01-02T00:00:00Z", "probability": 0.42, "price": 0.42 }
    ],
    "coverage_status": "partial",
    "coverage_notice": "Partial probability history is available for the requested window.",
    "count": 2
  },
  "meta": { "creditsUsed": 0, "remainingCredits": 99 }
}
```

## 说明

<Tip>
  先从 [`预测市场事件`](/zh-CN/api/prediction-markets/events) 开始，读取选中的 market，再把返回的某个 `outcome_token_id` 传到这里。
</Tip>

<Tip>
  看长期变化时用 `1d`。如果 agent 需要解释某一天或某条消息附近的变化，再用 `1h`。
</Tip>

<Warning>
  `interval` 只接受 `1h` 和 `1d`。`interval=15m` 这类请求会在扣 credit 前返回 `400`。
</Warning>

<Warning>
  这里返回的是单个 outcome 的隐含概率点。它不是 OHLCV 数据、订单簿、成交历史或投资建议。
</Warning>

## 直接调用

<Accordion title="HTTP / SDK 示例" icon="terminal">
  <CodeGroup>
    ```typescript MCP (Claude / Cursor) theme={null}
    {
      "method": "tools/call",
      "params": {
        "name": "polymarket_price_history",
        "arguments": {
          "outcome_token_id": "98787006152320761811798607481686168525551752574583108841982899511109091268658",
          "interval": "1d",
          "start_time": "2024-01-01T00:00:00Z",
          "end_time": "2024-01-15T00:00:00Z"
        }
      }
    }
    ```

    ```python Python (HTTP) theme={null}
    import os, requests

    resp = requests.get(
        "https://api.llmquantdata.com/api/polymarket/price-history",
        headers={"Authorization": f"Bearer {os.environ['LLMQUANT_API_KEY']}"},
        params={
            "outcome_token_id": "98787006152320761811798607481686168525551752574583108841982899511109091268658",
            "interval": "1d",
            "start_time": "2024-01-01T00:00:00Z",
            "end_time": "2024-01-15T00:00:00Z",
        },
    ).json()
    print(resp["data"]["points"][:2])
    ```

    ```bash cURL theme={null}
    curl "https://api.llmquantdata.com/api/polymarket/price-history?outcome_token_id=98787006152320761811798607481686168525551752574583108841982899511109091268658&interval=1d&start_time=2024-01-01T00%3A00%3A00Z&end_time=2024-01-15T00%3A00%3A00Z" \
      -H "Authorization: Bearer $LLMQUANT_API_KEY"
    ```
  </CodeGroup>
</Accordion>

## 完整参数参考

<Accordion title="polymarket_price_history — 请求参数" icon="chart-line">
  <ParamField query="outcome_token_id" type="string" required>
    `polymarket_market_read` 返回的 outcome token id。
  </ParamField>

  <ParamField query="interval" type="string" required>
    `1h` 或 `1d`。
  </ParamField>

  <ParamField query="start_time" type="string">ISO 8601 UTC 起始时间。必须和 `end_time` 一起使用。</ParamField>
  <ParamField query="end_time" type="string">ISO 8601 UTC 结束时间。必须和 `start_time` 一起使用。</ParamField>
  <ParamField query="limit" type="number">可选的返回数据点上限。范围 `1-20000`。</ParamField>
</Accordion>

## 相关接口

<Columns cols={2}>
  <Card title="预测市场事件" icon="gauge-high" href="/zh-CN/api/prediction-markets/events">
    先浏览、搜索并读取 event card，再选择 market。
  </Card>

  <Card title="预测市场 Market 详情" icon="file-lines" href="/zh-CN/api/prediction-markets/markets">
    读取 market outcomes，并复制需要的 `outcome_token_id`。
  </Card>
</Columns>
