elections

GET

elections

Get election results (Wahlen)

https://api.srgssr.ch/polis-api/v2 /elections

Name Values Description
lang

The language of the multilanguage content. Must be one of "de" (German), "fr" (French), "it" (Italian), "rr" (Romansch), "en" (English)

caseId

Provide the case ID if you wish to get a specific case, e.g. a case in the past. You can get a List of all cases by fetching cases api service

electionid

Provide the election ID if you wish to get specific results from this one election.

locationid

Provide the location ID if you wish to get specific results from this location. You can get a List of all locations by fetching /locations

locationtypeid

Provide the locationType ID if you wish to get results just for Cantons or Countries. LocationTypes are "1 - Country (Land)", "2 - Canton (Kanton)", "3 - Destrict (Bezirk)", "4 - Community (Gemeinde)", "5 - Swiss citizens living abroad (Ausland Schweizer)", "6 - Urban District (Stadtkreis)"

dataconditionid

Provide the datacondition ID if you wish to get specific results from this datacondition. Available dataconditions are "3 - result", "4 - extrapolation 1", "8 - extrapolation 2", "9 - extrapolation 3", "5 - web", "6 - trend", "7 - zwischenstand", "10 - fremde Hochrechnung"

party

Provide a partyname (short) if you wish to get specific results for this party. You can get a List of all partys by fetching parties api service

timestamp

Timestamp in the format "YYYY-MM-DDThh:mm:ss" You can provide the timestamp of the last file you received. If something changed since your last request, you will get a new XML File. If nothing changed, you will get an XML File with the following inner XML true

sortby

Provide a sort-condition if you want to order the result. "0" - Candidates are ordered by number of votes. Partys are ordered by number of seats and by the percent value of votes. "1" - Candidates and partys are ordered by the left/right position.

selectonly

Provide a selectonly-condition if you want to minimize the xml-file. With this parameter you can specify which results will be returned. Available values are "1 - Just candidate-results", "2 - Just party-results", "3 - CandidateResults&PartyResults", "4 - Just meta-results", "5 - MetaResults&CandidateResults", "6 - MetaResults&PartyResults", "7 - All"

onlychangedates

You can use this parameter if you want only the timestamp of the last change date of the results. All other parameters except the timestamp are included In the search.

Name Values Description
accept

Authorization

Pass the access-key as a Bearer token in Authorization header. In the developer portal, Authorization header is attached on OAuth authentication. you can use a pre-existing bearer token here or generate one using the button below before sending the request.

HTTP Basic

OAuth 2.0

API Key

Reset

Working...

Make a request and see the response.

Make a request and see the response.

Make a request and see the response.

HTTP Code Error Code Description
400

Object of type BadRequest.

401

Object of type TokenError

403

Object of type QuotaViolation.

404

Object of type UnknownResource.

405

Object of type MethodNotAllowed.

Resource Summary

Security

Category

Elections