Returns
Arguments
Query Example
Test this query in the Explorer → Fetch a single prediction market by its ID to get comprehensive market details including outcomes, categories, resolution status, and timestamps.Example Response
Example Response
Usage Guidelines
Market ID Format
Market IDs follow platform-specific formats:- Polymarket:
<marketAddress>:Polymarket:<exchangeAddress>:<networkId>(e.g.,0x25aa90b3cd98305e849189b4e8b770fc77fe89bccb7cf9656468414e01145d38:Polymarket:0xc5d563a36ae78145c45a50134d48a1215220f80a:137) - Kalshi:
<marketSlug>:Kalshi(e.g.,KXMVECROSSCATEGORY-S2026A4A05B370DF-F1FBA451AA9:Kalshi)
Batch Queries
You can query up to multiple markets in a single request by providing an array ofmarketIds. This is more efficient than making individual requests for each market. Consider batching when:
- Displaying multiple markets on a single page
- Comparing related markets
- Building dashboards or aggregated views
Timestamps
All timestamp fields are returned as Unix timestamps (seconds since epoch). Note:closesAt: When the market stops accepting new positionsresolvesAt: Expected resolution time (may differ from actual)resolvedAt: Actual resolution time (null if unresolved)
Troubleshooting
Why am I getting 'null' for some fields?
Why am I getting 'null' for some fields?
venueMarketSlug: Some markets don’t have slugseventId,venueEventId: Only present for markets that are part of a larger eventrules2: Secondary rules are optionalimageLargeUrl,imageThumbUrl,imageSmallUrl: Images are not requiredresolution: Only populated after market resolution
Market IDs not returning results
Market IDs not returning results
- Verify the market ID format is correct for the platform:
- Polymarket:
<marketAddress>:Polymarket:<exchangeAddress>:<networkId> - Kalshi:
<marketSlug>:Kalshi
- Polymarket:
- Ensure the market exists on the specified protocol (POLYMARKET or KALSHI)
- Check that you’re using the complete Codex market ID, not just the address portion
- The market may have been delisted or removed from the platform
- Try querying a known valid market ID to verify your API connection
Timestamps are showing incorrect dates
Timestamps are showing incorrect dates
- JavaScript: Use
new Date(timestamp * 1000)- multiply by 1000 to convert to milliseconds - Python: Use
datetime.fromtimestamp(timestamp) - Timezone: Timestamps are in UTC; convert to your local timezone for display
Categories or subcategories are empty
Categories or subcategories are empty
categories is null or empty:- The market hasn’t been assigned to a category yet
- The protocol doesn’t use categories for this market
- Categories may be updated over time as markets are reclassified
Protocol field shows POLYMARKET but I expected KALSHI
Protocol field shows POLYMARKET but I expected KALSHI
- Market IDs are protocol-specific and cannot be used interchangeably
- Verify you’re querying the correct market ID for your intended protocol
- The
protocolfield indicates the source platform, not your preference
Getting authentication or permission errors
Getting authentication or permission errors
- Verify your API key is valid and has the correct permissions
- Check your plan tier at dashboard.codex.io/dashboard/billing
- Ensure you’re including the Authorization header in your request
- Contact support if you believe you should have access