diff --git a/ynr/apps/api/templates/api/api-base.html b/ynr/apps/api/templates/api/api-base.html index 61a28b8f9..304c4af7a 100644 --- a/ynr/apps/api/templates/api/api-base.html +++ b/ynr/apps/api/templates/api/api-base.html @@ -12,10 +12,8 @@

Candidates and results data

  • Data Overview
  • Terms
  • -
  • CSV / Excel downloads
  • -
  • Results
  • -
  • Elected CSV
  • -
  • ATOM feed
  • +
  • CSV / Excel downloads
  • +
  • @@ -26,6 +24,7 @@

    Candidates and results data

  • Definitions
  • v0.9 API
  • +
  • Results ATOM feed
  • diff --git a/ynr/apps/api/templates/api/api-home.html b/ynr/apps/api/templates/api/api-home.html index c5c71fead..c81e94b19 100644 --- a/ynr/apps/api/templates/api/api-home.html +++ b/ynr/apps/api/templates/api/api-home.html @@ -33,7 +33,7 @@ ### Formats -We have data in [CSV format]({% url "api_docs_csv" %}) or a REST API. +We have data in [CSV format]({% url "data_home" %}) or a REST API. There are currently two API versions, [v0.9]({% url "api-root" version="v0.9" %}) and [next]({% url "api_docs_next_home" %}). diff --git a/ynr/apps/api/templates/api/results.html b/ynr/apps/api/templates/api/atom.html similarity index 67% rename from ynr/apps/api/templates/api/results.html rename to ynr/apps/api/templates/api/atom.html index 8dae6661a..b25173bd0 100644 --- a/ynr/apps/api/templates/api/results.html +++ b/ynr/apps/api/templates/api/atom.html @@ -1,104 +1,9 @@ {% extends "api/api-base.html" %} {% block api_page_title %} -

    Results data

    +

    Results Atom feed

    {% endblock %} {% block api_content %} -

    Types of results

    -

    At the moment, we only support results for elections that use First Past The Post.

    - -

    We store two different types of results: elected and votes cast.

    - -

    Elected results involve just setting a flag on the candidacy - that the person was elected. This is the simplest form of result, and is often the quickest and easiest - information to collect.

    - -

    Votes cast results are the numbers of votes cast per person. For first past the post - elections, the winners are set based on the number of winners for that ballot.

    - -

    2019 General election 'elected' CSV

    -

    For the 2019 General election we are publishing a CSV of winners, overnight.

    -

    The CSV will contain a header row, and then one row per ballot containing information - about the winner. No votes cast data will be in the CSV

    - -Download the CSV - -

    The headings of th CSV are:

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Column NameDescription
    election_slugparl.2019-12-12. Here for future proofing the format.
    ballot_paper_idThe Democracy Club ballot paper ID. See the - reference definition - for detailed information. Used to format URLs on most of our sites, and in the REST API
    gssThe GSS code for the ballot
    person_idThe numerical ID assigned to a person by this site.
    person_nameThe person's name
    party_idThe Party ID of the elected person. - See the Party - documentation for more. - Look out for edge cases here, for example joint-party:53-119 - is the ID for 'Labour and Co-operative Party', ynmp-party:2 'Independent' and - joint-party:53-119 'Speaker seeking re-election'. All other values should match - The Electoral Commission IDs
    party_nameThe party name
    theyworkforyou_urlIf the person has ever been elected as an MP, they will have a TheyWorkForYou - URL here. Note that this doesn't mean they are an "incumbent", as they might not have - been in MP in the last parliament.
    wikidata_idThe person's Wikidata ID
    updatedThe time the winner was recorded
    previous_winnerThe person ID of the person who was elected in the previous ballot for this area
    previous_winner_partyThe party ID of the person who was elected in the previous ballot for this area
    - -

    Votes Cast

    -

    Votes cast will be - published in our 'next' API.

    -

    Use the last_updated param to poll for updates.

    - -

    ATOM feeds

    +

    Results ATOM feeds

    There is an atom feed of recent election results available in two versions: