skip to content

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",
}

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.

  • ballots: (array) - An array of ballot objects listing the elections applicable to this request. It is possible for more than one ballot to occur on the same date. For example, a user may vote in a local council election and mayoral election on the same day. If ballots is an empty array [], there are no upcoming elections in this area.

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:

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

  • Address picker: 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.

  • Result not Found: We do not hold data for this area.

Postcode search: Result found 

/postcode/{postcode}.json

Parameters

  • postcode string ( required )

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

    Example: SW1A1AA

Response 

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:

Request GET /postcode/{postcode}.json
Response 200
Headers:
Content-Type: application/json
Body:
{
  "polling_station_known": true,
  "postcode_location": {
    "type": "Feature",
    "properties": null,
    "geometry": {
      "type": "Point",
      "coordinates": [
        -0.277029,
        50.836643
      ]
    }
  },
  "custom_finder": null,
  "addresses": [],
  "polling_station": {
    "geometry": {
      "type": "Point",
      "coordinates": [
        -0.269324,
        50.834949
      ]
    },
    "type": "Feature",
    "id": "E07000223.527",
    "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",
      "address": "Shoreham Free Church Hall\\nBuckingham Road/Gordon Road\\nShoreham-by-Sea",
      "postcode": "BN43 6WF"
    }
  },
  "council": {
    "url": "https://wheredoivote.co.uk/api/beta/councils/E07000223/",
    "council_id": "E07000223",
    "name": "Adur District Council",
    "nation": "England",
    "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,
  "ballots": [
    {
      "ballot_paper_id": "local.adur.buckingham.2018-05-03",
      "ballot_title": "Adur local election Buckingham",
      "poll_open_date": "2018-05-03",
      "elected_role": "Local Councillor",
      "metadata": null,
      "cancelled": false,
      "cancelled_reason": null,
      "replaced_by": null,
      "replaces": 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": {
        "type": {
          "type": "string"
        },
        "properties": {
          "type": [
            "object",
            "null"
          ],
          "properties": {}
        },
        "geometry": {
          "type": "object",
          "properties": {
            "type": {
              "type": "string"
            },
            "coordinates": {
              "type": "array",
              "items": [
                {
                  "type": "number"
                },
                {
                  "type": "number"
                }
              ]
            }
          },
          "required": [
            "type",
            "coordinates"
          ],
          "additionalProperties": false,
          "description": "A GeoJSON Point object describing the centroid of the input postcode"
        }
      },
      "required": [
        "type",
        "properties",
        "geometry"
      ],
      "additionalProperties": false,
      "description": "A [GeoJSON Feature](https://tools.ietf.org/html/rfc7946#section-3.2) containing a [Point object](https://tools.ietf.org/html/rfc7946#section-3.1.2) describing the centroid of the input postcode. If providing a map or directions for a polling station journey, use this as the start point. This may be `null` if we are not able to accurately geocode."
    },
    "custom_finder": {
      "type": [
        "string",
        "null"
      ],
      "description": "If we don't know a user's polling station, sometimes we can provide the URL of another polling station finder."
    },
    "addresses": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {}
      },
      "description": "An array of address objects containing the addresses applicable to this request (if necessary)"
    },
    "polling_station": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "geometry": {
          "type": [
            "object",
            "null"
          ],
          "properties": {
            "type": {
              "type": "string"
            },
            "coordinates": {
              "type": "array",
              "items": [
                {
                  "type": "number"
                },
                {
                  "type": "number"
                }
              ]
            }
          },
          "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"
    },
    "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"
        },
        "nation": {
          "type": "string",
          "description": "Name of nation"
        },
        "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"
        },
        "postcode": {
          "type": "string",
          "description": "Postcode component of contact address for this council"
        },
        "address": {
          "type": "string",
          "description": "Contact address for this council"
        }
      },
      "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."
    },
    "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"
      ],
      "properties": {},
      "description": "This field may be used to supply additional information about an election."
    },
    "ballots": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "ballot_paper_id": {
            "type": "string",
            "description": "Identifier for this ballot"
          },
          "ballot_title": {
            "type": "string",
            "description": "Friendly name for this ballot"
          },
          "poll_open_date": {
            "type": "string",
            "description": "Polling day for this ballot"
          },
          "elected_role": {
            "type": "string",
            "description": "Name of the role the winner(s) of this election will assume"
          },
          "metadata": {
            "type": [
              "object",
              "null"
            ],
            "properties": {},
            "description": "Object containing information about special conditions for the user to be aware about (e.g: cancelled elections, voter id pilot)."
          },
          "cancelled": {
            "type": "boolean",
            "description": "True if this ballot has been cancelled"
          },
          "cancelled_reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "The reason this ballot has been cancelled"
          },
          "replaced_by": {
            "type": [
              "string",
              "null"
            ],
            "description": "If a ballot has been cancelled (cancelled = true) and rescheduled for a later date, this key will hold the ballot_paper_id of the ballot that replaces it."
          },
          "replaces": {
            "type": [
              "string",
              "null"
            ],
            "description": "If this ballot replaces another cancelled ballot, this key will hold the ballot_paper_id of the ballot that it replaces."
          }
        }
      },
      "description": "An array of ballot objects listing the elections applicable to this request"
    }
  }
}

Postcode search: Address picker 

/postcode/{postcode}.json

Parameters

  • postcode string ( required )

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

    Example: SW1A1AA

Response 

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.

Request GET /postcode/{postcode}.json
Response 200
Headers:
Content-Type: application/json
Body:
{
  "polling_station_known": false,
  "postcode_location": {
    "type": "Feature",
    "properties": null,
    "geometry": {
      "type": "Point",
      "coordinates": [
        -0.26354,
        50.844772
      ]
    }
  },
  "custom_finder": null,
  "addresses": [
    {
      "url": "https://wheredoivote.co.uk/api/beta/address/60017557/",
      "polling_station_id": "527",
      "postcode": "BN436HW",
      "address": "4 Truleigh Way, Shoreham-by-Sea, West Sussex",
      "uprn": "60017559",
      "council": "https://wheredoivote.co.uk/api/beta/councils/E07000223/"
    },
    {
      "url": "https://wheredoivote.co.uk/api/beta/address/60017557?",
      "polling_station_id": "524",
      "postcode": "BN436HW",
      "address": "2 Truleigh Way, Shoreham-by-Sea, West Sussex",
      "uprn": "60017557",
      "council": "https://wheredoivote.co.uk/api/beta/councils/E07000223/"
    }
  ],
  "polling_station": null,
  "council": {
    "url": "https://wheredoivote.co.uk/api/beta/councils/E07000223/",
    "council_id": "E07000223",
    "name": "Adur District Council",
    "nation": "England",
    "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": null,
  "metadata": null,
  "ballots": [
    {
      "ballot_paper_id": "local.adur.buckingham.2018-05-03",
      "ballot_title": "Adur local election Buckingham",
      "poll_open_date": "2018-05-03",
      "elected_role": "Local Councillor",
      "metadata": null,
      "cancelled": false,
      "cancelled_reason": null,
      "replaced_by": null,
      "replaces": 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": {
        "type": {
          "type": "string"
        },
        "properties": {
          "type": [
            "object",
            "null"
          ],
          "properties": {}
        },
        "geometry": {
          "type": "object",
          "properties": {
            "type": {
              "type": "string"
            },
            "coordinates": {
              "type": "array",
              "items": [
                {
                  "type": "number"
                },
                {
                  "type": "number"
                }
              ]
            }
          },
          "required": [
            "type",
            "coordinates"
          ],
          "additionalProperties": false,
          "description": "A GeoJSON Point object describing the centroid of the input postcode"
        }
      },
      "required": [
        "type",
        "properties",
        "geometry"
      ],
      "additionalProperties": false,
      "description": "A [GeoJSON Feature](https://tools.ietf.org/html/rfc7946#section-3.2) containing a [Point object](https://tools.ietf.org/html/rfc7946#section-3.1.2) describing the centroid of the input postcode. If providing a map or directions for a polling station journey, use this as the start point. This may be `null` if we are not able to accurately geocode."
    },
    "custom_finder": {
      "type": [
        "string",
        "null"
      ],
      "description": "If we don't know a user's polling station, sometimes we can provide the URL of another polling station finder."
    },
    "addresses": {
      "type": "array",
      "items": [
        {
          "type": "object",
          "properties": {
            "url": {
              "type": "string",
              "description": "Call this URL to get data for this registered address"
            },
            "polling_station_id": {
              "type": "string"
            },
            "postcode": {
              "type": "string"
            },
            "address": {
              "type": "string"
            },
            "uprn": {
              "type": "string"
            },
            "council": {
              "type": "string"
            }
          }
        },
        {
          "type": "object",
          "properties": {
            "url": {
              "type": "string",
              "description": "Call this URL to get data for this registered address"
            },
            "polling_station_id": {
              "type": "string"
            },
            "postcode": {
              "type": "string"
            },
            "address": {
              "type": "string"
            },
            "uprn": {
              "type": "string"
            },
            "council": {
              "type": "string"
            }
          }
        }
      ],
      "description": "An array of address objects containing the addresses applicable to this request (if necessary)"
    },
    "polling_station": {
      "type": [
        "object",
        "null"
      ],
      "properties": {},
      "description": "A GeoJSON polling station feature"
    },
    "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"
        },
        "nation": {
          "type": "string",
          "description": "Name of nation"
        },
        "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"
        },
        "postcode": {
          "type": "string",
          "description": "Postcode component of contact address for this council"
        },
        "address": {
          "type": "string",
          "description": "Contact address for this council"
        }
      },
      "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."
    },
    "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"
      ],
      "properties": {},
      "description": "This field may be used to supply additional information about an election."
    },
    "ballots": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "ballot_paper_id": {
            "type": "string",
            "description": "Identifier for this ballot"
          },
          "ballot_title": {
            "type": "string",
            "description": "Friendly name for this ballot"
          },
          "poll_open_date": {
            "type": "string",
            "description": "Polling day for this ballot"
          },
          "elected_role": {
            "type": "string",
            "description": "Name of the role the winner(s) of this election will assume"
          },
          "metadata": {
            "type": [
              "object",
              "null"
            ],
            "properties": {},
            "description": "Object containing information about special conditions for the user to be aware about (e.g: cancelled elections, voter id pilot)."
          },
          "cancelled": {
            "type": "boolean",
            "description": "True if this ballot has been cancelled"
          },
          "cancelled_reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "The reason this ballot has been cancelled"
          },
          "replaced_by": {
            "type": [
              "string",
              "null"
            ],
            "description": "If a ballot has been cancelled (cancelled = true) and rescheduled for a later date, this key will hold the ballot_paper_id of the ballot that replaces it."
          },
          "replaces": {
            "type": [
              "string",
              "null"
            ],
            "description": "If this ballot replaces another cancelled ballot, this key will hold the ballot_paper_id of the ballot that it replaces."
          }
        }
      },
      "description": "An array of ballot objects listing the elections applicable to this request"
    }
  }
}

Postcode search: Result not Found 

/postcode/{postcode}.json

Parameters

  • postcode string ( required )

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

    Example: SW1A1AA

Response 

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

Request GET /postcode/{postcode}.json
Response 200
Headers:
Content-Type: application/json
Body:
{
  "polling_station_known": false,
  "postcode_location": {
    "type": "Feature",
    "properties": null,
    "geometry": {
      "type": "Point",
      "coordinates": [
        -0.277029,
        50.836643
      ]
    }
  },
  "custom_finder": null,
  "addresses": [],
  "polling_station": null,
  "council": {
    "url": "https://wheredoivote.co.uk/api/beta/councils/E07000223/",
    "council_id": "E07000223",
    "name": "Adur District Council",
    "nation": "England",
    "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": null,
  "metadata": null,
  "ballots": [
    {
      "ballot_paper_id": "local.adur.buckingham.2018-05-03",
      "ballot_title": "Adur local election Buckingham",
      "poll_open_date": "2018-05-03",
      "elected_role": "Local Councillor",
      "metadata": null,
      "cancelled": false,
      "cancelled_reason": null,
      "replaced_by": null,
      "replaces": 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": {
        "type": {
          "type": "string"
        },
        "properties": {
          "type": [
            "object",
            "null"
          ],
          "properties": {}
        },
        "geometry": {
          "type": "object",
          "properties": {
            "type": {
              "type": "string"
            },
            "coordinates": {
              "type": "array",
              "items": [
                {
                  "type": "number"
                },
                {
                  "type": "number"
                }
              ]
            }
          },
          "required": [
            "type",
            "coordinates"
          ],
          "additionalProperties": false,
          "description": "A GeoJSON Point object describing the centroid of the input postcode"
        }
      },
      "required": [
        "type",
        "properties",
        "geometry"
      ],
      "additionalProperties": false,
      "description": "A [GeoJSON Feature](https://tools.ietf.org/html/rfc7946#section-3.2) containing a [Point object](https://tools.ietf.org/html/rfc7946#section-3.1.2) describing the centroid of the input postcode. If providing a map or directions for a polling station journey, use this as the start point. This may be `null` if we are not able to accurately geocode."
    },
    "custom_finder": {
      "type": [
        "string",
        "null"
      ],
      "description": "If we don't know a user's polling station, sometimes we can provide the URL of another polling station finder."
    },
    "addresses": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {}
      },
      "description": "An array of address objects containing the addresses applicable to this request (if necessary)"
    },
    "polling_station": {
      "type": [
        "object",
        "null"
      ],
      "properties": {},
      "description": "A GeoJSON polling station feature"
    },
    "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"
        },
        "nation": {
          "type": "string",
          "description": "Name of nation"
        },
        "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"
        },
        "postcode": {
          "type": "string",
          "description": "Postcode component of contact address for this council"
        },
        "address": {
          "type": "string",
          "description": "Contact address for this council"
        }
      },
      "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."
    },
    "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"
      ],
      "properties": {},
      "description": "This field may be used to supply additional information about an election."
    },
    "ballots": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "ballot_paper_id": {
            "type": "string",
            "description": "Identifier for this ballot"
          },
          "ballot_title": {
            "type": "string",
            "description": "Friendly name for this ballot"
          },
          "poll_open_date": {
            "type": "string",
            "description": "Polling day for this ballot"
          },
          "elected_role": {
            "type": "string",
            "description": "Name of the role the winner(s) of this election will assume"
          },
          "metadata": {
            "type": [
              "object",
              "null"
            ],
            "properties": {},
            "description": "Object containing information about special conditions for the user to be aware about (e.g: cancelled elections, voter id pilot)."
          },
          "cancelled": {
            "type": "boolean",
            "description": "True if this ballot has been cancelled"
          },
          "cancelled_reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "The reason this ballot has been cancelled"
          },
          "replaced_by": {
            "type": [
              "string",
              "null"
            ],
            "description": "If a ballot has been cancelled (cancelled = true) and rescheduled for a later date, this key will hold the ballot_paper_id of the ballot that replaces it."
          },
          "replaces": {
            "type": [
              "string",
              "null"
            ],
            "description": "If this ballot replaces another cancelled ballot, this key will hold the ballot_paper_id of the ballot that it replaces."
          }
        }
      },
      "description": "An array of ballot objects listing the elections applicable to this request"
    }
  }
}

Address search 

/address/{uprn}.json

Parameters

  • uprn string ( required )

    A unique uprn describing a residential address

    Example: 60017559

Response 

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.

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

Request GET /address/{uprn}.json
Response 200
Headers:
Content-Type: application/json
Body:
{
  "polling_station_known": true,
  "postcode_location": {
    "type": "Feature",
    "properties": null,
    "geometry": {
      "type": "Point",
      "coordinates": [
        -0.26354,
        50.844772
      ]
    }
  },
  "custom_finder": null,
  "addresses": [
    {
      "url": "https://wheredoivote.co.uk/api/beta/address/60017559/",
      "polling_station_id": "527",
      "postcode": "BN436HW",
      "address": "4 Truleigh Way, Shoreham-by-Sea, West Sussex",
      "uprn": "60017559",
      "council": "https://wheredoivote.co.uk/api/beta/councils/E07000223/"
    }
  ],
  "polling_station": {
    "geometry": {
      "type": "Point",
      "coordinates": [
        -0.269324,
        50.834949
      ]
    },
    "type": "Feature",
    "id": "E07000223.527",
    "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",
      "address": "Shoreham Free Church Hall\\nBuckingham Road/Gordon Road\\nShoreham-by-Sea",
      "postcode": "BN43 6WF"
    }
  },
  "council": {
    "url": "https://wheredoivote.co.uk/api/beta/councils/E07000223/",
    "council_id": "E07000223",
    "name": "Adur District Council",
    "nation": "England",
    "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,
  "ballots": [
    {
      "ballot_paper_id": "local.adur.buckingham.2018-05-03",
      "ballot_title": "Adur local election Buckingham",
      "poll_open_date": "2018-05-03",
      "elected_role": "Local Councillor",
      "metadata": null,
      "cancelled": false,
      "cancelled_reason": null,
      "replaced_by": null,
      "replaces": 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": {
        "type": {
          "type": "string"
        },
        "properties": {
          "type": [
            "object",
            "null"
          ],
          "properties": {}
        },
        "geometry": {
          "type": "object",
          "properties": {
            "type": {
              "type": "string"
            },
            "coordinates": {
              "type": "array",
              "items": [
                {
                  "type": "number"
                },
                {
                  "type": "number"
                }
              ]
            }
          },
          "required": [
            "type",
            "coordinates"
          ],
          "additionalProperties": false,
          "description": "A GeoJSON Point object describing the centroid of the input postcode"
        }
      },
      "required": [
        "type",
        "properties",
        "geometry"
      ],
      "additionalProperties": false,
      "description": "A [GeoJSON Feature](https://tools.ietf.org/html/rfc7946#section-3.2) containing a [Point object](https://tools.ietf.org/html/rfc7946#section-3.1.2) describing the centroid of the input postcode. If providing a map or directions for a polling station journey, use this as the start point. This may be `null` if we are not able to accurately geocode."
    },
    "custom_finder": {
      "type": [
        "string",
        "null"
      ],
      "description": "If we don't know a user's polling station, sometimes we can provide the URL of another polling station finder."
    },
    "addresses": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "description": "Call this URL to get data for this registered address"
          },
          "polling_station_id": {
            "type": "string"
          },
          "postcode": {
            "type": "string"
          },
          "address": {
            "type": "string"
          },
          "uprn": {
            "type": "string"
          },
          "council": {
            "type": "string"
          }
        }
      },
      "description": "An array of address objects containing the addresses applicable to this request (if necessary)"
    },
    "polling_station": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "geometry": {
          "type": [
            "object",
            "null"
          ],
          "properties": {
            "type": {
              "type": "string"
            },
            "coordinates": {
              "type": "array",
              "items": [
                {
                  "type": "number"
                },
                {
                  "type": "number"
                }
              ]
            }
          },
          "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"
    },
    "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"
        },
        "nation": {
          "type": "string",
          "description": "Name of nation"
        },
        "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"
        },
        "postcode": {
          "type": "string",
          "description": "Postcode component of contact address for this council"
        },
        "address": {
          "type": "string",
          "description": "Contact address for this council"
        }
      },
      "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."
    },
    "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"
      ],
      "properties": {},
      "description": "This field may be used to supply additional information about an election."
    },
    "ballots": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "ballot_paper_id": {
            "type": "string",
            "description": "Identifier for this ballot"
          },
          "ballot_title": {
            "type": "string",
            "description": "Friendly name for this ballot"
          },
          "poll_open_date": {
            "type": "string",
            "description": "Polling day for this ballot"
          },
          "elected_role": {
            "type": "string",
            "description": "Name of the role the winner(s) of this election will assume"
          },
          "metadata": {
            "type": [
              "object",
              "null"
            ],
            "properties": {},
            "description": "Object containing information about special conditions for the user to be aware about (e.g: cancelled elections, voter id pilot)."
          },
          "cancelled": {
            "type": "boolean",
            "description": "True if this ballot has been cancelled"
          },
          "cancelled_reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "The reason this ballot has been cancelled"
          },
          "replaced_by": {
            "type": [
              "string",
              "null"
            ],
            "description": "If a ballot has been cancelled (cancelled = true) and rescheduled for a later date, this key will hold the ballot_paper_id of the ballot that replaces it."
          },
          "replaces": {
            "type": [
              "string",
              "null"
            ],
            "description": "If this ballot replaces another cancelled ballot, this key will hold the ballot_paper_id of the ballot that it replaces."
          }
        }
      },
      "description": "An array of ballot objects listing the elections applicable to this request"
    }
  }
}

Northern Ireland 

WhereDoIVote will sometimes hold polling station data for Northern Ireland.

If we hold data then the postcode and address endpoints will behave the same for locations in Northern Ireland as those in England, Scotland and Wales.

If we don't have information about polling stations in Northern Ireland we provide an external link to the polling station finder service run by the Electoral Office for Northern Ireland run their own service. e.g:

{
...
  "custom_finder": "http://www.eoni.org.uk/Offices/Postcode-Search-Results?postcode=BT28%202EY"
}

ID Requirements

All voters in Northern Ireland must present photo ID to vote at a polling station.

This information will be provided in all responses from the /address and /postcode API endpoints, even if we are not able to provide a polling station result.

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

Response 

List all councils. Returns an array of council objects

Request GET /councils.json
Response 200
Headers:
Content-Type: application/json
Body:
[
  {
    "url": "https://wheredoivote.co.uk/api/beta/councils/E07000223/",
    "council_id": "E07000223",
    "name": "Adur District Council",
    "nation": "England",
    "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"
  }
]
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

Response 

Retrieve meta-data about a council in JSON format.

Request GET /councils/{council_id}.json
Response 200
Headers:
Content-Type: application/json
Body:
{
  "url": "https://wheredoivote.co.uk/api/beta/councils/E07000223/",
  "council_id": "E07000223",
  "name": "Adur District Council",
  "nation": "England",
  "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"
}
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"
    },
    "nation": {
      "type": "string",
      "description": "Name of nation"
    },
    "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"
    },
    "postcode": {
      "type": "string",
      "description": "Postcode component of contact address for this council"
    },
    "address": {
      "type": "string",
      "description": "Contact address for this council"
    }
  }
}

Councils: GeoJSON 

/councils/{council_id}/geo.json

Parameters

  • council_id string ( required )

    GSS code for this council

    Example: W06000015

Response 

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

Request GET /councils/{council_id}/geo.json
Response 200
Headers:
Content-Type: application/json
Body:
{
  "geometry": {
    "type": "MultiPolygon",
    "coordinates": [
      "..."
    ]
  },
  "type": "Feature",
  "id": "E07000223",
  "properties": {
    "url": "https://wheredoivote.co.uk/api/beta/councils/E07000223/",
    "council_id": "E07000223",
    "name": "Adur District Council",
    "nation": "England",
    "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"
  }
}
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"
        },
        "nation": {
          "type": "string",
          "description": "Name of nation"
        },
        "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"
        },
        "postcode": {
          "type": "string",
          "description": "Postcode component of contact address for this council"
        },
        "address": {
          "type": "string",
          "description": "Contact address for this council"
        }
      }
    }
  }
}

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

Response 

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

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/?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",
    "address": "Shoreham Free Church Hall\\nBuckingham Road/Gordon Road\\nShoreham-by-Sea",
    "postcode": "BN43 6WF"
  }
]
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

Response 

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

Request GET /pollingstations/geo.json?council_id={council_id}
Response 200
Headers:
Content-Type: application/json
Body:
{
  "type": "FeatureCollection",
  "features": [
    {
      "geometry": {
        "type": "Point",
        "coordinates": [
          -0.269324,
          50.834949
        ]
      },
      "type": "Feature",
      "id": "E07000223.527",
      "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",
        "address": "Shoreham Free Church Hall\\nBuckingham Road/Gordon Road\\nShoreham-by-Sea",
        "postcode": "BN43 6WF"
      }
    }
  ]
}
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

Response 

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

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/?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",
  "address": "Shoreham Free Church Hall\\nBuckingham Road/Gordon Road\\nShoreham-by-Sea",
  "postcode": "BN43 6WF"
}
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"
    }
  }
}

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

Response 

Retrieve a GeoJSON Feature describing a polling station.

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": [
      -0.269324,
      50.834949
    ]
  },
  "type": "Feature",
  "id": "E07000223.527",
  "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",
    "address": "Shoreham Free Church Hall\\nBuckingham Road/Gordon Road\\nShoreham-by-Sea",
    "postcode": "BN43 6WF"
  }
}
Schema:
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "geometry": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "type": {
          "type": "string"
        },
        "coordinates": {
          "type": "array",
          "items": [
            {
              "type": "number"
            },
            {
              "type": "number"
            }
          ]
        }
      },
      "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"
        }
      }
    }
  }
}