Wait Time Calculator API Documentation

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.

Available API Methods

Resource URL

http://wtc.votinginfoproject.org

Method Details

polllocations

Example Request

GET /api/polllocations?api_key=[YOUR_API_KEY]&latitude=40.2411&longitude=-76.9261

Parameters

Example Response

{
    "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"
        },
        ...
    ]
}

waittimes

Example Request

GET /api/waittimes?api_key=[YOUR_API_KEY]

Parameters

Calling this method with no parameters will return wait time statistics for the entire country. All wait times are returned in seconds.

Example Response

{
    "success": true,
    "response": {
        "average_wait_time": "1893.13",
        "max_wait_time": "3764.8",
        "min_wait_time": "120.11",
        "record_count": "12085"
    }
}

record

Example Request

POST /api/record?api_key=[YOUR_API_KEY]&wait_time=180.7&poll_location_id=5

Parameters

Example Response

{
    "success": true,
    "response": "Wait time recorded successfully."
}