Filtering
Last updated
Filters select which records a list endpoint returns. Each endpoint's Filters section lists its supported parameters, types, limits, and conditions. Filters are optional and narrow the results together unless the endpoint documents a precedence rule.
Endpoints labelled GET | QUERY accept filters through either HTTP method. Parameter names, types, authentication, and response format are the same; only where you send the parameters changes.
Choose a request method
| Method | Where filters go | When to use it |
|---|---|---|
| GET | URL query string | Short filters that fit comfortably in a URL |
| QUERY | JSON request body | Larger filters, such as long lists of account IDs, that could exceed URL-length limits |
QUERY is an HTTP method. It is supported only on endpoints labelled GET | QUERY; single-resource lookups and /user/usage remain GET-only.
Example: open trades for an account
Both requests below select open trades for account 122289. Include your usual authentication header with either request.
GET — append filters to the URL after ?, separating multiple parameters with &:
GET /trades?account_id=122289&state=open
QUERY — send the same filters as a JSON object:
QUERY /trades
{
"account_id": 122289,
"state": "open"
}
Parameter types
Use the types documented for each filter with either method. Send comma-separated ID lists without spaces and keep them as strings in a JSON body, rather than arrays. The limit on the number of IDs and the length of each ID is documented per field:
{
"account_ids": "122289,122290",
"state": "open"
}
Date filters
Send date filters as UTC datetime strings, for example 2026-11-12T10:00:00Z. Start and end filters include the supplied boundary times. Where an end filter requires a later value than its corresponding start, equal times are rejected. Field descriptions identify these conditions and any incompatible filters.
Pagination
Send limit, order, and last_id alongside your filters: in the URL query string for GET, or in the JSON body for QUERY. See Pagination for how to retrieve subsequent pages.