import pmxt
# API key optional — enables faster catalog-backed lookups
exchange = pmxt.Polymarket(
pmxt_api_key="YOUR_PMXT_API_KEY",
)
result = exchange.fetch_events(
query="election",
limit=10,
status="active",
)
{
"success": true,
"error": {
"message": "<string>",
"code": "HOSTED_TRADING_ERROR",
"retryable": true,
"exchange": "<string>",
"detail": {}
},
"data": [
{
"id": "<string>",
"title": "<string>",
"description": "<string>",
"slug": "<string>",
"markets": [
{
"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": {}
}
}
],
"volume24h": 123,
"url": "<string>",
"volume": 123,
"image": "<string>",
"category": "<string>",
"tags": [
"<string>"
],
"sourceMetadata": {},
"sourceExchange": "<string>"
}
]
}Events & Markets
Fetch Events
Fetch events with optional keyword search. Events group related markets together (e.g., “Who will be Fed Chair?” contains multiple candidate markets).
GET
/
api
/
{exchange}
/
fetchEvents
import pmxt
# API key optional — enables faster catalog-backed lookups
exchange = pmxt.Polymarket(
pmxt_api_key="YOUR_PMXT_API_KEY",
)
result = exchange.fetch_events(
query="election",
limit=10,
status="active",
)
{
"success": true,
"error": {
"message": "<string>",
"code": "HOSTED_TRADING_ERROR",
"retryable": true,
"exchange": "<string>",
"detail": {}
},
"data": [
{
"id": "<string>",
"title": "<string>",
"description": "<string>",
"slug": "<string>",
"markets": [
{
"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": {}
}
}
],
"volume24h": 123,
"url": "<string>",
"volume": 123,
"image": "<string>",
"category": "<string>",
"tags": [
"<string>"
],
"sourceMetadata": {},
"sourceExchange": "<string>"
}
]
}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 events mentioning “Trump” on Polymarket:import pmxt
# Optional: pass pmxt_api_key for ~100x faster catalog-backed lookups
api = pmxt.Polymarket()
events = api.fetch_events(query="trump", limit=5)
for event in events:
print(event.title, event.url)
import { Polymarket } from "pmxtjs";
// Optional: pass pmxtApiKey for ~100x faster catalog-backed lookups
const api = new Polymarket();
const events = await api.fetchEvents({ query: "trump", limit: 5 });
events.forEach((e) => console.log(e.title, e.url));
curl "https://api.pmxt.dev/api/polymarket/fetchEvents?query=trump&limit=5" \
-H "Authorization: Bearer $PMXT_API_KEY"
Filter by category
Get all crypto-related events on Kalshi:import pmxt
api = pmxt.Limitless()
events = api.fetch_events(category="Crypto", limit=5)
import { Limitless } from "pmxtjs";
const api = new Limitless();
const events = await api.fetchEvents({ category: "Crypto", limit: 5 });
curl "https://api.pmxt.dev/api/limitless/fetchEvents?category=Crypto&limit=5" \
-H "Authorization: Bearer $PMXT_API_KEY"
Filter by tags
Get events tagged with geopolitics:import pmxt
api = pmxt.Polymarket()
events = api.fetch_events(tags=["Geopolitics", "Middle East"], limit=5)
import { Polymarket } from "pmxtjs";
const api = new Polymarket();
const events = await api.fetchEvents({
tags: ["Geopolitics", "Middle East"],
limit: 5,
});
curl "https://api.pmxt.dev/api/polymarket/fetchEvents?tags=Geopolitics&tags=Middle+East&limit=5" \
-H "Authorization: Bearer $PMXT_API_KEY"
Filter active by category
Find active sports events:import pmxt
api = pmxt.Polymarket()
events = api.fetch_events(
category="Sports",
status="active",
limit=5,
)
import { Polymarket } from "pmxtjs";
const api = new Polymarket();
const events = await api.fetchEvents({
category: "Sports",
status: "active",
limit: 5,
});
curl "https://api.pmxt.dev/api/polymarket/fetchEvents?category=Sports&status=active&limit=5" \
-H "Authorization: Bearer $PMXT_API_KEY"
Path Parameters
Query Parameters
Filter by tags. Returns events matching ANY of the provided tags. Tags are more specific than categories -- for example a "Politics" event might carry tags ["Politics", "Geopolitics", "Middle East", "Iran"]. Common tags include "Crypto", "Elections", "Fed Rates", "FIFA World Cup", "Trump".
Response
200 - application/json
Fetch Events response
Was this page helpful?

