Skip to main content
還沒有帳號?點擊這裡註冊 Polymarket 並完成入金,才能用錢包私鑰為訂單籤名、實際成交。
法律合規提醒:在使用 Polymarket 服務或 API 前,請確認您所在地區的法律規定。Polymarket 目前不支援比利時、法國、新加坡、泰國、中國大陸等地區,政策可能隨時變化。
事件端點返回事件信息,一個事件可以包含多個相關市場。

端點

GET https://gamma-api.polymarket.com/events
GET https://gamma-api.polymarket.com/events/{slug}

請求參數

參數類型描述
limitnumber返回數量(默認:20)
offsetnumber偏移量(默認:0)
closedboolean是否包含已關閉事件
tagstring按標籤過濾

請求示例

獲取所有事件

import requests

response = requests.get(
    'https://gamma-api.polymarket.com/events',
    params={
        'limit': 10,
        'offset': 0,
        'closed': False
    }
)

events = response.json()
for event in events:
    print(f"事件: {event['title']}")
    print(f"市場數: {len(event['markets'])}")

獲取特定事件

slug = "2024-us-presidential-election"
response = requests.get(
    f'https://gamma-api.polymarket.com/events/{slug}'
)
event = response.json()

響應示例

{
  "id": "12345",
  "slug": "2024-us-presidential-election",
  "title": "2024 年美國總統大選",
  "description": "2024 年美國總統大選相關市場",
  "start_date": "2024-11-05T00:00:00Z",
  "end_date": "2024-11-06T00:00:00Z",
  "image_url": "https://...",
  "markets": [
    {
      "id": "...",
      "question": "誰將贏得 2024 年美國總統大選?",
      "active": true
    }
  ],
  "tags": ["politics", "elections"],
  "created_at": "2023-01-01T00:00:00Z"
}

事件欄位

欄位類型描述
idstring事件唯一 ID
slugstringURL 友好的標識符
titlestring事件標題
descriptionstring事件描述
marketsarray相關市場列表
tagsarray事件標籤
start_datestring開始時間
end_datestring結束時間