Orders
GET /v1/predexon/orders — Retrieve historical order data with flexible filtering by market, token, condition, user, and time range.
- Base URL:
https://api.predexon.com/v1 - Auth:
x-api-key: YOUR_API_KEY - Time: All timestamps are Unix timestamps (seconds since epoch). Responses include UTC ISO-8601 format.
- Pagination: Offset-based via
limitandoffsetparameters - Rate Limits: Standard API rate limits apply. Returns
429withRetry-Afterheader when exceeded. Use exponential backoff on 429/503 responses.
Common use cases
- Trading analytics: Analyze order flow and trading patterns for a specific market
- User tracking: Monitor all orders placed by a specific wallet address
- Market research: Study order book evolution and participation
- Compliance & auditing: Retrieve complete order history within a time window
Endpoint
Query parameters
All parameters are optional. However, at least one filter is required (unless fetching all orders without any constraints).| Parameter | Type | Notes |
|---|---|---|
market_slug | string | Filter orders by market slug. Cannot be combined with token_id or condition_id. |
condition_id | string | Filter orders by condition ID. Cannot be combined with market_slug or token_id. |
token_id | string | Filter orders by token ID. Cannot be combined with market_slug or condition_id. |
start_time | integer | Filter orders from this Unix timestamp (inclusive). Minimum: 0. Must be less than end_time if both provided. |
end_time | integer | Filter orders until this Unix timestamp (inclusive). Minimum: 0. Must be greater than start_time if both provided. |
user | string | Filter orders by user wallet address. Exact match. |
limit | integer | Number of orders to return per page. Default: 100, Max: [configured max]. Minimum: 1. |
offset | integer | Number of orders to skip for pagination. Default: 0. Minimum: 0. |
Validation rules:
- At least one filter required: You must provide at least one of:
market_slug,condition_id,token_id,start_time,end_time, oruser. - Exclusive market/token filters: Only one of
market_slug,token_id, orcondition_idmay be provided. Combining multiple returns a400 Bad Request. - Time range validation: If both
start_timeandend_timeare provided,start_timemust be strictly less thanend_time. Violating this returns a400 Bad Request. - Pagination bounds:
limitmust be between 1 and the configured maximum.offsetmust be non-negative.
Response schema
Field reference
| Field | Type | Description |
|---|---|---|
orders | array | List of order records. Ordered by timestamp descending (newest first). |
orders[].id | string | Unique order identifier. |
orders[].market_slug | string | Market identifier slug (human-readable format). |
orders[].condition_id | string | Canonical condition identifier for this market outcome. |
orders[].token_id | string | Token identifier representing the outcome. |
orders[].user | string | Wallet address of the order placer. |
orders[].price | string | Order price as decimal string (0.00 to 1.00). |
orders[].size | string | Order size as decimal string (quantity of outcome tokens). |
orders[].timestamp | integer | Unix timestamp (seconds since epoch, UTC). |
orders[].timestamp_iso | string (ISO-8601) | Human-readable timestamp in UTC format. |
orders[].side | enum | BUY or SELL. |
orders[].order_type | enum | LIMIT | MARKET | other supported types. |
orders[].status | enum | Order status: PENDING | FILLED | PARTIALLY_FILLED | CANCELLED | REJECTED. |
pagination.limit | integer | Number of results returned (matches request limit parameter). |
pagination.offset | integer | Number of results skipped (matches request offset parameter). |
pagination.total | integer | Total number of orders matching the filter criteria. |
pagination.has_more | boolean | true if more results are available beyond current page; false if this is the last page. |
Data types:
- Prices and sizes are represented as decimal strings to preserve precision. Parse as
floatorDecimaltypes in your language to avoid floating-point errors. - Timestamps are provided in both Unix format (seconds) and ISO-8601 for convenience.
- User addresses are wallet addresses (e.g., Ethereum addresses) in checksummed format.
Examples
Errors
All errors return standard HTTP status codes with JSON error responses:Error Types
| HTTP Status | Error Type | Description | Common Causes |
|---|---|---|---|
400 | invalid_parameter | Request validation failed | Missing required filters, invalid parameter types, malformed values |
400 | conflicting_parameters | Mutually exclusive parameters provided | Provided both market_slug and token_id, or start_time >= end_time |
400 | missing_filter | No filter parameters provided | Must specify at least one filter |
401 | invalid_credentials | Authentication failed | Missing or invalid x-api-key header |
403 | insufficient_permissions | API key lacks required permissions | API key not provisioned for Trading API access |
404 | not_found | Resource not found | Invalid market slug, condition ID, or token ID |
429 | rate_limit_exceeded | Too many requests | Exceeded rate limit. Check Retry-After header. |
500 | internal_error | Server error | Unexpected server issue. Retry with backoff. |
503 | service_unavailable | Temporary service issue | Service temporarily unavailable. Retry with exponential backoff. |
Best practices
-
Use specific filters: Combine filters (e.g.,
market_slug+start_time) to reduce result set size and improve performance. -
Pagination: Use
offsetandlimitfor large result sets. Checkhas_moreto determine if you need another request. -
Time range queries: When filtering by time, use Unix timestamps and verify
start_time < end_timeto avoid validation errors. - Cache selectively: Cache order data by query parameters. Invalidate when querying recent time windows (orders may still be settling).
- Wallet address format: Ensure wallet addresses are in the correct checksummed format (e.g., Ethereum addresses). Case-sensitive matching may apply.
-
Decimal precision: Parse
priceandsizefields as decimal types (Python’sDecimal, JavaScript’sBigNumber, etc.) to avoid floating-point precision loss. -
Handle retries: Implement exponential backoff for 429 and 503 responses. Check the
Retry-Afterheader for guidance.
