還沒有帳號?點擊這裡註冊 Polymarket 並完成入金,才能用錢包私鑰為訂單籤名、實際成交。
端點
獲取評論
請求參數
| 參數 | 類型 | 描述 |
|---|---|---|
market_id | string | 市場 ID |
limit | number | 返回數量 |
offset | number | 偏移量 |
獲取和發布市場評論
GET https://gamma-api.polymarket.com/comments
POST https://gamma-api.polymarket.com/comments
| 參數 | 類型 | 描述 |
|---|---|---|
market_id | string | 市場 ID |
limit | number | 返回數量 |
offset | number | 偏移量 |
import requests
market_id = "12345"
response = requests.get(
'https://gamma-api.polymarket.com/comments',
params={
'market_id': market_id,
'limit': 20
}
)
comments = response.json()
for comment in comments:
print(f"用戶: {comment['user']}")
print(f"評論: {comment['content']}")
print(f"時間: {comment['created_at']}")
print("---")
[
{
"id": "789",
"user": {
"address": "0x1234...",
"username": "trader123"
},
"content": "這是我的分析...",
"created_at": "2024-01-15T10:30:00Z",
"likes": 15
}
]
# 需要用戶認證
headers = {
'Authorization': 'Bearer YOUR_TOKEN'
}
response = requests.post(
'https://gamma-api.polymarket.com/comments',
headers=headers,
json={
'market_id': market_id,
'content': '我的評論內容'
}
)