{"openapi":"3.1.0","info":{"title":"Poll Results API","version":"1.0.0","description":"Political poll results (approval, president, senate, house, governor, other), synced from the New York Times."},"components":{"schemas":{},"parameters":{}},"paths":{"/v1.0/politics/results":{"get":{"tags":["Politics"],"summary":"List available poll types","operationId":"get_ListPollTypes","responses":{"200":{"description":"Poll types currently available in the store","content":{"application/json":{"schema":{"type":"object","properties":{"source":{"type":"string"},"license":{"type":"string"},"types":{"type":"array","items":{"type":"string"},"description":"e.g. approval, president, senate, house, governor, other"}},"required":["source","license","types"]}}}}}}},"/v1.0/politics/results/{type}":{"get":{"tags":["Politics"],"summary":"Get paginated poll results for a type (or `all` to merge every type), optionally filtered by state/district","operationId":"get_GetPollResults","parameters":[{"schema":{"type":"string","enum":["approval","president","senate","house","governor","other","all"],"description":"Poll category, or `all` to merge every category"},"required":true,"description":"Poll category, or `all` to merge every category","name":"type","in":"path"},{"schema":{"type":"string","minLength":2,"maxLength":2,"description":"Two-letter state code filter, e.g. NC"},"required":false,"description":"Two-letter state code filter, e.g. NC","name":"state","in":"query"},{"schema":{"type":"string","description":"Congressional district / seat number filter (house only)"},"required":false,"description":"Congressional district / seat number filter (house only)","name":"district","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":10,"description":"Max results per page (1-100)"},"required":false,"description":"Max results per page (1-100)","name":"limit","in":"query"},{"schema":{"type":"string","description":"Opaque cursor from a previous response's `cursor` field (anchored to the poll's posted-at timestamp + ID, stable and sorted newest-posted-first even as new polls come in)"},"required":false,"description":"Opaque cursor from a previous response's `cursor` field (anchored to the poll's posted-at timestamp + ID, stable and sorted newest-posted-first even as new polls come in)","name":"cursor","in":"query"}],"responses":{"200":{"description":"Paginated poll results","content":{"application/json":{"schema":{"type":"object","properties":{"source":{"type":"string"},"license":{"type":"string"},"results":{"type":"array","items":{"type":"object","additionalProperties":{},"description":"A single poll, grouped into questions -> answers"}},"limit":{"type":"integer"},"count":{"type":"integer"},"total":{"type":"integer"},"cursor":{"type":["string","null"],"description":"Opaque cursor to fetch the next page, or null if there are no more results"}},"required":["source","license","results","limit","count","total","cursor"]}}}},"404":{"description":"Unknown poll type","content":{"application/json":{"schema":{"type":"object","properties":{"source":{"type":"string"},"license":{"type":"string"},"error":{"type":"string"}},"required":["source","license","error"]}}}}}}},"/v1.0/feed.xml":{"get":{"operationId":"get_getPollsFeed","responses":{"200":{"description":"Successful response."}}}}},"webhooks":{}}