This document defines the Wait Time Calculator API, which can be used by developers to create applications that report polling location wait times. Currently, the API returns results in JSON format only.
http://wtc.votinginfoproject.org
GET /api/polllocations?api_key=[YOUR_API_KEY]&latitude=40.2411&longitude=-76.9261
{
"success": true,
"response": [
{
"id": "43",
"locationName": "MUNICIPAL SERVICES CENTER",
"line1": "2233 GETTYSBURG RD",
"line2": "",
"city": "CAMP HILL",
"state": "PA",
"zip": "17011",
"latitude": "40.2303",
"longitude": "-76.9189"
},
{
"id": "1",
"locationName": "FREDRICKSEN LIBRARY",
"line1": "100 N 19TH ST",
"line2": "",
"city": "CAMP HILL",
"state": "PA",
"zip": "17011",
"latitude": "40.2309",
"longitude": "-76.9101"
},
...
]
}
GET /api/waittimes?api_key=[YOUR_API_KEY]
Calling this method with no parameters will return wait time statistics for the entire country. All wait times are returned in seconds.
{
"success": true,
"response": {
"average_wait_time": "1893.13",
"max_wait_time": "3764.8",
"min_wait_time": "120.11",
"record_count": "12085"
}
}
POST /api/record?api_key=[YOUR_API_KEY]&wait_time=180.7&poll_location_id=5
{
"success": true,
"response": "Wait time recorded successfully."
}