{"openapi":"3.0.0","info":{"title":"Polymarket Events and Markets","version":"1.0.0","description":"Search Polymarket prediction events and markets with outcome prices, volume and liquidity, one row per entity."},"servers":[{"url":"https://ah-polymarket-com.opendata.best/s/polymarket-com"}],"paths":{"/v1/search":{"post":{"operationId":"search","summary":"Search prediction events by keyword","description":"Compact event rows matching a search query, with representative outcome prices where available. Fixed for this endpoint: mode=\"search\", includeMarkets=false, flattenMarkets=false, enrichPriceHistory=false.","tags":["search"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"query":{"type":"string","description":"Search query. Search text for search mode, e.g. bitcoin or election. With Auto mode, filling only this field runs a search.","example":"bitcoin"},"locale":{"type":"string","enum":["en","zh","es","de","fr","pt","ru","ko","ja"],"description":"Locale. Language code for supported titles and links: en, zh, es, de, fr, pt, ru, ko or ja. Availability varies; this does not select a country or translate your search words.","default":"en"},"maxResults":{"type":"integer","minimum":1,"maximum":20,"description":"Max rows per input (each listed URL, ID or keyword; a single target counts as one input). All row types share this allowance. Each plan caps the rows of one request (BASIC 10, PRO 70, ULTRA 200, MEGA 500); larger values are lowered to your plan's cap. You pay per delivered row (Rows).","default":10,"example":3},"requestId":{"type":"string","pattern":"^[A-Za-z0-9._:-]{1,80}$","description":"Optional. Your id for this request: repeating it while the job runs returns the same job."}}},"example":{"query":"bitcoin","maxResults":3}}}},"responses":{"200":{"description":"Done within the request: the rows.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RowsPage"}}}},"404":{"description":"No results matched the query (nothing was billed).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid or missing parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"At capacity, too many running jobs, or rolling 24-hour row limit reached; retry after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"The source could not be collected this time (not billed).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Synchronous timeout reached before completion; task cancelled (nothing was billed).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/events":{"post":{"operationId":"events","summary":"Browse prediction events or retrieve event details","description":"One compact event per row. Browse by tag or series, or choose event mode with an event slug or ID. No nested raw markets. Fixed for this endpoint: includeMarkets=false, flattenMarkets=false, enrichPriceHistory=false.","tags":["events"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"mode":{"type":"string","enum":["events","event"],"description":"Mode. Auto selects a mode from the fields you fill. A chosen mode is kept when its required target is present; otherwise another compatible mode or the example search may be selected.","default":"events"},"tagSlug":{"type":"string","description":"Tag / category slug. Category tag for event lists, such as politics, crypto or sports. An unfamiliar tag is still tried and may produce a warning."},"tagSlugs":{"type":"array","items":{"type":"string"},"description":"Multiple tag slugs. Collect events for each tag. Each tag gets its own maxResults row budget."},"seriesSlug":{"type":"string","description":"Series slug. Series identifier for event lists or series mode, such as nfl. Series-scoped events use offset pagination."},"sport":{"type":"string","description":"Sport code. Sport code, such as nba or ufc. Filters sports mode or supplies an event category when no tag is provided."},"eventSlug":{"type":"string","description":"Event slug. Event slug for event detail, comments or resolutions. Enter the slug, not the full URL."},"eventSlugs":{"type":"array","items":{"type":"string"},"description":"Event slugs (batch). Up to 50 event slugs for event detail, comments or resolutions. Each input has its own maxResults allowance."},"eventId":{"type":"string","description":"Event ID. Polymarket event ID for event detail, comments or resolutions."},"eventIds":{"type":"array","items":{"type":"string"},"description":"Event IDs (batch). Up to 50 Polymarket event IDs for event detail, comments or resolutions. Each input has its own maxResults allowance."},"locale":{"type":"string","enum":["en","zh","es","de","fr","pt","ru","ko","ja"],"description":"Locale. Language code for supported titles and links: en, zh, es, de, fr, pt, ru, ko or ja. Availability varies; this does not select a country or translate your search words.","default":"en"},"order":{"type":"string","enum":["volume24hr","volume","liquidity","competitive","startDate","endDate"],"description":"Sort order field. Sort field for event lists. Market lists do not apply this setting.","default":"volume24hr"},"ascending":{"type":"boolean","description":"Ascending sort. Use ascending order for event lists when true.","default":false},"closed":{"type":"boolean","description":"Closed filter. Request closed events or markets when true; false requests open entries where supported. Offset and series-scoped event lists do not enforce false.","default":false},"active":{"type":"boolean","description":"Active filter. Filter events and markets by active status when set. Leave unset for no activity filter."},"featured":{"type":"boolean","description":"Featured filter. Filter event lists by featured status when set. Leave unset for no featured filter."},"maxResults":{"type":"integer","minimum":1,"maximum":20,"description":"Max rows per input (each listed URL, ID or keyword; a single target counts as one input). All row types share this allowance. Each plan caps the rows of one request (BASIC 10, PRO 70, ULTRA 200, MEGA 500); larger values are lowered to your plan's cap. You pay per delivered row (Rows).","default":10,"example":3},"requestId":{"type":"string","pattern":"^[A-Za-z0-9._:-]{1,80}$","description":"Optional. Your id for this request: repeating it while the job runs returns the same job."}}},"example":{"tagSlug":"crypto","maxResults":3}}}},"responses":{"200":{"description":"Done within the request: the rows.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RowsPage"}}}},"404":{"description":"No results matched the query (nothing was billed).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid or missing parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"At capacity, too many running jobs, or rolling 24-hour row limit reached; retry after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"The source could not be collected this time (not billed).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Synchronous timeout reached before completion; task cancelled (nothing was billed).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/markets":{"post":{"operationId":"markets","summary":"List prediction markets and outcome prices","description":"One prediction market per row, with outcome prices, volume and liquidity where available. Fixed for this endpoint: mode=\"markets\", includeMarkets=false, flattenMarkets=false, enrichPriceHistory=false.","tags":["markets"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"locale":{"type":"string","enum":["en","zh","es","de","fr","pt","ru","ko","ja"],"description":"Locale. Language code for supported titles and links: en, zh, es, de, fr, pt, ru, ko or ja. Availability varies; this does not select a country or translate your search words.","default":"en"},"closed":{"type":"boolean","description":"Closed filter. Request closed events or markets when true; false requests open entries where supported. Offset and series-scoped event lists do not enforce false.","default":false},"active":{"type":"boolean","description":"Active filter. Filter events and markets by active status when set. Leave unset for no activity filter."},"maxResults":{"type":"integer","minimum":1,"maximum":20,"description":"Max rows per input (each listed URL, ID or keyword; a single target counts as one input). All row types share this allowance. Each plan caps the rows of one request (BASIC 10, PRO 70, ULTRA 200, MEGA 500); larger values are lowered to your plan's cap. You pay per delivered row (Rows).","default":10,"example":3},"requestId":{"type":"string","pattern":"^[A-Za-z0-9._:-]{1,80}$","description":"Optional. Your id for this request: repeating it while the job runs returns the same job."}}},"example":{"active":true,"closed":false,"maxResults":3}}}},"responses":{"200":{"description":"Done within the request: the rows.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RowsPage"}}}},"404":{"description":"No results matched the query (nothing was billed).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid or missing parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"At capacity, too many running jobs, or rolling 24-hour row limit reached; retry after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"The source could not be collected this time (not billed).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Synchronous timeout reached before completion; task cancelled (nothing was billed).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/health":{"get":{"operationId":"health","summary":"API health check","description":"Lightweight readiness check for this API. Never starts a collection and always bills 0 rows.","tags":["health"],"responses":{"200":{"description":"API is operational (0 rows).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthStatus"}}}},"503":{"description":"API is temporarily unavailable (not billed).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthStatus"}}}}}}}},"components":{"schemas":{"Row":{"type":"object","properties":{"seriesSlug":{"nullable":true,"type":"string"},"type":{"nullable":true,"type":"string"},"id":{"nullable":true,"type":"string"},"slug":{"nullable":true,"type":"string"},"title":{"nullable":true,"type":"string"},"question":{"nullable":true,"type":"string"},"description":{"nullable":true,"type":"string"},"url":{"nullable":true,"type":"string"},"locale":{"nullable":true,"type":"string"},"volume":{"nullable":true},"volume24hr":{"nullable":true},"liquidity":{"nullable":true},"marketCount":{"nullable":true,"type":"integer"},"negRisk":{"nullable":true,"type":"boolean"},"liquidityClob":{"nullable":true},"volumeClob":{"nullable":true},"competitive":{"nullable":true},"updatedAt":{"nullable":true,"type":"string"},"gameId":{"nullable":true,"type":"string"},"live":{"nullable":true,"type":"boolean"},"ended":{"nullable":true,"type":"boolean"},"closed":{"nullable":true,"type":"boolean"},"active":{"nullable":true,"type":"boolean"},"endDate":{"nullable":true,"type":"string"},"topOutcomes":{"type":"array","items":{"type":"object"}}},"additionalProperties":true,"description":"One collected entity. Field availability depends on rowType and the source. Fields always present (a|b = at least one of them): every row: id; rowType=event: id, title, slug, url."},"Error":{"type":"object","required":["error"],"properties":{"error":{"$ref":"#/components/schemas/ErrorDetail"}}},"ErrorDetail":{"type":"object","required":["code","message","retryable"],"properties":{"code":{"type":"string","example":"invalid_input"},"message":{"type":"string"},"retryable":{"type":"boolean"}}},"JobStatus":{"type":"object","properties":{"jobId":{"type":"string"},"status":{"type":"string","enum":["queued","running","succeeded","partial","failed","cancelled"]},"done":{"type":"boolean"},"rowsAvailable":{"type":"integer"},"rowsDelivered":{"type":"integer","description":"Rows already delivered (and billed) to you for this job."},"rowsLimit":{"type":"integer","description":"Most rows this job can deliver."},"estimatedFinishSec":{"type":"integer","description":"While running: estimated seconds until done."},"statusUrl":{"type":"string"},"resultsUrl":{"type":"string"},"expiresAt":{"type":"string","format":"date-time"},"retentionHours":{"type":"integer"},"error":{"$ref":"#/components/schemas/ErrorDetail"}}},"RowsPage":{"allOf":[{"$ref":"#/components/schemas/JobStatus"},{"type":"object","properties":{"offset":{"type":"integer"},"nextOffset":{"type":"integer"},"hasMore":{"type":"boolean"},"rowCount":{"type":"integer"},"rowsBilled":{"type":"integer","description":"Rows delivered by this response."},"rows":{"type":"array","items":{"$ref":"#/components/schemas/Row"}},"meta":{"type":"object","additionalProperties":true}}}]},"HealthStatus":{"type":"object","required":["ok","site","status","endpoints","rowsBilled"],"properties":{"ok":{"type":"boolean"},"site":{"type":"string"},"status":{"type":"string","enum":["operational","unavailable"]},"endpoints":{"type":"array","items":{"type":"string"}},"rowsBilled":{"type":"integer"}}}}}}