Introduction:
The Cook Political Report API is a simple RESTful API that provides CPR Race Ratings for US House, US Senate, and Governor elections. The House ratings API also includes the Cook PVI. The API requires HTTP basic authentication with an email and password to access the data. The data is returned in JSON format with a consistent structure for each endpoint.
The CPR Race Ratings are never updated more than one time a day, and, depending on the time within the election cycle, changes may be infrequent. Please limit API calls to once a day. Contact us for more guidance.
Learn more about how to request access to the CPR API.
Authentication:
The API uses basic HTTP authentication to restrict access to the data. To access the API, users must provide a valid email and password in the request headers.
Endpoints:
The API provides three endpoints to retrieve the current CPR Race Ratings for House (+ Cook PVI), Senate, and Governor elections. The endpoints are:
US House Endpoint:
The House endpoint provides the current CPR Race Ratings for US House elections. The response is returned in JSON format with the following structure:
{
"Title": "ME-01 2024",
"State": "Maine",
"District": "ME-01",
"Incumbent": "Chellie Pingree (D)",
"Cook_PVI": "D+9",
"Rating": "Solid D",
"Cycle": "2024",
"Rating_date": "2023-02-02T00:14:22"
}
US Senate Endpoint:
The Senate endpoint provides the current CPR Race Ratings for Senate elections. The response is returned in JSON format with the following structure:
{
"Title": "AZ Senate 2024",
"State": "Arizona",
"Incumbent": "Kyrsten Sinema (I)",
"Rating": "Toss Up"
}
Governor Endpoint:
The Governor endpoint provides the current CPR Race Ratings for Governor elections. The response is returned in JSON format with the following structure:
{
"Title": "KY Governor 2023",
"State": "Kentucky",
"Incumbent": "Andy Beshear (D)",
"Rating": "Lean D"
}
The meaning of each field is as follows:
- Title: the title of the election.
- State: the state in which the election is held.
- District: the district number in which the election is held.
- Incumbent: the name and party affiliation of the incumbent.
- Cook_PVI: the Cook Partisan Voting Index score for the district.
- Rating: the current CPR Race Rating for the election.
Subscribe Today
Our subscribers have first access to individual race pages for each House, Senate and Governors race, which will include race ratings (each race is rated on a seven-point scale) and a narrative analysis pertaining to that race.