Skip to main content
GET
/
v2
/
onchain
/
markets
/
{token_id}
/
trades
Market trade history (onchain)
curl --request GET \
  --url https://api.polynode.dev/v2/onchain/markets/{token_id}/trades

Documentation Index

Fetch the complete documentation index at: https://polynode.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Returns every onchain trade fill for a specific market token, enriched with market metadata.
Want the entire market in one call? Use Trade History (Market) — Bulk (Growth plan and above). Returns up to 250K trades in a single response, no pagination.

Quick start — get the most recent 100 trades

curl "https://api.polynode.dev/v2/onchain/markets/{token_id}/trades?limit=100" \
  -H "x-api-key: YOUR_KEY"
Default limit=100, max limit=1000. That’s all most apps need.

Get every trade in the market (full history)

To walk the entire history, add ?cursor= (empty value) to the first request, then for each next page, copy pagination.cursor from the response back into the URL. Stop when pagination.has_more is false. Three complete copy-paste scripts that walk an entire market:
import requests

API_KEY = "YOUR_KEY"
TOKEN_ID = "21743669032210695168079601505378236205866986767926346409604806906483294819314"

def get_all_trades(token_id):
    cursor = ""           # empty string = first page
    all_trades = []
    while True:
        r = requests.get(
            f"https://api.polynode.dev/v2/onchain/markets/{token_id}/trades",
            params={"limit": 1000, "cursor": cursor},
            headers={"x-api-key": API_KEY},
        ).json()
        all_trades.extend(r["trades"])
        if not r["pagination"]["has_more"]:
            break
        cursor = r["pagination"]["cursor"]   # feed this into the next request
    return all_trades

trades = get_all_trades(TOKEN_ID)
print(f"got {len(trades)} trades")
Real run (heavy market, walked live with the Python script above):
got 1000 trades  (total: 1000)
got 1000 trades  (total: 2000)
got 1000 trades  (total: 3000)
...
got 1000 trades  (total: 20000)
DONE. 20,000 trades in 24 seconds.
Each page takes ~1 second regardless of how deep you go — the loop just keeps running until has_more is false.

Request

GET /v2/onchain/markets/{token_id}/trades?limit=100
GET /v2/onchain/markets/{token_id}/trades?limit=1000&cursor=<value-from-prior-response>
ParameterTypeLocationDescription
token_idstringpathCTF token ID (numeric string)
limitintegerqueryMax results per page (default 100, max 1000)
cursorstringqueryPass empty string ?cursor= for first page, then echo back pagination.cursor from each response. Required to walk past the first page reliably on large markets.
offsetintegerqueryAlternative to cursor: skip first N. Fast for the first ~25K results then degrades. Use cursor for anything bigger.

Response

{
  "token_id": "110959653450933276250915064669875552310439627880508793089816880777942697720191",
  "source": "onchain",
  "count": 3,
  "market": "US x Iran ceasefire extended by April 22, 2026?",
  "slug": "us-x-iran-ceasefire-extended-by-april-22-2026",
  "outcome": "No",
  "image": "https://polymarket-upload.s3.us-east-2.amazonaws.com/us-x-iran-ceasefire-by-Cgmx3GCuOwjs.jpg",
  "condition_id": "0x1d2787cb8aed975d092b2799ed6f4083e9445f7420cdc09e9d47e7d54356c6cd",
  "pagination": {
    "limit": 3,
    "has_more": true,
    "cursor": "1777595648:0xeae6ca0aeb75fc866ddb29d3a4b2cd15382895b923fe05b9315445d6346d1c47_0x49ddd1e169186d350488e3d62f58452fe76862c5f81f33987e659759e2c66100"
  },
  "trades": [
    {
      "tx_hash": "0x044dc412fa97d972fae1e77f8a30e769b7bea339cc3a27b5045e5668b513a520",
      "order_hash": "0x6b3d58dcf19f26a0b2f325bc43dc793765d1abeedfc449a3c5be38b6523613c9",
      "timestamp": 1777595650,
      "maker": "0x84571f1bf97a5c710cbe51daff2dd4556cc887fd",
      "taker": "0xe111180000d2663c0091e4f400237545b87b996b",
      "maker_asset_id": "0",
      "taker_asset_id": "110959653450933276250915064669875552310439627880508793089816880777942697720191",
      "maker_amount": 617.382,
      "taker_amount": 618,
      "fee": 0,
      "direction": "BUY",
      "side": "maker"
    }
  ]
}
FieldTypeDescription
countintegerNumber of trades in this response
pagination.has_morebooleantrue if more pages available — keep paginating
pagination.cursorstringPass this back as ?cursor=<value> for the next page
marketstringMarket question
slugstringMarket slug
outcomestringOutcome label for this token
imagestringMarket image URL
condition_idstringMarket condition ID
trades[].tx_hashstringTransaction hash
trades[].order_hashstringOrder hash that was filled
trades[].timestampnumberUnix timestamp
trades[].makerstringMaker wallet
trades[].takerstringTaker wallet
trades[].maker_asset_idstringAsset the maker provided ("0" = USDC)
trades[].taker_asset_idstringAsset the taker provided
trades[].maker_amountnumberAmount maker provided
trades[].taker_amountnumberAmount taker provided
trades[].feenumberFee (USDC)
trades[].directionstring"BUY" or "SELL" from the buyer’s perspective on this fill
trades[].sidestringAlways "maker" for this endpoint

Path Parameters

token_id
string
required

CTF token ID

Query Parameters

limit
integer
default:100

Max results (max 1000)

offset
integer
default:0

Skip first N results

cursor
string

Cursor pagination. Pass empty string ?cursor= for the first page, then echo back pagination.cursor from each response. Format: <lastTs>:<lastId>. Each page loads at the same speed regardless of depth — recommended over offset for paging beyond ~25K results.

Response

Trade fills