TheyWorkForYou Election Survey API

Well, not so much an API, as some files you can download. They're made in real time though.

Spreadsheet

all_responses.csv - spreadsheet of all responses, including candidate name, constituency, party and the question.

JSON

stats.json - basic count of how many candidates have completed survey.
candidacies.json - list of all candidacies, whether they have been emailed / posted to fill in the survey, and whether they have filled it in.
candidates.json - name, email and address of each candidate.
seats.json - name of each seat. Includes a special magic seat called "National" for the national questions.
issues.json - the question for each national and local issue.
responses.json - survey responses to questions, including extra text responses. agreement ranges from 0% for strongly disagree, to 100% for strongly agree. Add ?national=1 to the URL to get national question responses only (more likely to load). This doesn't work as dataset is too large - please use the all_responses.csv above which is a static dump.

Notes on JSON files:

  1. Use the key_name fields to cross reference between the files.
  2. The candidacies/candidates distinction is a historical accident. We thought more candidates stood in multiple seats, and that would matter more. So alas, to get name of a candidacy, you have to look it up by key_name in the candidates file.
  3. The candidacies, candidates and seats data are all imported straight from YourNextMP. You might find the direct YourNextMP data source useful. The various ynmp_id fields in the above JSON files cross link to it.
  4. The issues data is from Democracy Club. You can download a CSV file of their local issues data direct from them. But the version in the files above is the fixed version which the final 2010 election survey used. Questions might have changed since then, at least in theory.
  5. Deleted candidacies and issues are stored in our database but are now exported in the above files. Now the survey collection is over and the list of candidates is fixed, that's probably not a problem.