Where Do I Vote?

wheredoivote.co.uk Beta API

Open access to the data powering wheredoivote.co.uk: A website to help people in the UK find their polling station, built by Democracy Club.

More information about the project is available on our website

Note this API is currently in beta and outputs are subject to change.

Usage restrictions

Anonymous users are limited to 1,000 requests per day. If you need a higher limit, please contact us to discuss your usage and obtain an API key.

API Root 

API Root 

/.json

The initial API entry point for discovering endpoints.

Retrieve the Entry Point 

Request GET /.json
Response 200
Headers:
Content-Type: application/json
Body:
{
  "councils": "https://wheredoivote.co.uk/api/beta/councils.json",
  "pollingstations": "https://wheredoivote.co.uk/api/beta/pollingstations.json",
  "pollingdistricts": "https://wheredoivote.co.uk/api/beta/pollingdistricts.json"
}

Polling Station Finder 

The /postcode and /address endpoints find a user's polling station based on their home address. This allows you to leverage Democracy Club's data to integrate a polling station finder into your website or app.

A 200 OK response from /postcode or /address is an object containing the following top-level keys:

  • polling_station_known: (boolean) - Do we know where this user should vote?

  • postcode_location: (object, nullable) - A GeoJSON Feature containing a Point object describing the centroid of the input postcode.

  • polling_station: (object, nullable) - A GeoJSON polling station feature

  • addresses: (array) - An array of address objects listing the addresses applicable to this request (if necessary).

  • council: (object, nullable) - A Council object describing the local authority which covers this postcode. If we do not know the user's polling station, this can be used to provide contact info for their local council. Council may be null if we are not able to determine the user's council.

  • custom_finder: (string, nullable) - If we don't know a user's polling station, sometimes we can provide the URL of a polling station finder provided by their local council.

  • report_problem_url: (string, nullable) - If we provide a polling station result, this URL may be used to provide a user with a back-channel to report inaccurate data.

  • metadata: (object, nullable) - This field may be used to supply additional information about an election, particularly if there is some unusual condition or event for voters to be aware of.

Postcode search 

/postcode/{postcode}.json

Parameters

  • postcode string ( required )

    Whitespace in postcodes is ignored, so format may be SW1A1AA or SW1A 1AA

    Example: SW1A1AA

The entry point to a polling station search is a call to the /postcode endpoint. A valid postcode search may result in one of 3 outcomes:

  • We hold data for this area and all voters with this postcode vote at the same polling station.

  • We hold data for this area but voters with this postcode don't all vote at the same polling station. To find the user's polling station, we must make a second API call to the /address endpoint.

  • We do not hold data for this area.

Postcode search 

Request GET /postcode/{postcode}.json
Response 200
Headers:
Content-Type: application/json

When we hold data for this area and all voters with this postcode vote at the same polling station, the following conditions can be observed in the response body:

Body:
{
    "polling_station_known": true,
    "postcode_location": {
        "properties": null,
        "geometry": {
            "type": "Point",
            "coordinates": [
                -1.2491514412601963,
                53.09878716696975
            ]
        },
        "type": "Feature"
    },
    "custom_finder": null,
    "addresses": [],
    "polling_station": {
        "geometry": {
            "type": "Point",
            "coordinates": [
                -1.248013,
                53.100064
            ]
        },
        "type": "Feature",
        "id": "E07000170.KXP3",
        "properties": {
            "address": "Councillors' Room, ADC Offices\nUrban Road, Kirkby in Ashfield",
            "station_id": "KXP3",
            "council": "https://wheredoivote.co.uk/api/beta/councils/W06000015/",
            "urls": {
                "geo": "https://wheredoivote.co.uk/api/beta/pollingstations/geo/?station_id=KXP3&council_id=E07000170",
                "detail": "https://wheredoivote.co.uk/api/beta/pollingstations/?station_id=KXP3&council_id=E07000170"
            },
            "postcode": ""
        }
    },
    "council": {
        "url": "https://wheredoivote.co.uk/api/beta/councils/E07000170/",
        "council_id": "E07000170",
        "name": "Ashfield District Council",
        "email": "regelec@ashfield-dc.gov.uk",
        "phone": "01623 457321",
        "website": "http://www.ashfield-dc.gov.uk/residents/democracy,-elections-and-legal/elections/registering-to-vote.aspx",
        "postcode": "NG17 8DA",
        "address": "Ashfield District Council\nCouncil Offices\nUrban Road\nKirkby-in-Ashfield\nNottingham"
    },
    "report_problem_url": "https://wheredoivote.co.uk/report_problem/?source=api&source_url=%2Fapi%2Fbeta%2FTEST.json",
    "metadata": null
}
Schema:
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "polling_station_known": {
      "type": "boolean",
      "description": "Do we know where this user should vote?"
    },
    "postcode_location": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "geometry": {
          "type": "object",
          "properties": {
            "type": {
              "type": "string"
            },
            "coordinates": {}
          },
          "description": "A GeoJSON Point object describing the centroid of the input postcode"
        },
        "type": {
          "type": "string"
        },
        "properties": {
          "type": [
            "object",
            "null"
          ]
        }
      },
      "description": "A GeoJSON Feature containing a Point object describing the centroid of the input postcode."
    },
    "polling_station": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "geometry": {
          "type": [
            "object",
            "null"
          ],
          "properties": {
            "type": {
              "type": "string"
            },
            "coordinates": {
              "type": "array"
            }
          },
          "description": "A GeoJSON Point object describing the location of this polling station. Optionally null if we do not hold this information"
        },
        "type": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "properties": {
          "type": "object",
          "properties": {
            "urls": {
              "type": "object",
              "properties": {
                "detail": {
                  "type": "string",
                  "description": "URL to retrieve JSON meta-data about this polling station"
                },
                "geo": {
                  "type": "string",
                  "description": "URL to retrieve GeoJSON feature describing this polling station"
                }
              }
            },
            "council": {
              "type": "string",
              "description": "URL to retrieve JSON meta-data about the council which administers this polling station"
            },
            "station_id": {
              "type": "string",
              "description": "An identifier for this polling station. Station IDs are unique within councils, but are not unique nationally"
            },
            "address": {
              "type": "string",
              "description": "Address for this polling station"
            },
            "postcode": {
              "type": "string",
              "description": "Postcode for this polling station"
            }
          }
        }
      },
      "description": "A GeoJSON polling station feature"
    },
    "addresses": {
      "description": "An array of address objects listing the addresses applicable to this request (if necessary)."
    },
    "council": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "url": {
          "type": "string",
          "description": "URL for this resource"
        },
        "council_id": {
          "type": "string",
          "description": "GSS code for this council"
        },
        "name": {
          "type": "string",
          "description": "Name of this council"
        },
        "address": {
          "type": "string",
          "description": "Contact address for this council"
        },
        "postcode": {
          "type": "string",
          "description": "Postcode component of contact address for this council"
        },
        "email": {
          "type": "string",
          "description": "Contact email address for this council's Electoral Services team"
        },
        "phone": {
          "type": "string",
          "description": "Telephone number for this council's Electoral Services team"
        },
        "website": {
          "type": "string",
          "description": "URL for this council's website"
        }
      },
      "description": "A Council object describing the local authority which covers this postcode. If we do not know the user's polling station, this can be used to provide contact info for their local council."
    },
    "custom_finder": {
      "type": [
        "string",
        "null"
      ],
      "description": "If we don't know a user's polling station, sometimes we can provide the URL of a polling station finder provided by their local council."
    },
    "report_problem_url": {
      "type": [
        "string",
        "null"
      ],
      "description": "If we provide a polling station result, this URL may be used to provide a user with a back-channel to report inaccurate data."
    },
    "metadata": {
      "type": [
        "object",
        "null"
      ],
      "description": "This field may be used to supply additional information about an election."
    },
  }
}
Request GET /postcode/{postcode}.json
Response 200
Headers:
Content-Type: application/json

When we hold data for this area but voters with this postcode don't all vote at the same polling station, the following conditions can be observed in the response body:

  • polling_station_known is false

  • polling_station is null

  • addresses is an array of address objects covered by the input postcode. This can be used to request the user's address and make a second API call to the /address endpoint.

Body:
{
    "polling_station_known": false,
    "postcode_location": {
        "properties": null,
        "geometry": {
            "type": "Point",
            "coordinates": [
                -0.26353977212676555,
                50.84477241345472
            ]
        },
        "type": "Feature"
    },
    "custom_finder": null,
    "addresses": [
        {
            "url": "https://wheredoivote.co.uk/api/beta/address/e07000223-527-5-truleigh-way-shoreham-by-sea-west-sussex-bn436hw/",
            "polling_station_id": "527",
            "postcode": "BN436HW",
            "council": "https://wheredoivote.co.uk/api/beta/councils/E07000223/",
            "address": "5 Truleigh Way, Shoreham-by-Sea, West Sussex"
        },
        {
            "url": "https://wheredoivote.co.uk/api/beta/address/e07000223-524-2-truleigh-way-shoreham-by-sea-west-sussex-bn436hw/",
            "polling_station_id": "524",
            "postcode": "BN436HW",
            "council": "https://wheredoivote.co.uk/api/beta/councils/E07000223/",
            "address": "2 Truleigh Way, Shoreham-by-Sea, West Sussex"
        },
        {
            "url": "https://wheredoivote.co.uk/api/beta/address/e07000223-527-3-truleigh-way-shoreham-by-sea-west-sussex-bn436hw/",
            "polling_station_id": "527",
            "postcode": "BN436HW",
            "council": "https://wheredoivote.co.uk/api/beta/councils/E07000223/",
            "address": "3 Truleigh Way, Shoreham-by-Sea, West Sussex"
        },
        {
            "url": "https://wheredoivote.co.uk/api/beta/address/e07000223-527-1-truleigh-way-shoreham-by-sea-west-sussex-bn436hw/",
            "polling_station_id": "527",
            "postcode": "BN436HW",
            "council": "https://wheredoivote.co.uk/api/beta/councils/E07000223/",
            "address": "1 Truleigh Way, Shoreham-by-Sea, West Sussex"
        },
        {
            "url": "https://wheredoivote.co.uk/api/beta/address/e07000223-524-4-truleigh-way-shoreham-by-sea-west-sussex-bn436hw/",
            "polling_station_id": "524",
            "postcode": "BN436HW",
            "council": "https://wheredoivote.co.uk/api/beta/councils/E07000223/",
            "address": "4 Truleigh Way, Shoreham-by-Sea, West Sussex"
        },
        {
            "url": "https://wheredoivote.co.uk/api/beta/address/e07000223-524-6-truleigh-way-shoreham-by-sea-west-sussex-bn436hw/",
            "polling_station_id": "524",
            "postcode": "BN436HW",
            "council": "https://wheredoivote.co.uk/api/beta/councils/E07000223/",
            "address": "6 Truleigh Way, Shoreham-by-Sea, West Sussex"
        }
    ],
    "polling_station": null,
    "council": {
        "website": "http://adur-worthing.gov.uk/elections-and-voting/register-to-vote/",
        "name": "Adur District Council",
        "phone": "01903 221014/5/6",
        "url": "https://wheredoivote.co.uk/api/beta/councils/E07000223/",
        "council_id": "E07000223",
        "postcode": "BN11 1HA",
        "address": "Adur District Council\nTown Hall\nChapel Road\nWorthing\nWest Sussex",
        "email": "elections@adur-worthing.gov.uk"
    },
    "report_problem_url": null,
    "metadata": null
}
Schema:
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "polling_station_known": {
      "type": "boolean",
      "description": "Do we know where this user should vote?"
    },
    "postcode_location": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "geometry": {
          "type": "object",
          "properties": {
            "type": {
              "type": "string"
            },
            "coordinates": {}
          },
          "description": "A GeoJSON Point object describing the centroid of the input postcode"
        },
        "type": {
          "type": "string"
        },
        "properties": {
          "type": [
            "object",
            "null"
          ]
        }
      },
      "description": "A GeoJSON Feature containing a Point object describing the centroid of the input postcode."
    },
    "polling_station": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "geometry": {
          "type": [
            "object",
            "null"
          ],
          "properties": {
            "type": {
              "type": "string"
            },
            "coordinates": {
              "type": "array"
            }
          },
          "description": "A GeoJSON Point object describing the location of this polling station. Optionally null if we do not hold this information"
        },
        "type": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "properties": {
          "type": "object",
          "properties": {
            "urls": {
              "type": "object",
              "properties": {
                "detail": {
                  "type": "string",
                  "description": "URL to retrieve JSON meta-data about this polling station"
                },
                "geo": {
                  "type": "string",
                  "description": "URL to retrieve GeoJSON feature describing this polling station"
                }
              }
            },
            "council": {
              "type": "string",
              "description": "URL to retrieve JSON meta-data about the council which administers this polling station"
            },
            "station_id": {
              "type": "string",
              "description": "An identifier for this polling station. Station IDs are unique within councils, but are not unique nationally"
            },
            "address": {
              "type": "string",
              "description": "Address for this polling station"
            },
            "postcode": {
              "type": "string",
              "description": "Postcode for this polling station"
            }
          }
        }
      },
      "description": "A GeoJSON polling station feature"
    },
    "addresses": {
      "description": "An array of address objects listing the addresses applicable to this request (if necessary)."
    },
    "council": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "url": {
          "type": "string",
          "description": "URL for this resource"
        },
        "council_id": {
          "type": "string",
          "description": "GSS code for this council"
        },
        "name": {
          "type": "string",
          "description": "Name of this council"
        },
        "address": {
          "type": "string",
          "description": "Contact address for this council"
        },
        "postcode": {
          "type": "string",
          "description": "Postcode component of contact address for this council"
        },
        "email": {
          "type": "string",
          "description": "Contact email address for this council's Electoral Services team"
        },
        "phone": {
          "type": "string",
          "description": "Telephone number for this council's Electoral Services team"
        },
        "website": {
          "type": "string",
          "description": "URL for this council's website"
        }
      },
      "description": "A Council object describing the local authority which covers this postcode. If we do not know the user's polling station, this can be used to provide contact info for their local council."
    },
    "custom_finder": {
      "type": [
        "string",
        "null"
      ],
      "description": "If we don't know a user's polling station, sometimes we can provide the URL of a polling station finder provided by their local council."
    },
    "report_problem_url": {
      "type": [
        "string",
        "null"
      ],
      "description": "If we provide a polling station result, this URL may be used to provide a user with a back-channel to report inaccurate data."
    },
    "metadata": {
      "type": [
        "object",
        "null"
      ],
      "description": "This field may be used to supply additional information about an election."
    },
  }
}
Request GET /postcode/{postcode}.json
Response 200
Headers:
Content-Type: application/json

When we do not hold data for the area described by the postcode provided, the following conditions can be observed in the response body:

  • polling_station_known is false

  • polling_station is null

  • addresses is an empty array

Body:
{
    "polling_station_known": false,
    "postcode_location": {
        "properties": null,
        "geometry": {
            "type": "Point",
            "coordinates": [
                -0.14320717529002294,
                51.50086373251905
            ]
        },
        "type": "Feature"
    },
    "custom_finder": null,
    "addresses": [],
    "polling_station": null,
    "council": {
        "website": "https://www.westminster.gov.uk/contact-electoral-services",
        "name": "Westminster City Council",
        "phone": "020 7641 2730",
        "url": "https://wheredoivote.co.uk/api/beta/councils/E09000033/",
        "council_id": "E09000033",
        "postcode": "SW1E 6QP",
        "address": "Westminster City Council\nElectoral Services\nWestminster City Hall\n64 Victoria Street\nLondon",
        "email": "electoralservices@westminster.gov.uk"
    },
    "report_problem_url": null,
    "metadata": null
}
Schema:
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "polling_station_known": {
      "type": "boolean",
      "description": "Do we know where this user should vote?"
    },
    "postcode_location": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "geometry": {
          "type": "object",
          "properties": {
            "type": {
              "type": "string"
            },
            "coordinates": {}
          },
          "description": "A GeoJSON Point object describing the centroid of the input postcode"
        },
        "type": {
          "type": "string"
        },
        "properties": {
          "type": [
            "object",
            "null"
          ]
        }
      },
      "description": "A GeoJSON Feature containing a Point object describing the centroid of the input postcode."
    },
    "polling_station": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "geometry": {
          "type": [
            "object",
            "null"
          ],
          "properties": {
            "type": {
              "type": "string"
            },
            "coordinates": {
              "type": "array"
            }
          },
          "description": "A GeoJSON Point object describing the location of this polling station. Optionally null if we do not hold this information"
        },
        "type": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "properties": {
          "type": "object",
          "properties": {
            "urls": {
              "type": "object",
              "properties": {
                "detail": {
                  "type": "string",
                  "description": "URL to retrieve JSON meta-data about this polling station"
                },
                "geo": {
                  "type": "string",
                  "description": "URL to retrieve GeoJSON feature describing this polling station"
                }
              }
            },
            "council": {
              "type": "string",
              "description": "URL to retrieve JSON meta-data about the council which administers this polling station"
            },
            "station_id": {
              "type": "string",
              "description": "An identifier for this polling station. Station IDs are unique within councils, but are not unique nationally"
            },
            "address": {
              "type": "string",
              "description": "Address for this polling station"
            },
            "postcode": {
              "type": "string",
              "description": "Postcode for this polling station"
            }
          }
        }
      },
      "description": "A GeoJSON polling station feature"
    },
    "addresses": {
      "description": "An array of address objects listing the addresses applicable to this request (if necessary)."
    },
    "council": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "url": {
          "type": "string",
          "description": "URL for this resource"
        },
        "council_id": {
          "type": "string",
          "description": "GSS code for this council"
        },
        "name": {
          "type": "string",
          "description": "Name of this council"
        },
        "address": {
          "type": "string",
          "description": "Contact address for this council"
        },
        "postcode": {
          "type": "string",
          "description": "Postcode component of contact address for this council"
        },
        "email": {
          "type": "string",
          "description": "Contact email address for this council's Electoral Services team"
        },
        "phone": {
          "type": "string",
          "description": "Telephone number for this council's Electoral Services team"
        },
        "website": {
          "type": "string",
          "description": "URL for this council's website"
        }
      },
      "description": "A Council object describing the local authority which covers this postcode. If we do not know the user's polling station, this can be used to provide contact info for their local council."
    },
    "custom_finder": {
      "type": [
        "string",
        "null"
      ],
      "description": "If we don't know a user's polling station, sometimes we can provide the URL of a polling station finder provided by their local council."
    },
    "report_problem_url": {
      "type": [
        "string",
        "null"
      ],
      "description": "If we provide a polling station result, this URL may be used to provide a user with a back-channel to report inaccurate data."
    },
    "metadata": {
      "type": [
        "object",
        "null"
      ],
      "description": "This field may be used to supply additional information about an election."
    },
  }
}
Request GET /postcode/{postcode}.json
Response 400
Headers:
Content-Type: application/json
Body:
{
  "detail": "Could not geocode from any source"
}

Address search 

/address/{slug}.json

Parameters

  • slug string ( required )

    A unique slug describing a residential address

    Example: e07000223-527-5-truleigh-way-shoreham-by-sea-west-sussex-bn436hw

In the event that the addresses described by a postcode are not all assigned to the same polling station, an array of address objects will be returned, each of which corresponds to a call to the /address endpoint.

Address search 

Request GET /address/{slug}.json
Response 200
Headers:
Content-Type: application/json

When we make a valid call to the /address endpoint, the following conditions can be observed in the response body:

  • polling_station_known is true

  • polling_station is a GeoJSON polling station feature

  • addresses is an array of length one containing a single address object describing the requested address

Body:
{
    "polling_station_known": true,
    "postcode_location": {
        "properties": null,
        "geometry": {
            "type": "Point",
            "coordinates": [
                -0.26353977212676555,
                50.84477241345472
            ]
        },
        "type": "Feature"
    },
    "custom_finder": null,
    "addresses": [
        {
            "url": "https://wheredoivote.co.uk/api/beta/address/e07000223-527-5-truleigh-way-shoreham-by-sea-west-sussex-bn436hw/",
            "address": "5 Truleigh Way, Shoreham-by-Sea, West Sussex",
            "postcode": "BN436HW",
            "council": "https://wheredoivote.co.uk/api/beta/councils/E07000223/",
            "polling_station_id": "527"
        }
    ],
    "polling_station": {
        "id": "E07000223.527",
        "type": "Feature",
        "geometry": {
            "type": "Point",
            "coordinates": [
                -0.2693240568181819,
                50.83494864772728
            ]
        },
        "properties": {
            "urls": {
                "detail": "https://wheredoivote.co.uk/api/beta/pollingstations/?station_id=527&council_id=E07000223",
                "geo": "https://wheredoivote.co.uk/api/beta/pollingstations/geo/?station_id=527&council_id=E07000223"
            },
            "council": "https://wheredoivote.co.uk/api/beta/councils/E07000223/",
            "station_id": "527",
            "postcode": "BN43 6WF",
            "address": "Shoreham Free Church Hall\nBuckingham Road/Gordon Road\nShoreham-by-Sea"
        }
    },
    "council": {
        "url": "https://wheredoivote.co.uk/api/beta/councils/E07000223/",
        "council_id": "E07000223",
        "name": "Adur District Council",
        "email": "elections@adur-worthing.gov.uk",
        "phone": "01903 221014/5/6",
        "website": "http://adur-worthing.gov.uk/elections-and-voting/register-to-vote/",
        "postcode": "BN11 1HA",
        "address": "Adur District Council\nTown Hall\nChapel Road\nWorthing\nWest Sussex"
    },
    "report_problem_url": "https://wheredoivote.co.uk/report_problem/?source=api&source_url=%2Fapi%2Fbeta%2FTEST.json",
    "metadata": null
}
Schema:
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "polling_station_known": {
      "type": "boolean",
      "description": "Do we know where this user should vote?"
    },
    "postcode_location": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "geometry": {
          "type": "object",
          "properties": {
            "type": {
              "type": "string"
            },
            "coordinates": {}
          },
          "description": "A GeoJSON Point object describing the centroid of the input postcode"
        },
        "type": {
          "type": "string"
        },
        "properties": {
          "type": [
            "object",
            "null"
          ]
        }
      },
      "description": "A GeoJSON Feature containing a Point object describing the centroid of the input postcode."
    },
    "polling_station": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "geometry": {
          "type": [
            "object",
            "null"
          ],
          "properties": {
            "type": {
              "type": "string"
            },
            "coordinates": {
              "type": "array"
            }
          },
          "description": "A GeoJSON Point object describing the location of this polling station. Optionally null if we do not hold this information"
        },
        "type": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "properties": {
          "type": "object",
          "properties": {
            "urls": {
              "type": "object",
              "properties": {
                "detail": {
                  "type": "string",
                  "description": "URL to retrieve JSON meta-data about this polling station"
                },
                "geo": {
                  "type": "string",
                  "description": "URL to retrieve GeoJSON feature describing this polling station"
                }
              }
            },
            "council": {
              "type": "string",
              "description": "URL to retrieve JSON meta-data about the council which administers this polling station"
            },
            "station_id": {
              "type": "string",
              "description": "An identifier for this polling station. Station IDs are unique within councils, but are not unique nationally"
            },
            "address": {
              "type": "string",
              "description": "Address for this polling station"
            },
            "postcode": {
              "type": "string",
              "description": "Postcode for this polling station"
            }
          }
        }
      },
      "description": "A GeoJSON polling station feature"
    },
    "addresses": {
      "description": "An array of address objects listing the addresses applicable to this request (if necessary)."
    },
    "council": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "url": {
          "type": "string",
          "description": "URL for this resource"
        },
        "council_id": {
          "type": "string",
          "description": "GSS code for this council"
        },
        "name": {
          "type": "string",
          "description": "Name of this council"
        },
        "address": {
          "type": "string",
          "description": "Contact address for this council"
        },
        "postcode": {
          "type": "string",
          "description": "Postcode component of contact address for this council"
        },
        "email": {
          "type": "string",
          "description": "Contact email address for this council's Electoral Services team"
        },
        "phone": {
          "type": "string",
          "description": "Telephone number for this council's Electoral Services team"
        },
        "website": {
          "type": "string",
          "description": "URL for this council's website"
        }
      },
      "description": "A Council object describing the local authority which covers this postcode. If we do not know the user's polling station, this can be used to provide contact info for their local council."
    },
    "custom_finder": {
      "type": [
        "string",
        "null"
      ],
      "description": "If we don't know a user's polling station, sometimes we can provide the URL of a polling station finder provided by their local council."
    },
    "report_problem_url": {
      "type": [
        "string",
        "null"
      ],
      "description": "If we provide a polling station result, this URL may be used to provide a user with a back-channel to report inaccurate data."
    },
    "metadata": {
      "type": [
        "object",
        "null"
      ],
      "description": "This field may be used to supply additional information about an election."
    },
  }
}
Request GET /address/{slug}.json
Response 404
Headers:
Content-Type: application/json
Body:
{
  "detail": "Address not found"
}

Councils 

Retrieve details of UK councils/local authorities.

Polling stations and districts are maintained by local councils so all of our data is attached to a council.

Councils Collection: JSON 

/councils.json

List all councils. Returns an array of council objects

List All Councils: JSON 

Request GET /councils.json
Response 200
Headers:
Content-Type: application/json
Body:
[
  {
    "url": "https://wheredoivote.co.uk/api/beta/councils/W06000015.json",
    "council_id": "W06000015",
    "name": "Cardiff Council",
    "address": "Electoral Registration Officer\\nCity of Cardiff Council\\nCounty Hall Atlantic Wharf",
    "postcode": "CF10 4UW",
    "email": "electoralservices@cardiff.gov.uk",
    "phone": "029 2087 2034",
    "website": "http://www.cardiff.gov.uk/"
  }
]
Schema:
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

Councils: JSON 

/councils/{council_id}.json

Parameters

  • council_id string ( required )

    GSS code for this council

    Example: W06000015

Retrieve meta-data about a council in JSON format.

Retrieve a Council: JSON 

Request GET /councils/{council_id}.json
Response 200
Headers:
Content-Type: application/json
Body:
{
  "url": "https://wheredoivote.co.uk/api/beta/councils/W06000015.json",
  "council_id": "W06000015",
  "name": "Cardiff Council",
  "address": "Electoral Registration Officer\\nCity of Cardiff Council\\nCounty Hall Atlantic Wharf",
  "postcode": "CF10 4UW",
  "email": "electoralservices@cardiff.gov.uk",
  "phone": "029 2087 2034",
  "website": "http://www.cardiff.gov.uk/"
}
Schema:
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "description": "URL for this resource"
    },
    "council_id": {
      "type": "string",
      "description": "GSS code for this council"
    },
    "name": {
      "type": "string",
      "description": "Name of this council"
    },
    "address": {
      "type": "string",
      "description": "Contact address for this council"
    },
    "postcode": {
      "type": "string",
      "description": "Postcode component of contact address for this council"
    },
    "email": {
      "type": "string",
      "description": "Contact email address for this council's Electoral Services team"
    },
    "phone": {
      "type": "string",
      "description": "Telephone number for this council's Electoral Services team"
    },
    "website": {
      "type": "string",
      "description": "URL for this council's website"
    }
  }
}
Request GET /councils/{council_id}.json
Response 404
Headers:
Content-Type: application/json
Body:
{
  "detail": "Not found."
}

Councils: GeoJSON 

/councils/{council_id}/geo.json

Parameters

  • council_id string ( required )

    GSS code for this council

    Example: W06000015

Retrieve a GeoJSON Feature containing a GIS boundary and meta-data about a council.

Retrieve a Council: GeoJSON 

Request GET /councils/{council_id}/geo.json
Response 200
Headers:
Content-Type: application/json
Body:
{
  "geometry": {
    "type": "MultiPolygon",
    "coordinates": [
      "..."
    ]
  },
  "type": "Feature",
  "id": "W06000015",
  "properties": {
    "url": "https://wheredoivote.co.uk/api/beta/councils/W06000015.json",
    "council_id": "W06000015",
    "name": "Cardiff Council",
    "address": "Electoral Registration Officer\\nCity of Cardiff Council\\nCounty Hall Atlantic Wharf",
    "postcode": "CF10 4UW",
    "email": "electoralservices@cardiff.gov.uk",
    "phone": "029 2087 2034",
    "website": "http://www.cardiff.gov.uk/"
  }
}
Schema:
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "geometry": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string"
        },
        "coordinates": {
          "type": "array"
        }
      },
      "description": "A GeoJSON object describing the boundary of this area"
    },
    "type": {
      "type": "string"
    },
    "id": {
      "type": "string",
      "description": "GSS code for this council"
    },
    "properties": {
      "type": "object",
      "properties": {
        "url": {
          "type": "string",
          "description": "URL for this resource"
        },
        "council_id": {
          "type": "string",
          "description": "GSS code for this council"
        },
        "name": {
          "type": "string",
          "description": "Name of this council"
        },
        "address": {
          "type": "string",
          "description": "Contact address for this council"
        },
        "postcode": {
          "type": "string",
          "description": "Postcode component of contact address for this council"
        },
        "email": {
          "type": "string",
          "description": "Contact email address for this council's Electoral Services team"
        },
        "phone": {
          "type": "string",
          "description": "Telephone number for this council's Electoral Services team"
        },
        "website": {
          "type": "string",
          "description": "URL for this council's website"
        }
      }
    }
  }
}
Request GET /councils/{council_id}/geo.json
Response 404
Headers:
Content-Type: application/json
Body:
{
  "detail": "Not found."
}

Polling Stations 

The /pollingstations endpoint provides access to the polling station data underpinning our polling station finder.

Polling Stations Collection: JSON 

/pollingstations.json?council_id={council_id}

Parameters

  • council_id string ( required )

    GSS code for this council

    Example: E07000170

List all polling stations in a local authority. Returns an array of polling station objects

List All Polling Stations in a Local Authority: JSON 

Request GET /pollingstations.json?council_id={council_id}
Response 200
Headers:
Content-Type: application/json
Body:
[
  {
    "urls": {
      "detail": "https://wheredoivote.co.uk/api/beta/pollingstations/?council_id=E07000170&station_id=SUM4",
      "geo": "https://wheredoivote.co.uk/api/beta/pollingstations/geo/?council_id=E07000170&station_id=SUM4"
    },
    "council": "https://wheredoivote.co.uk/api/beta/councils/E07000170.json",
    "station_id": "SUM4",
    "address": "Ashwood Centre\\nPortland Street, Kirkby in Ashfield",
    "postcode": ""
  }
]
Schema:
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

Polling Stations Collection: GeoJSON 

/pollingstations/geo.json?council_id={council_id}

Parameters

  • council_id string ( required )

    GSS code for this council

    Example: E07000170

List all polling stations in a local authority. Returns a GeoJSON FeatureCollection of polling station features

List All Polling Stations in a Local Authority: GeoJSON 

Request GET /pollingstations/geo.json?council_id={council_id}
Response 200
Headers:
Content-Type: application/json
Body:
{
  "type": "FeatureCollection",
  "features": [
    {
      "geometry": {
        "type": "Point",
        "coordinates": [
          "..."
        ]
      },
      "type": "Feature",
      "id": "E07000170.SUM4",
      "properties": {
        "urls": {
          "detail": "https://wheredoivote.co.uk/api/beta/pollingstations/?council_id=E07000170&station_id=SUM4",
          "geo": "https://wheredoivote.co.uk/api/beta/pollingstations/geo/?council_id=E07000170&station_id=SUM4"
        },
        "council": "https://wheredoivote.co.uk/api/beta/councils/E07000170.json",
        "station_id": "SUM4",
        "address": "Ashwood Centre\\nPortland Street, Kirkby in Ashfield",
        "postcode": ""
      }
    }
  ]
}
Schema:
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "type": {
      "type": "string"
    },
    "features": {
      "type": "array"
    }
  }
}

Polling Stations: JSON 

/pollingstations.json?council_id={council_id}&station_id={station_id}

Parameters

  • council_id string ( required )

    GSS code for this council

    Example: E07000170

  • station_id string ( required )

    Polling Station ID. Polling Station IDs are unique within councils, but are not unique nationally

    Example: SUM4

Retrieve meta-data about a polling station in JSON format.

Retrieve a Polling Station: JSON 

Request GET /pollingstations.json?council_id={council_id}&station_id={station_id}
Response 200
Headers:
Content-Type: application/json
Body:
{
  "urls": {
    "detail": "https://wheredoivote.co.uk/api/beta/pollingstations/?council_id=E07000170&station_id=SUM4",
    "geo": "https://wheredoivote.co.uk/api/beta/pollingstations/geo/?council_id=E07000170&station_id=SUM4"
  },
  "council": "https://wheredoivote.co.uk/api/beta/councils/E07000170.json",
  "station_id": "SUM4",
  "address": "Ashwood Centre\\nPortland Street, Kirkby in Ashfield",
  "postcode": ""
}
Schema:
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "urls": {
      "type": "object",
      "properties": {
        "detail": {
          "type": "string",
          "description": "URL to retrieve JSON meta-data about this polling station"
        },
        "geo": {
          "type": "string",
          "description": "URL to retrieve GeoJSON feature describing this polling station"
        }
      }
    },
    "council": {
      "type": "string",
      "description": "URL to retrieve JSON meta-data about the council which administers this polling station"
    },
    "station_id": {
      "type": "string",
      "description": "An identifier for this polling station. Station IDs are unique within councils, but are not unique nationally"
    },
    "address": {
      "type": "string",
      "description": "Address for this polling station"
    },
    "postcode": {
      "type": "string",
      "description": "Postcode for this polling station"
    }
  }
}
Request GET /pollingstations.json?council_id={council_id}&station_id={station_id}
Response 404
Headers:
Content-Type: application/json
Body:
{
  "detail": "Not found."
}

Polling Stations: GeoJSON 

/pollingstations/geo.json?council_id={council_id}&station_id={station_id}

Parameters

  • council_id string ( required )

    GSS code for this council

    Example: E07000170

  • station_id string ( required )

    Polling Station ID. Polling Station IDs are unique within councils, but are not unique nationally

    Example: SUM4

Retrieve a GeoJSON Feature describing a polling station.

Retrieve a Polling Station: GeoJSON 

Request GET /pollingstations/geo.json?council_id={council_id}&station_id={station_id}
Response 200
Headers:
Content-Type: application/json
Body:
{
  "geometry": {
    "type": "Point",
    "coordinates": [
      "..."
    ]
  },
  "type": "Feature",
  "id": "E07000170.SUM4",
  "properties": {
    "urls": {
      "detail": "https://wheredoivote.co.uk/api/beta/pollingstations/?council_id=E07000170&station_id=SUM4",
      "geo": "https://wheredoivote.co.uk/api/beta/pollingstations/geo/?council_id=E07000170&station_id=SUM4"
    },
    "council": "https://wheredoivote.co.uk/api/beta/councils/E07000170.json",
    "station_id": "SUM4",
    "address": "Ashwood Centre\\nPortland Street, Kirkby in Ashfield",
    "postcode": ""
  }
}
Schema:
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "geometry": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "type": {
          "type": "string"
        },
        "coordinates": {
          "type": "array"
        }
      },
      "description": "A GeoJSON Point object describing the location of this polling station. Optionally null if we do not hold this information"
    },
    "type": {
      "type": "string"
    },
    "id": {
      "type": "string"
    },
    "properties": {
      "type": "object",
      "properties": {
        "urls": {
          "type": "object",
          "properties": {
            "detail": {
              "type": "string",
              "description": "URL to retrieve JSON meta-data about this polling station"
            },
            "geo": {
              "type": "string",
              "description": "URL to retrieve GeoJSON feature describing this polling station"
            }
          }
        },
        "council": {
          "type": "string",
          "description": "URL to retrieve JSON meta-data about the council which administers this polling station"
        },
        "station_id": {
          "type": "string",
          "description": "An identifier for this polling station. Station IDs are unique within councils, but are not unique nationally"
        },
        "address": {
          "type": "string",
          "description": "Address for this polling station"
        },
        "postcode": {
          "type": "string",
          "description": "Postcode for this polling station"
        }
      }
    }
  }
}
Request GET /pollingstations/geo.json?council_id={council_id}&station_id={station_id}
Response 404
Headers:
Content-Type: application/json
Body:
{
  "detail": "Not found."
}

Polling Districts 

The /pollingdistricts endpoint provides access to the polling district data underpinning our polling station finder. Where possible a polling district contains a polling station object describing the station which serves this district. This may optionally be null if this district is an orphan district. An orphan district occurrs where we hold the boundary of a polling district but we don't know the corresponding polling station. The polling station which serves a district does not necessarily have to be located inside the district it serves.

Polling Districts Collection: JSON 

/pollingdistricts.json?council_id={council_id}

Parameters

  • council_id string ( required )

    GSS code for this council

    Example: E07000170

List all polling districts in a local authority. Returns an array of polling district objects

List All Polling Districts in a Local Authority: JSON 

Request GET /pollingdistricts.json?council_id={council_id}
Response 200
Headers:
Content-Type: application/json
Body:
[
  {
    "urls": {
      "detail": "https://wheredoivote.co.uk/api/beta/pollingdistricts/?council_id=E07000170&district_id=SUM4",
      "geo": "https://wheredoivote.co.uk/api/beta/pollingdistricts/geo/?council_id=E07000170&district_id=SUM4"
    },
    "council": "https://wheredoivote.co.uk/api/beta/councils/E07000170.json",
    "district_id": "SUM4",
    "polling_station": {
      "urls": {
        "detail": "https://wheredoivote.co.uk/api/beta/pollingstations/?council_id=E07000170&station_id=SUM4",
        "geo": "https://wheredoivote.co.uk/api/beta/pollingstations/geo/?council_id=E07000170&station_id=SUM4"
      },
      "council": "https://wheredoivote.co.uk/api/beta/councils/E07000170.json",
      "station_id": "SUM4",
      "address": "Ashwood Centre\\nPortland Street, Kirkby in Ashfield",
      "postcode": ""
    }
  }
]
Schema:
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

Polling Districts Collection: GeoJSON 

/pollingdistricts/geo.json?council_id={council_id}

Parameters

  • council_id string ( required )

    GSS code for this council

    Example: E07000170

List all polling districts in a local authority. Returns a GeoJSON FeatureCollection of polling district features

List All Polling Districts in a Local Authority: GeoJSON 

Request GET /pollingdistricts/geo.json?council_id={council_id}
Response 200
Headers:
Content-Type: application/json
Body:
{
  "type": "FeatureCollection",
  "features": [
    {
      "geometry": {
        "type": "MultiPolygon",
        "coordinates": [
          "..."
        ]
      },
      "type": "Feature",
      "id": "E07000170.SUM4",
      "properties": {
        "urls": {
          "detail": "https://wheredoivote.co.uk/api/beta/pollingdistricts/?council_id=E07000170&district_id=SUM4",
          "geo": "https://wheredoivote.co.uk/api/beta/pollingdistricts/geo/?council_id=E07000170&district_id=SUM4"
        },
        "council": "https://wheredoivote.co.uk/api/beta/councils/E07000170.json",
        "district_id": "SUM4",
        "polling_station": {
          "urls": {
            "detail": "https://wheredoivote.co.uk/api/beta/pollingstations/?council_id=E07000170&station_id=SUM4",
            "geo": "https://wheredoivote.co.uk/api/beta/pollingstations/geo/?council_id=E07000170&station_id=SUM4"
          },
          "council": "https://wheredoivote.co.uk/api/beta/councils/E07000170.json",
          "station_id": "SUM4",
          "address": "Ashwood Centre\\nPortland Street, Kirkby in Ashfield",
          "postcode": ""
        }
      }
    }
  ]
}
Schema:
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "type": {
      "type": "string"
    },
    "features": {
      "type": "array"
    }
  }
}

Polling Districts: JSON 

/pollingdistricts.json?council_id={council_id}&district_id={district_id}

Parameters

  • council_id string ( required )

    GSS code for this council

    Example: E07000170

  • district_id string ( required )

    Polling District ID. Polling District IDs are unique within councils, but are not unique nationally

    Example: SUM4

Retrieve meta-data about a polling district in JSON format.

Retrieve a Polling District: JSON 

Request GET /pollingdistricts.json?council_id={council_id}&district_id={district_id}
Response 200
Headers:
Content-Type: application/json
Body:
{
  "urls": {
    "detail": "https://wheredoivote.co.uk/api/beta/pollingdistricts/?council_id=E07000170&district_id=SUM4",
    "geo": "https://wheredoivote.co.uk/api/beta/pollingdistricts/geo/?council_id=E07000170&district_id=SUM4"
  },
  "council": "https://wheredoivote.co.uk/api/beta/councils/E07000170.json",
  "district_id": "SUM4",
  "polling_station": {
    "urls": {
      "detail": "https://wheredoivote.co.uk/api/beta/pollingstations/?council_id=E07000170&station_id=SUM4",
      "geo": "https://wheredoivote.co.uk/api/beta/pollingstations/geo/?council_id=E07000170&station_id=SUM4"
    },
    "council": "https://wheredoivote.co.uk/api/beta/councils/E07000170.json",
    "station_id": "SUM4",
    "address": "Ashwood Centre\\nPortland Street, Kirkby in Ashfield",
    "postcode": ""
  }
}
Schema:
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "urls": {
      "type": "object",
      "properties": {
        "detail": {
          "type": "string",
          "description": "URL to retrieve JSON meta-data about this polling district"
        },
        "geo": {
          "type": "string",
          "description": "URL to retrieve GeoJSON feature describing this polling district"
        }
      }
    },
    "council": {
      "type": "string",
      "description": "URL to retrieve JSON meta-data about the council which administers this polling district"
    },
    "district_id": {
      "type": "string",
      "description": "An identifier for this polling district. District IDs are unique within councils, but are not unique nationally"
    },
    "polling_station": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "urls": {
          "type": "object",
          "properties": {
            "detail": {
              "type": "string",
              "description": "URL to retrieve JSON meta-data about this polling station"
            },
            "geo": {
              "type": "string",
              "description": "URL to retrieve GeoJSON feature describing this polling station"
            }
          }
        },
        "council": {
          "type": "string",
          "description": "URL to retrieve JSON meta-data about the council which administers this polling station"
        },
        "station_id": {
          "type": "string",
          "description": "An identifier for this polling station. Station IDs are unique within councils, but are not unique nationally"
        },
        "address": {
          "type": "string",
          "description": "Address for this polling station"
        },
        "postcode": {
          "type": "string",
          "description": "Postcode for this polling station"
        }
      },
      "description": "A polling station object describing the station which serves this district. Optionally null if we do not hold this information"
    }
  }
}
Request GET /pollingdistricts.json?council_id={council_id}&district_id={district_id}
Response 404
Headers:
Content-Type: application/json
Body:
{
  "detail": "Not found."
}

Polling Districts: GeoJSON 

/pollingdistricts/geo.json?council_id={council_id}&district_id={district_id}

Parameters

  • council_id string ( required )

    GSS code for this council

    Example: E07000170

  • district_id string ( required )

    Polling District ID. Polling District IDs are unique within councils, but are not unique nationally

    Example: SUM4

Retrieve a GeoJSON Feature containing a GIS boundary and meta-data about a polling district.

Retrieve a Polling District: GeoJSON 

Request GET /pollingdistricts/geo.json?council_id={council_id}&district_id={district_id}
Response 200
Headers:
Content-Type: application/json
Body:
{
  "geometry": {
    "type": "MultiPolygon",
    "coordinates": [
      "..."
    ]
  },
  "type": "Feature",
  "id": "E07000170.SUM4",
  "properties": {
    "urls": {
      "detail": "https://wheredoivote.co.uk/api/beta/pollingdistricts/?council_id=E07000170&district_id=SUM4",
      "geo": "https://wheredoivote.co.uk/api/beta/pollingdistricts/geo/?council_id=E07000170&district_id=SUM4"
    },
    "council": "https://wheredoivote.co.uk/api/beta/councils/E07000170.json",
    "district_id": "SUM4",
    "polling_station": {
      "urls": {
        "detail": "https://wheredoivote.co.uk/api/beta/pollingstations/?council_id=E07000170&station_id=SUM4",
        "geo": "https://wheredoivote.co.uk/api/beta/pollingstations/geo/?council_id=E07000170&station_id=SUM4"
      },
      "council": "https://wheredoivote.co.uk/api/beta/councils/E07000170.json",
      "station_id": "SUM4",
      "address": "Ashwood Centre\\nPortland Street, Kirkby in Ashfield",
      "postcode": ""
    }
  }
}
Schema:
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "geometry": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string"
        },
        "coordinates": {
          "type": "array"
        }
      },
      "description": "A GeoJSON object describing the boundary of this area"
    },
    "type": {
      "type": "string"
    },
    "id": {
      "type": "string"
    },
    "properties": {
      "type": "object",
      "properties": {
        "urls": {
          "type": "object",
          "properties": {
            "detail": {
              "type": "string",
              "description": "URL to retrieve JSON meta-data about this polling district"
            },
            "geo": {
              "type": "string",
              "description": "URL to retrieve GeoJSON feature describing this polling district"
            }
          }
        },
        "council": {
          "type": "string",
          "description": "URL to retrieve JSON meta-data about the council which administers this polling district"
        },
        "district_id": {
          "type": "string",
          "description": "An identifier for this polling district. District IDs are unique within councils, but are not unique nationally"
        },
        "polling_station": {
          "type": [
            "object",
            "null"
          ],
          "properties": {
            "urls": {
              "type": "object",
              "properties": {
                "detail": {
                  "type": "string",
                  "description": "URL to retrieve JSON meta-data about this polling station"
                },
                "geo": {
                  "type": "string",
                  "description": "URL to retrieve GeoJSON feature describing this polling station"
                }
              }
            },
            "council": {
              "type": "string",
              "description": "URL to retrieve JSON meta-data about the council which administers this polling station"
            },
            "station_id": {
              "type": "string",
              "description": "An identifier for this polling station. Station IDs are unique within councils, but are not unique nationally"
            },
            "address": {
              "type": "string",
              "description": "Address for this polling station"
            },
            "postcode": {
              "type": "string",
              "description": "Postcode for this polling station"
            }
          },
          "description": "A polling station object describing the station which serves this district. Optionally null if we do not hold this information"
        }
      }
    }
  }
}
Request GET /pollingdistricts/geo.json?council_id={council_id}&district_id={district_id}
Response 404
Headers:
Content-Type: application/json
Body:
{
  "detail": "Not found."
}