{"source":"valgresultat","operation":"get_election_result","description":"Official result for one election, optionally for one area. Signature: get_election_result(year: integer, calendar year, required; election_type: string, required; area: string, optional, default None; polling_district: string, optional, default None; max_parties: integer, optional, default 30; limit: integer, items, optional, default 25; offset: integer, items, optional, default 0).","signature":"get_election_result(year: integer, calendar year, required; election_type: string, required; area: string, optional, default None; polling_district: string, optional, default None; max_parties: integer, optional, default 30; limit: integer, items, optional, default 25; offset: integer, items, optional, default 0)","parameters":[{"name":"year","type":"integer","schema":{"type":"integer"},"required":true,"default":null,"description":"Election year, e.g. 2025 (see list_elections). Unit: calendar year.","unit":"calendar year"},{"name":"election_type","type":"string","schema":{"type":"string"},"required":true,"default":null,"description":"\"st\" (Stortingsvalg), \"ko\" (Kommunestyrevalg), \"fy\" (Fylkestingsvalg) or \"sa\" (Sametingsvalg); the Norwegian name or the English parliament, municipal, county, sami also works.","unit":null},{"name":"area","type":"string","schema":{"anyOf":[{"type":"string"},{"type":"null"}]},"required":false,"default":null,"description":"Restrict to a county or municipality by name or number, e.g. \"Vestland\", \"46\" or \"Gloppen\". Omit for the national result.","unit":null},{"name":"polling_district","type":"string","schema":{"anyOf":[{"type":"string"},{"type":"null"}]},"required":false,"default":null,"description":"Restrict to one polling district (stemmekrets) by name or number. Requires area to name a municipality.","unit":null},{"name":"max_parties","type":"integer","schema":{"type":"integer"},"required":false,"default":30,"description":"Max parties to return, 1-100 (default 30).","unit":null},{"name":"limit","type":"integer","schema":{"type":"integer","minimum":1,"maximum":100,"default":25},"display_type":"integer","required":false,"default":25,"description":"Maximum list items returned by the gateway (default 25, maximum 100).","unit":"items"},{"name":"offset","type":"integer","schema":{"type":"integer","minimum":0,"default":0},"display_type":"integer","required":false,"default":0,"description":"Number of list items to skip before returning the page.","unit":"items"}],"json_get_url_template":"https://allemannsdata.com/wiki/api/v1/kilder/valgresultat/get_election_result?year={year}&election_type={election_type}&area={area}&polling_district={polling_district}&max_parties=30&limit=25&offset=0","schema_scope":"#/data in the successful operation envelope","response_schema":{"type":"object","properties":{"year":{"type":"integer"},"election_type":{"type":"string","enum":["st","ko","fy","sa"]},"election_name":{"type":"string"},"level":{"type":["string","null"]},"name":{"type":["string","null"]},"nr":{"type":["string","integer","null"]},"eligible_voters":{"type":["integer","null"]},"turnout_percent":{"type":["number","null"]},"votes_total":{"type":["integer","null"]},"seats_total":{"type":["integer","null"]},"counted_final_percent":{"type":["number","null"]},"report_generated":{"type":["string","null"],"format":"date-time"},"parties":{"type":"array","items":{"type":"object","properties":{"code":{"type":["string","null"]},"name":{"type":["string","null"]},"votes":{"type":["integer","null"]},"percent":{"type":["number","null"]},"change_percent_points":{"type":["number","null"]},"seats":{"type":["integer","null"]},"seats_change":{"type":["number","null"]}},"additionalProperties":false,"required":["code","name","votes","percent"]}},"subareas":{"type":"array","items":{"type":"object","properties":{"name":{"type":["string","null"]},"nr":{"type":["string","integer","null"]}},"additionalProperties":false,"required":["name","nr"]}}},"additionalProperties":false,"required":["year","election_type","election_name","parties","subareas"]},"response_schema_status":{"status":"declared","codegen_safe":true,"description":"Maintained response contract."},"entity_projection":{"status":"intentionally_none","entity_types":[],"description":"No stable cross-source entity projection is defined for this operation; entities is intentionally empty."},"error_contract":{"scope":"top-level HTTP error response; never part of a success payload","schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"details":{"type":"object"}},"additionalProperties":false,"required":["code","message","retryable"]},"suggestion":{"type":"string"},"_meta":{"type":"object","properties":{"retrieved_at":{"type":"string","format":"date-time"},"language":{"type":"string","const":"en"},"content_languages":{"type":"array","items":{"type":"string"}},"sources":{"type":"array","items":{"type":"object"}}},"required":["retrieved_at","language","content_languages","sources"]},"_links":{"type":"object","properties":{"self":{"type":"string","format":"uri"},"api_index":{"type":"string","format":"uri"},"feedback":{"type":"string","format":"uri"}},"required":["self","api_index","feedback"],"additionalProperties":false}},"additionalProperties":false,"required":["error","suggestion","_meta","_links"]},"statuses":{"400":{"codes":["MISSING_PARAMETER","INVALID_PARAMETER","INVALID_REQUEST"],"retryable":false},"404":{"codes":["SOURCE_NOT_FOUND","OPERATION_NOT_FOUND","ENTITY_NOT_FOUND"],"retryable":false},"429":{"codes":["RATE_LIMITED","GATEWAY_RATE_LIMITED"],"retryable":true},"502":{"codes":["SOURCE_UNAVAILABLE"],"retryable":true},"500":{"codes":["INTERNAL_ERROR"],"retryable":true}}},"_links":{"self":"https://allemannsdata.com/wiki/api/v1/kilder/valgresultat/get_election_result","operation":"https://allemannsdata.com/wiki/api/v1/kilder/valgresultat/get_election_result","source":"https://allemannsdata.com/wiki/api/v1/kilder/valgresultat","feedback":"https://allemannsdata.com/wiki/api/v1/feedback"},"output_fields":["year","election_type","election_name","level","name","nr","eligible_voters","turnout_percent","votes_total","seats_total","counted_final_percent","report_generated","parties","parties[].code","parties[].name","parties[].votes","parties[].percent","parties[].change_percent_points","parties[].seats","parties[].seats_change","subareas","subareas[].name","subareas[].nr"],"output_fields_truncated":false,"canonical_field_aliases":{"name":["name","parties[].name","subareas[].name"],"identifier":["parties[].code"]},"response_example":{"source":"valgresultat","operation":"get_election_result","parameters":{"year":1,"election_type":"example value","area":"example value","polling_district":"example value","max_parties":30},"data":{"year":1,"election_type":"st","election_name":"Example","level":"example value","name":"Example","nr":"example value","eligible_voters":1,"turnout_percent":1.0,"votes_total":1,"seats_total":1,"counted_final_percent":1.0,"report_generated":"2026-01-15T12:00:00Z","parties":[{"code":"example value","name":"Example","votes":1,"percent":1.0,"change_percent_points":1.0,"seats":1,"seats_change":1.0}],"subareas":[{"name":"Example","nr":"example value"}]},"entities":[],"_meta":{"retrieved_at":"2026-01-15T12:00:00Z","language":"en","content_languages":["en"],"sources":[{"id":"valgresultat","name":"Election results","description":"Official Norwegian election results from 2009 onwards at national, county, municipality and polling-district level, from Valgdirektoratet's valgresultat.no.","cache_ttl_seconds":3600,"documentation":"https://valgresultat.no/"}]},"_provenance":{"data":{"source":"valgresultat","source_api":"https://allemannsdata.com/wiki/api/v1/kilder/valgresultat"},"entities":{"source":"valgresultat","source_api":"https://allemannsdata.com/wiki/api/v1/kilder/valgresultat","derived_from":"#/data","description":"Normalized projection of data."}},"_links":{"self":"https://allemannsdata.com/wiki/api/v1/kilder/valgresultat/get_election_result","source":"https://allemannsdata.com/wiki/api/v1/kilder/valgresultat","wiki":"https://allemannsdata.com/wiki/kilder/valgresultat/get_election_result/","feedback":"https://allemannsdata.com/wiki/api/v1/feedback"}}}
