π³ A simple API for US election deadline info π³
This is a static api, taken from the JSON file in dedline.io, that anyone can access for election information (Updated for 2026!)
Base URL: https://dedline-api.netlify.app/
Features:
- β All 50 states + DC
- β Primary and general election deadlines
- β Official voter registration websites
- β Same-day registration info
- β Online registration availability
- β Free and open source!
Check out dedline.io to see it in action, or use our embeddable widgets!
GET /states.json
Returns an array of all US states (including DC) with their voter registration information.
Example Request:
curl https://dedline-api.netlify.app/states.jsonResponse Format:
{
"states": [
{
"label": "California",
"value": "CA",
"deadline": "20261019",
"primaryDeadline": "20260518",
"primaryDate": "20260602",
"generalElectionDate": "20261103",
"url": "https://www.sos.ca.gov/elections/voter-registration/",
"onlineAccepted": true,
"lastMinuteAccepted": true,
"emoji": "π΄π΄π΄π΄π΄",
"notes": "In California, those convicted of felonies can register and vote after serving their sentence."
}
]
}Field Descriptions:
label- Full state name (string)value- Two-letter state abbreviation (string)deadline- General election voter registration deadline in YYYYMMDD format (string)primaryDeadline- Primary election voter registration deadline in YYYYMMDD format (string)primaryDate- Primary election date in YYYYMMDD format (string)generalElectionDate- General election date in YYYYMMDD format (string) - November 3, 2026 for most statesurl- Official state voter registration website (string)onlineAccepted- Whether voters can register online (boolean)lastMinuteAccepted- Whether voters can register on election day (boolean)emoji- State-themed emoji (string)notes- Additional details about state registration (string, optional)
GET /states/[STATE_ABBREVIATION].json
Returns voter registration information for a specific state.
Example Request:
curl https://dedline-api.netlify.app/states/ca.jsonResponse Format:
{
"label": "New York",
"value": "NY",
"deadline": "20261024",
"primaryDeadline": "20260528",
"primaryDate": "20260623",
"generalElectionDate": "20261103",
"url": "https://www.ny.gov/services/register-vote",
"onlineAccepted": true,
"lastMinuteAccepted": false,
"emoji": "π½π½π½π½π½",
"notes": "In New York, those with felony convictions get their voting rights restored after serving their sentence!"
}GET /lastMinuteAccepted.json
Returns states that allow voter registration on election day.
Example Request:
curl https://dedline-api.netlify.app/lastMinuteAccepted.jsonResponse Format:
['STATE', 'STATE_2', STATE_3']
GET /onlineNotAccepted.json
Returns states that require voters to register in person or by mail (no online registration available).
Example Request:
curl https://dedline-api.netlify.app/onlineNotAccepted.jsonResponse Format:
['STATE', 'STATE_2', STATE_3']
GET /upcoming.json
Returns states with primary or general registration deadlines in the next 30 days. Automatically switches from primary to general election deadlines after primary season ends.
Note: This endpoint is automatically updated daily via GitHub Actions.
Example Request:
curl https://dedline-api.netlify.app/upcoming.jsonResponse Format:
{
"primary": [
{
"state": "TX",
"label": "Texas",
"deadline": "20260202",
"daysUntil": 8
}
],
"general": []
}GET /stats.json
Returns summary statistics about voter registration across all states.
Example Request:
curl https://dedline-api.netlify.app/stats.jsonResponse Format:
{
"totalStates": 51,
"onlineRegistrationAvailable": 41,
"sameDayRegistrationAvailable": 21,
"lastUpdated": "2026-01-25"
}// Fetch all states
fetch('https://dedline-api.netlify.app/states.json')
.then(res => res.json())
.then(data => console.log(data.states));
// Fetch specific state
fetch('https://dedline-api.netlify.app/states/ny.json')
.then(res => res.json())
.then(data => console.log(data));import requests
# Fetch all states
response = requests.get('https://dedline-api.netlify.app/states.json')
states = response.json()['states']
# Fetch specific state
response = requests.get('https://dedline-api.netlify.app/states/ca.json')
california = response.json()- CORS: Enabled for all origins - safe to use from browsers
- Rate Limiting: Please be respectful with requests. This is a free, community resource!
If you use this API in your project, we'd appreciate a link back to dedline.io or this repository. Thanks for helping spread the word about voter registration! π³οΈ
Feel free to open any issues or ideas for new endpoints, new data to be added, etc!