import pmxt
# API key optional — enables faster catalog-backed lookups
exchange = pmxt.Polymarket(
pmxt_api_key="YOUR_PMXT_API_KEY",
)
result = exchange.fetch_markets(
query="election",
limit=10,
status="active",
){
"success": true,
"error": {
"message": "<string>",
"code": "HOSTED_TRADING_ERROR",
"retryable": true,
"exchange": "<string>",
"detail": {}
},
"data": [
{
"marketId": "<string>",
"title": "<string>",
"description": "<string>",
"outcomes": [
{
"outcomeId": "<string>",
"label": "<string>",
"price": 123,
"marketId": "<string>",
"priceChange24h": 123,
"metadata": {}
}
],
"volume24h": 123,
"liquidity": 123,
"url": "<string>",
"eventId": "<string>",
"slug": "<string>",
"resolutionDate": "2023-11-07T05:31:56Z",
"volume": 123,
"openInterest": 123,
"image": "<string>",
"category": "<string>",
"tags": [
"<string>"
],
"tickSize": 123,
"status": "<string>",
"contractAddress": "<string>",
"sourceMetadata": {},
"sourceExchange": "<string>",
"yes": {
"outcomeId": "<string>",
"label": "<string>",
"price": 123,
"marketId": "<string>",
"priceChange24h": 123,
"metadata": {}
},
"no": {
"outcomeId": "<string>",
"label": "<string>",
"price": 123,
"marketId": "<string>",
"priceChange24h": 123,
"metadata": {}
},
"up": {
"outcomeId": "<string>",
"label": "<string>",
"price": 123,
"marketId": "<string>",
"priceChange24h": 123,
"metadata": {}
},
"down": {
"outcomeId": "<string>",
"label": "<string>",
"price": 123,
"marketId": "<string>",
"priceChange24h": 123,
"metadata": {}
}
}
]
}Events & Markets
Fetch Markets
Fetch markets with optional filtering, search, or slug lookup. Always hits the exchange API — results reflect the live state at the time of the call.
GET
/
api
/
{exchange}
/
fetchMarkets
import pmxt
# API key optional — enables faster catalog-backed lookups
exchange = pmxt.Polymarket(
pmxt_api_key="YOUR_PMXT_API_KEY",
)
result = exchange.fetch_markets(
query="election",
limit=10,
status="active",
){
"success": true,
"error": {
"message": "<string>",
"code": "HOSTED_TRADING_ERROR",
"retryable": true,
"exchange": "<string>",
"detail": {}
},
"data": [
{
"marketId": "<string>",
"title": "<string>",
"description": "<string>",
"outcomes": [
{
"outcomeId": "<string>",
"label": "<string>",
"price": 123,
"marketId": "<string>",
"priceChange24h": 123,
"metadata": {}
}
],
"volume24h": 123,
"liquidity": 123,
"url": "<string>",
"eventId": "<string>",
"slug": "<string>",
"resolutionDate": "2023-11-07T05:31:56Z",
"volume": 123,
"openInterest": 123,
"image": "<string>",
"category": "<string>",
"tags": [
"<string>"
],
"tickSize": 123,
"status": "<string>",
"contractAddress": "<string>",
"sourceMetadata": {},
"sourceExchange": "<string>",
"yes": {
"outcomeId": "<string>",
"label": "<string>",
"price": 123,
"marketId": "<string>",
"priceChange24h": 123,
"metadata": {}
},
"no": {
"outcomeId": "<string>",
"label": "<string>",
"price": 123,
"marketId": "<string>",
"priceChange24h": 123,
"metadata": {}
},
"up": {
"outcomeId": "<string>",
"label": "<string>",
"price": 123,
"marketId": "<string>",
"priceChange24h": 123,
"metadata": {}
},
"down": {
"outcomeId": "<string>",
"label": "<string>",
"price": 123,
"marketId": "<string>",
"priceChange24h": 123,
"metadata": {}
}
}
]
}Faster with an API key — With a PMXT API key this endpoint is served from an indexed catalog (~10 ms) instead of proxying to the venue (~500 ms). No code changes required — same request, same response, just faster. Learn more.
Use cases
Search by keyword
Find all markets mentioning “bitcoin” on Polymarket:import pmxt
# Optional: pass pmxt_api_key for ~100x faster catalog-backed lookups
api = pmxt.Polymarket()
markets = api.fetch_markets(query="bitcoin", limit=5)
for market in markets:
print(market.title, market.yes.price)
import { Polymarket } from "pmxtjs";
// Optional: pass pmxtApiKey for ~100x faster catalog-backed lookups
const api = new Polymarket();
const markets = await api.fetchMarkets({ query: "bitcoin", limit: 5 });
markets.forEach((m) => console.log(m.title, m.yes.price));
curl "https://api.pmxt.dev/api/polymarket/fetchMarkets?query=bitcoin&limit=5" \
-H "Authorization: Bearer $PMXT_API_KEY"
Filter by category
Get all sports markets on Kalshi:import pmxt
api = pmxt.Kalshi()
markets = api.fetch_markets(category="Sports", limit=5)
import { Kalshi } from "pmxtjs";
const api = new Kalshi();
const markets = await api.fetchMarkets({ category: "Sports", limit: 5 });
curl "https://api.pmxt.dev/api/kalshi/fetchMarkets?category=Sports&limit=5" \
-H "Authorization: Bearer $PMXT_API_KEY"
Filter by tags
Get markets tagged with elections and Trump:import pmxt
api = pmxt.Polymarket()
markets = api.fetch_markets(tags=["Elections", "Trump"], limit=5)
import { Polymarket } from "pmxtjs";
const api = new Polymarket();
const markets = await api.fetchMarkets({
tags: ["Elections", "Trump"],
limit: 5,
});
curl "https://api.pmxt.dev/api/polymarket/fetchMarkets?tags=Elections&tags=Trump&limit=5" \
-H "Authorization: Bearer $PMXT_API_KEY"
Filter by status
Find active markets on Limitless:import pmxt
api = pmxt.Limitless()
markets = api.fetch_markets(
status="active",
limit=5,
)
import { Limitless } from "pmxtjs";
const api = new Limitless();
const markets = await api.fetchMarkets({
status: "active",
limit: 5,
});
curl "https://api.pmxt.dev/api/limitless/fetchMarkets?status=active&limit=5" \
-H "Authorization: Bearer $PMXT_API_KEY"
Path Parameters
Query Parameters
Response
200 - application/json
Fetch Markets response
Was this page helpful?

