Skip to main content
POST
/
v1beta1
/
search_trades
Search Trades
curl --request POST \
  --url https://traderapi.us-east-1.privatelink.preprod.polymarketexchange.com/api/v1beta1/search_trades \
  --header 'Content-Type: application/json' \
  --data '
{
  "accounts": [
    "<string>"
  ],
  "end_time": "2023-11-07T05:31:56Z",
  "exec_id": "<string>",
  "order_id": "<string>",
  "page_size": 123,
  "page_token": "<string>",
  "start_time": "2023-11-07T05:31:56Z",
  "states": [
    "TRADE_STATE_UNDEFINED"
  ],
  "symbol": "<string>",
  "trade_id": "<string>",
  "trade_link_id": "<string>"
}
'
{
  "next_page_token": "<string>",
  "trade": [
    {
      "aggressor": {
        "aggressor": true,
        "commission_notional_collected": "<string>",
        "commission_spread_px": "<string>",
        "id": "<string>",
        "last_px": "<string>",
        "last_shares": "<string>",
        "leg_prices": [
          {
            "anchor": true,
            "px": "<string>",
            "qty": "<string>",
            "reference_px": "<string>",
            "side": "SIDE_UNDEFINED",
            "symbol": "<string>"
          }
        ],
        "order": {
          "account": "trading-account-456",
          "all_or_none": true,
          "avg_px": "<string>",
          "best_limit": true,
          "block_trade_indicator": true,
          "cash_order_qty": "<string>",
          "client_account_id": "<string>",
          "client_participant_id": "<string>",
          "clord_id": "<string>",
          "collateral_memo": "<string>",
          "commission_notional_total_collected": "<string>",
          "commissions_basis_points": "<string>",
          "context": {
            "any_context": {
              "@type": "<string>"
            },
            "fix_context": {
              "begin_string": "<string>",
              "on_behalf_of_comp_id": "<string>",
              "on_behalf_of_sub_id": "<string>",
              "orig_clord_id": "<string>",
              "security_type": "<string>",
              "sender_comp_id": "<string>",
              "sender_location_id": "<string>",
              "sender_sub_id": "<string>",
              "target_comp_id": "<string>",
              "target_location_id": "<string>",
              "target_sub_id": "<string>"
            },
            "service_name": "<string>",
            "validation_contexts": [
              {
                "@type": "<string>"
              }
            ]
          },
          "create_time": "2023-11-07T05:31:56Z",
          "cross_id": "<string>",
          "cum_qty": "<string>",
          "fractional_quantity_scale": "<string>",
          "good_till_time": "2023-11-07T05:31:56Z",
          "host_cross_id": "<string>",
          "id": "<string>",
          "ignore_price_validity_checks": true,
          "immediately_executable_limit": true,
          "insert_time": "2023-11-07T05:31:56Z",
          "last_trade_id": "<string>",
          "last_transact_time": "2023-11-07T05:31:56Z",
          "leaves_qty": "<string>",
          "maker_commissions_basis_points": "<string>",
          "manual_order_indicator": "MANUAL_ORDER_INDICATOR_UNDEFINED",
          "min_qty": "<string>",
          "order_capacity": "ORDER_CAPACITY_UNDEFINED",
          "order_qty": "<string>",
          "parent_order_id": "<string>",
          "participant": "<string>",
          "participate_dont_initiate": true,
          "price": "5500",
          "price_scale": "10000",
          "price_to_quantity_filled": {},
          "priority_weight": "<string>",
          "risk_check_time": "2023-11-07T05:31:56Z",
          "self_match_prevention_instruction": "SELF_MATCH_PREVENTION_INSTRUCTION_UNDEFINED",
          "side": "SIDE_UNDEFINED",
          "state": "ORDER_STATE_NEW",
          "stop_price": "<string>",
          "strict_limit": true,
          "submitting_participant": "<string>",
          "symbol": "aec-nfl-buf-nyj-2025-01-15",
          "symbol_sub_type": "<string>",
          "time_in_force": "TIME_IN_FORCE_UNDEFINED",
          "transaction_booked_time": "2023-11-07T05:31:56Z",
          "trigger_method": "CONDITION_TRIGGER_METHOD_UNDEFINED",
          "type": "ORDER_TYPE_UNDEFINED"
        },
        "order_reject_reason": "ORD_REJECT_REASON_EXCHANGE_OPTION",
        "text": "<string>",
        "trace_id": "<string>",
        "trade_id": "<string>",
        "transact_time": "2023-11-07T05:31:56Z",
        "transact_trade_date": {
          "day": 123,
          "month": 123,
          "year": 123
        },
        "type": "EXECUTION_TYPE_NEW",
        "unsolicited_cancel_reason": "UNSOLICITED_CXL_REASON_UNDEFINED"
      },
      "id": "<string>",
      "metadata": {},
      "passive": {
        "aggressor": true,
        "commission_notional_collected": "<string>",
        "commission_spread_px": "<string>",
        "id": "<string>",
        "last_px": "<string>",
        "last_shares": "<string>",
        "leg_prices": [
          {
            "anchor": true,
            "px": "<string>",
            "qty": "<string>",
            "reference_px": "<string>",
            "side": "SIDE_UNDEFINED",
            "symbol": "<string>"
          }
        ],
        "order": {
          "account": "trading-account-456",
          "all_or_none": true,
          "avg_px": "<string>",
          "best_limit": true,
          "block_trade_indicator": true,
          "cash_order_qty": "<string>",
          "client_account_id": "<string>",
          "client_participant_id": "<string>",
          "clord_id": "<string>",
          "collateral_memo": "<string>",
          "commission_notional_total_collected": "<string>",
          "commissions_basis_points": "<string>",
          "context": {
            "any_context": {
              "@type": "<string>"
            },
            "fix_context": {
              "begin_string": "<string>",
              "on_behalf_of_comp_id": "<string>",
              "on_behalf_of_sub_id": "<string>",
              "orig_clord_id": "<string>",
              "security_type": "<string>",
              "sender_comp_id": "<string>",
              "sender_location_id": "<string>",
              "sender_sub_id": "<string>",
              "target_comp_id": "<string>",
              "target_location_id": "<string>",
              "target_sub_id": "<string>"
            },
            "service_name": "<string>",
            "validation_contexts": [
              {
                "@type": "<string>"
              }
            ]
          },
          "create_time": "2023-11-07T05:31:56Z",
          "cross_id": "<string>",
          "cum_qty": "<string>",
          "fractional_quantity_scale": "<string>",
          "good_till_time": "2023-11-07T05:31:56Z",
          "host_cross_id": "<string>",
          "id": "<string>",
          "ignore_price_validity_checks": true,
          "immediately_executable_limit": true,
          "insert_time": "2023-11-07T05:31:56Z",
          "last_trade_id": "<string>",
          "last_transact_time": "2023-11-07T05:31:56Z",
          "leaves_qty": "<string>",
          "maker_commissions_basis_points": "<string>",
          "manual_order_indicator": "MANUAL_ORDER_INDICATOR_UNDEFINED",
          "min_qty": "<string>",
          "order_capacity": "ORDER_CAPACITY_UNDEFINED",
          "order_qty": "<string>",
          "parent_order_id": "<string>",
          "participant": "<string>",
          "participate_dont_initiate": true,
          "price": "5500",
          "price_scale": "10000",
          "price_to_quantity_filled": {},
          "priority_weight": "<string>",
          "risk_check_time": "2023-11-07T05:31:56Z",
          "self_match_prevention_instruction": "SELF_MATCH_PREVENTION_INSTRUCTION_UNDEFINED",
          "side": "SIDE_UNDEFINED",
          "state": "ORDER_STATE_NEW",
          "stop_price": "<string>",
          "strict_limit": true,
          "submitting_participant": "<string>",
          "symbol": "aec-nfl-buf-nyj-2025-01-15",
          "symbol_sub_type": "<string>",
          "time_in_force": "TIME_IN_FORCE_UNDEFINED",
          "transaction_booked_time": "2023-11-07T05:31:56Z",
          "trigger_method": "CONDITION_TRIGGER_METHOD_UNDEFINED",
          "type": "ORDER_TYPE_UNDEFINED"
        },
        "order_reject_reason": "ORD_REJECT_REASON_EXCHANGE_OPTION",
        "text": "<string>",
        "trace_id": "<string>",
        "trade_id": "<string>",
        "transact_time": "2023-11-07T05:31:56Z",
        "transact_trade_date": {
          "day": 123,
          "month": 123,
          "year": 123
        },
        "type": "EXECUTION_TYPE_NEW",
        "unsolicited_cancel_reason": "UNSOLICITED_CXL_REASON_UNDEFINED"
      },
      "reporting_counterparty": "SIDE_UNDEFINED",
      "state": "TRADE_STATE_UNDEFINED",
      "text": "<string>",
      "trade_link_id": "<string>",
      "trade_type": "TRADE_TYPE_UNDEFINED"
    }
  ]
}

Body

application/json

Request to search for trades filtered using the given details.

accounts
string[]

Fully qualified resource account names to filter upon (ie: "firms/[firmid]/accounts/[accountid]").

end_time
string<date-time>

End time for the orders to be fetched.

exec_id
string

Exchange assigned execution ID to filter upon.

order_id
string

Exchange assigned order ID of the order to filter upon.

page_size
integer<int32>

The maximum number of orders to return in a response. This field is optional.

page_token
string

A pagination token returned from a previous call to SearchTradesRequest. that indicates where this listing should continue from. This field is optional.

start_time
string<date-time>

Start time for the orders to be fetched.

states
enum<string>[]

Trade states to filter upon.

TradeState indicates the state of a trade.

  • TRADE_STATE_NEW: Trade created
  • TRADE_STATE_CLEARED: Trade successfully cleared by clearing house
  • TRADE_STATE_BUSTED: Trade withdrawal request successfully approved
  • TRADE_STATE_INFLIGHT: Trade information sent to clearinghouse
  • TRADE_STATE_PENDING_RISK: Clearinghouse is pending at least one DCM claim for the trade
  • TRADE_STATE_PENDING_CLEARED: Clearinghouse is pending the counterparty DCM claim
  • TRADE_STATE_REJECTED: Clearinghouse has rejected the trade
  • TRADE_STATE_CLEARING_ACKNOWLEDGED: Clearing request acknowledged by clearing house
  • TRADE_STATE_RETRY_REQUEST: Trade has requested to retry clearing and is pending submission to the clearing house
Available options:
TRADE_STATE_UNDEFINED,
TRADE_STATE_NEW,
TRADE_STATE_CLEARED,
TRADE_STATE_BUSTED,
TRADE_STATE_INFLIGHT,
TRADE_STATE_PENDING_RISK,
TRADE_STATE_PENDING_CLEARED,
TRADE_STATE_REJECTED,
TRADE_STATE_CLEARING_ACKNOWLEDGED,
TRADE_STATE_RETRY_REQUEST
symbol
string

Instrument symbol to filter upon.

trade_id
string

Exchange assigned trade ID to filter upon.

Response

A successful response.

next_page_token
string

A pagination token returned from a previous call to SearchTrades. that indicates from where listing should continue. This field is optional.

trade
object[]

List of trades found.