# Nansen Prediction Market Trades by Market

> Nansen Prediction Market Trades by Market is a paid API for AI agents from api.nansen.ai, paid per call via MPP or x402, $0.01/call, status unknown (last checked 2026-09-15).

Retrieves individual trade records for a specific prediction market, showing trade activity and smart money participation.

## Facts

- Endpoint: GET https://api.nansen.ai/api/v1/prediction-market/trades-by-market
- Price: $0.01/call
- Payment: MPP, x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/api-nansen-ai-afb513f3
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_TnbythN93VtAUpinZtGMN

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability api-nansen-ai-afb513f3
```

Example prompt: Pull all the trades for this prediction market — market ID 0x1234abcd — and show me which wallets are buying and selling, especially any Nansen smart money labels.

## When to prefer this

Use this endpoint when you need granular trade-level data for a specific prediction market — particularly when you want to identify which wallets (especially labeled smart money) are entering or exiting positions in a given market. Prefer this over PnL endpoints when you need raw trade activity rather than aggregated profitability.

## Known failure modes

- Invalid or unknown market identifier returns empty result or 404
- Market not indexed by Nansen returns no data
- Malformed POST body returns 400 bad request
- Payment not included or insufficient returns 402 payment required
- Rate limit exceeded returns 429
- Chain or protocol not supported returns error

## How this service works

Get Prediction Market Trades by Market

## Output

Returns a list of individual trades for the specified prediction market, including trader wallet addresses, trade direction (buy/sell), size, price, timestamp, and potentially Nansen smart money labels for the traders involved.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "title": "TradesByMarketRequest",
 "required": [
  "market_id"
 ],
 "properties": {
  "date": {
   "anyOf": [
    {
     "type": "object",
     "title": "DateRange",
     "properties": {
      "to": {
       "anyOf": [
        {
         "type": "string"
        }
       ],
       "title": "To",
       "examples": [
        "2025-01-31T23:59:59Z"
       ],
       "description": "End date in ISO 8601 format (e.g., 2025-01-31T23:59:59Z or 2025-01-31)"
      },
      "from": {
       "anyOf": [
        {
         "type": "string"
        }
       ],
       "title": "From",
       "examples": [
        "2025-01-01T00:00:00Z"
       ],
       "description": "Start date in ISO 8601 format (e.g., 2025-01-01T00:00:00Z or 2025-01-01)"
      }
     },
     "description": "Date range model matching the API schema."
    }
   ],
   "examples": [
    {
     "to": "2024-12-31T23:59:59Z",
     "from": "2024-01-01T00:00:00Z"
    }
   ],
   "description": "Date range filter (ISO 8601 date-time)"
  },
  "order_by": {
   "anyOf": [
    {
     "type": "array",
     "items": {
      "type": "object",
      "title": "SortOrder[TradesByMarketSortField]",
      "required": [
       "field",
       "direction"
      ],
      "properties": {
       "field": {
        "enum": [
         "timestamp"
        ],
        "type": "string",
        "title": "TradesByMarketSortField",
        "description": "Sortable fields for trades by market endpoint."
       },
       "direction": {
        "enum": [
         "ASC",
         "DESC"
        ],
        "type": "string",
        "title": "SortDirection",
        "description": "Enum for sort directions."
       }
      }
     }
    }
   ],
   "title": "Order By",
   "examples": [
    [
     {
      "field": "timestamp",
      "direction": "DESC"
     }
    ]
   ],
   "description": "Sort order"
  },
  "market_id": {
   "type": "string",
   "title": "Market Id",
   "examples": [
    "654412"
   ],
   "maxLength": 100,
   "minLength": 1,
   "description": "Polymarket market ID"
  },
  "pagination": {
   "type": "object",
   "title": "PaginationRequest",
   "properties": {
    "page": {
     "type": "integer",
     "title": "Page",
     "default": 1,
     "minimum": 1,
     "description": "Page number (1-based)"
    },
    "per_page": {
     "type": "integer",
     "title": "Per Page",
     "default": 10,
     "maximum": 1000,
     "minimum": 1,
     "description": "Number of records per page (max 1000)"
    }
   },
   "
… (truncated)
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "title": "TradesByMarketResponse",
 "required": [
  "data"
 ],
 "properties": {
  "data": {
   "type": "array",
   "items": {
    "type": "object",
    "title": "TradeByMarket",
    "required": [
     "market_id"
    ],
    "properties": {
     "side": {
      "anyOf": [
       {
        "type": "string"
       }
      ],
      "title": "Side",
      "examples": [
       "Yes"
      ],
      "description": "Outcome side (Yes/No)"
     },
     "size": {
      "anyOf": [
       {
        "type": "number"
       }
      ],
      "title": "Size",
      "examples": [
       1000
      ],
      "description": "Trade size in tokens"
     },
     "buyer": {
      "anyOf": [
       {
        "type": "string"
       }
      ],
      "title": "Buyer",
      "examples": [
       "0xabcdefabcdefabcdefabcdefabcdefabcdefabcd"
      ],
      "description": "Buyer address (hex)"
     },
     "price": {
      "anyOf": [
       {
        "type": "number"
       }
      ],
      "title": "Price",
      "examples": [
       0.52
      ],
      "description": "Price per share (0-1)"
     },
     "seller": {
      "anyOf": [
       {
        "type": "string"
       }
      ],
      "title": "Seller",
      "examples": [
       "0x1234567890abcdef1234567890abcdef12345678"
      ],
      "description": "Seller address (hex)"
     },
     "tx_hash": {
      "anyOf": [
       {
        "type": "string"
       }
      ],
      "title": "Tx Hash",
      "examples": [
       "0xabc123def456"
      ],
      "description": "Transaction hash (hex)"
     },
     "market_id": {
      "type": "string",
      "title": "Market Id",
      "examples": [
       "654412"
      ],
      "description": "Market ID"
     },
     "timestamp": {
      "anyOf": [
       {
        "type": "string",
        "format": "date-time"
       }
      ],
      "title": "Timestamp",
      "examples": [
       "2024-11-01T12:30:00"
      ],
      "description": "Trade timestamp (ISO format)"
     },
     "usdc_value": {
      "anyOf": [
       {
        "type": "number"
       }
      ],
      "title": "Usdc Value",
      "examples": [
       520
      ],
      "description": "Trade value in USDC"
     },
     "taker_action": {
      "anyOf": [
       {
        "type": "string"
       }
      ],
      "title": "Taker Action",
      "examples": [
       "buy"
      ],
      "description": "Taker action (buy/sell)"
     },
     "outcome_index": {
      "anyOf": [
       {
        "type": "integer
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/api-nansen-ai-afb513f3/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.nansen.ai](https://www.zero.xyz/host/api.nansen.ai/llms.txt)
