Open Data

In the interest of being open and transparent we are going to publish as much of the data we hold as possible. Where we use external data for our recommendations, we will do our best to cite this.

This data will generally fall into one of two categories:

  1. Data that is immutable, such as historical data. You are encouraged to use it in your own analysis or on your own website (and linking to our site so that we host it is fine)
  2. Data that is mutable or ever-changing. We may change the structure and values of this data. Polls change, and new information often comes to light as we approach the election date.

Data normalisation takes some effort, so we are encouraging others to use these sources, some of this data is public already on Government or Electoral Commission web sites (such as General Election results) but this is consistently formatted and easy to use.

Recommendations

If you have any questions about our recommendations, please visit our FAQ

This data is mutable and can change several times a day. As a guide it will change no more than once every 5 minutes and you are free to poll this data as frequently as you wish, or to include it within any web page that you like. Note: This is up to date for the 2019 election.

The CSV looks like:

id,Constituency,"Vote For",Why,Priority
W07000049,Aberavon,Labour,"Current Labour seat.",3

The JSON looks like (the source is minified):

[
{
"id":"W07000049",
"Constituency":"Aberavon",
"VoteFor":"Labour",
"Why":"Current Labour seat.",
"Priority":"3"
},
...

Within each recommendation are the following fields:

  • id = ONS_ID for the constituency, relates to the General Election data below
  • Constituency = name of the constituency, use the id for joining against other data sources as the name is presentation only
  • VoteFor = the recommendation. This is a string and may say things like "Labour or Lib Dem TBC"
  • Why = the reasoning, summaried. This is a sentence and may say things like "Current Tory seat where it isn't yet clear who poses the biggest threat to them."
  • Priority = importance, presently contains numberic values stored as a string, on a scale of 1-4 where 1 is a key seat and 4 is least important (most safe).

Data for recommendations:

General Election Results

Original sources:

Our changes have been to produce CSV that looks like:

year,id,name,candidate,party,votes,incumbent,elected
2010,W07000049,Aberavon,"Francis, Hywel",Labour Party,16073,true,true
2010,W07000049,Aberavon,"Davies, Keith",Liberal Democrat,5034,false,false

And to produce JSON that looks like:

{
"elections": [
{
"year": 2010,
"constituencies": [
{
"id": "W07000049",
"name": "Aberavon",
"results": [
{
"candidate": "Francis, Hywel",
"party": "Labour Party",
"votes": 16073,
"incumbent": true,
"elected": true
},
{
"candidate": "Davies, Keith",
"party": "Liberal Democrat",
"votes": 5034,
"incumbent": false,
"elected": false
},
...

We have also normalised the names of political parties to the 2015 equivalent to reduce variance and allow for easier processing, and consistently made the names "surname, forename".

This data is immutable and can be linked or embedded however you please. The following URLs will not change.

Data for 2010 and 2015 General Elections (combined):

Data for 2015 General Election:

Data for 2010 General Election:

The same election data is also available per constituency using the ONS_ID to identify the file you want. Each file contains both the 2010 and 2015 results for that one constituency.

These files look like this:

{
  "id": "W07000049",
  "name": "Aberavon",
  "y2010": [
    {
      "candidate": "Francis, Hywel",
      "party": "Labour Party",
      "votes": 16073,
      "incumbent": true,
      "elected": true
    },
    ...
  ],
  "y2015": [
    {
      "candidate": "Kinnock, Stephen",
      "party": "Labour Party",
      "votes": 15416,
      "incumbent": false,
      "elected": true
    },
    ...
  ]
}

There are 650 such files and they can be found at https://tacticalvote.co.uk/data/{ONS_ID}.json, where you replace the {ONS_ID} with the ONS_ID of the constituency, i.e. https://tacticalvote.co.uk/data/W07000049.json for Aberavon.

Location Data

To determine your constituency we need to lookup either a geolocation (latitude and longitude) or a UK postal code and fetch the constituency identifier.

This data is published by Ordnance Survey and is known as boundary-line data:

That data is a little unwieldy in raw form, so we use a service called postcodes.io:

This is an open source API that uses the Ordnance Survey boundary-line data. We have verified that the data is correct according to the Ordnance Survey data.

The response from postcodes.io gives us the parliamentary constituency name but not the ONS_ID so in this case we have ensured that our names within recommendations.json (described above) match the ones given to us by postcodes.io .