# Polymarket 市场列表 API (polymarket.markets)

- Canonical page: https://everyinfra.com/polymarket-api/markets
- Endpoint: POST /api/v1/social with {"platform": "polymarket", "action": "markets", "params": {...}}
- Price: $0.006806 per call ($6.81 per 1,000 requests); failed and empty results are not charged
- Returns: list, default 20, max 100 per call
- Mode: sync; add "mode": "async" for slow tasks

Polymarket 市场列表列出具体的市场，每行带标题、状态、可买的结果 `outcomes`、累计、近 24 小时和近 7 天成交额、流动性，以及所属事件。每个结果带一个 0 到 1 之间的数，可以读作市场给出的概率，结算后赢的一边为 1，`winning_outcome` 写明赢的是哪边。它回答「这个问题现在被市场怎么定价」。

不传任何参数时按累计成交额列全站；`keyword` 按市场或事件标题找，最少要 3 个字。`sort` 默认 `volume`，`price_desc` 和 `price_asc` 按结果的数值从高到低或从低到高排，`expiration` 把快到期的排前面。

## Health

- Live health (24h percent, hourly and daily trends): https://api.everyinfra.com/api/v1/social/availability?platform=polymarket&action=markets

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| keyword | not declared | no | not declared | 在市场或事件标题里搜的词，至少 3 个字，例如 bitcoin、election；不传按排序列全站。 |
| sort | enum: created / expiration / open_interest / price_asc / price_desc / trades_1d / volume / volume_1d / volume_7d | no | not declared | volume（默认，累计成交额）、open_interest、price_desc、price_asc、expiration（快到期的在前）、created（新建的在前）、volume_1d、volume_7d、trades_1d。 |
| status | enum: closed / open | no | not declared | open（还在交易）或 closed（已结束）；不传两种都有。 |
| limit | integer (1–100) | no | 20 | 这次调用最多返回的条数，整数，1–100；不传按默认值，实际返回可能少于这个数。超过上限会在扣费前返回 422。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| id | 市场或事件的 Polymarket ID（字符串）。 |
| condition_id | 市场在链上的 condition ID（0x 开头）；可作为 trades 的 market。 |
| slug | 市场或事件在 Polymarket 链接里的短名；市场 slug 可作为 trades 的 market。 |
| url | 该记录在原平台上的可访问链接。 |
| title | 标题。平台无标题概念时（如纯文本帖）为 null。 |
| description | 简介或描述，通常比 text 短。 |
| status | open（还在交易）或 closed（已结束）。 |
| winning_outcome | 已结算市场赢的那一边（如 Yes）；没结算时没有。 |
| outcomes | 可买的结果，每项 label、token_id、price（0–1 的价格，可读作市场给的概率；结算后赢的一边为 1）。 |
| volume_usd | 累计成交额，美元。 |
| liquidity_usd | 当前挂单流动性，美元。 |
| volume_24h_usd | 近 24 小时成交额，美元。 |
| volume_7d_usd | 近 7 天成交额，美元（markets）。 |
| trades_24h | 近 24 小时成交笔数（markets）。 |
| tags | 标签列表；没有时没有这个字段。 |
| event_id | 所属事件 ID（markets）。 |
| event_slug | 所属事件短名（markets）。 |
| event_title | 所属事件标题（markets）。 |
| image_url | 图片链接。多图能力可能返回 image_urls 数组。 |
| start_at | 开始时间，ISO 8601 UTC。 |
| end_at | 计划结束时间，ISO 8601 UTC。 |
| closed_at | 实际关闭时间，ISO 8601 UTC；没关闭时没有。 |
| created_at | 创建时间，格式同 posted_at。 |
| platform | 数据来源平台标识，与请求里的 platform 一致（如 xiaohongshu、tiktok）。 |

## Example

```bash
curl -X POST 'https://api.everyinfra.com/api/v1/social' \
  -H "Authorization: Bearer $EVERYINFRA_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "platform": "polymarket",
  "action": "markets",
  "params": {}
}'
```

```python
import os
import requests

response = requests.post(
    "https://api.everyinfra.com/api/v1/social",
    headers={"Authorization": f"Bearer {os.environ['EVERYINFRA_API_KEY']}"},
    json={
        "platform": "polymarket",
        "action": "markets",
        "params": {},
    },
    timeout=120,
)
print(response.status_code)
print(response.json())
```

## Response example

No real sample for these example parameters yet: structure only, every value is a placeholder (…).

```text
{
  "id": "req_…",
  "platform": "polymarket",
  "action": "markets",
  "results": [
    {
      "id": …,
      "condition_id": …,
      "slug": …,
      "url": …,
      "title": …,
      "description": …,
      "status": …,
      "winning_outcome": …,
      "outcomes": …,
      "volume_usd": …,
      "liquidity_usd": …,
      "volume_24h_usd": …,
      "volume_7d_usd": …,
      "trades_24h": …,
      "tags": …,
      "event_id": …,
      "event_slug": …,
      "event_title": …,
      "image_url": …,
      "start_at": …,
      "end_at": …,
      "closed_at": …,
      "created_at": …,
      "platform": …
    }
  ],
  "count": …,
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## FAQ

### `outcomes` 里的数值怎么读？

每个可买的结果有标签和一个 0 到 1 之间的数，可以读作市场给出的概率。市场结算后，赢的一边的数为 1，`winning_outcome` 写明是哪一边，例如 Yes；还没结算的市场没有 `winning_outcome` 这个字段。

### 怎么拿到某个市场的成交明细？

`condition_id` 是市场在链上的 ID，0x 开头；`slug` 是市场在链接里的短名。两者都可以传给 trades 能力的 market 参数，去读这个市场的成交。先在这一页按 `keyword` 找到市场，再取这两个字段之一。

### 怎么把市场归回它所属的事件？

每行有 `event_id`、`event_slug` 和 `event_title`，按 `event_id` 分组，就能把同一事件下的市场放在一起。要按分类筛，或者看事件的结算依据来源，用事件列表。近期热度看 `volume_7d_usd` 和 `trades_24h`。

## Also

- Capability catalog (no key): https://api.everyinfra.com/api/v1/social/catalog?platform=polymarket
- OpenAPI: https://everyinfra.com/openapi.json · Agents guide: https://everyinfra.com/agents.md
