{"openapi":"3.1.0","info":{"title":"OpenCongoData Élections API","version":"1.0.0","description":"Résultats électoraux de la RDC (2006 → 2024) : présidentielles, législatives nationales et provinciales, sénatoriales. Chaque réponse indique la source et le statut des chiffres (`official`, `provisional`, `estimate`, `illustrative`). Quota par clé et par jour : 1000 appels (compte gratuit), 50000 (Premium). Données sous licence CC BY 4.0 : citez « OpenCongoData Élections » et la source indiquée. Réponses en français par défaut ; `?lang=en` ou `Accept-Language: en` pour l’anglais.\n\nDRC election results (2006 → 2024): presidential, national and provincial legislative, and Senate elections. Every response gives the source and the status of the figures. Responses are in French by default; send `?lang=en` or `Accept-Language: en` for English.","license":{"name":"CC BY 4.0 (data)","url":"https://creativecommons.org/licenses/by/4.0/"},"contact":{"email":"support@congodata.app"}},"servers":[{"url":"https://api.elections.congodata.app"}],"security":[{"apiKey":[]}],"paths":{"/v1/elections":{"get":{"summary":"List elections","operationId":"listElections","parameters":[{"name":"limit","in":"query","required":false,"description":"Items per page (1–500, default 100).","schema":{"type":"integer"}},{"name":"cursor","in":"query","required":false,"description":"Value of `links.next` from the previous page.","schema":{"type":"string"}},{"name":"format","in":"query","required":false,"description":"`csv` for CSV instead of JSON (list endpoints).","schema":{"type":"string","enum":["json","csv"]}},{"name":"lang","in":"query","required":false,"description":"Language of the text fields (`name` of elections and the country, `note`, `statusNote`, `label`, `citation`): `fr` (default) or `en`. Without it, `Accept-Language` is used. Ids, numbers and names of people, parties and places never change. The response carries `Content-Language`.","schema":{"type":"string","enum":["fr","en"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Election"}},"meta":{"$ref":"#/components/schemas/Meta"},"links":{"$ref":"#/components/schemas/Links"}}}},"text/csv":{"schema":{"type":"string"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"429":{"$ref":"#/components/responses/Problem"}}}},"/v1/elections/{id}":{"get":{"summary":"One election, with the result levels available and their status","operationId":"getElection","parameters":[{"name":"id","in":"path","required":true,"description":"e.g. `2023-presidential`","schema":{"type":"string"}},{"name":"lang","in":"query","required":false,"description":"Language of the text fields (`name` of elections and the country, `note`, `statusNote`, `label`, `citation`): `fr` (default) or `en`. Without it, `Accept-Language` is used. Ids, numbers and names of people, parties and places never change. The response carries `Content-Language`.","schema":{"type":"string","enum":["fr","en"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Election"},"meta":{"$ref":"#/components/schemas/Meta"},"links":{"$ref":"#/components/schemas/Links"}}}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"429":{"$ref":"#/components/responses/Problem"}}}},"/v1/elections/{id}/results":{"get":{"summary":"Results of an election at one level","operationId":"getResults","parameters":[{"name":"id","in":"path","required":true,"description":"Election id","schema":{"type":"string"}},{"name":"level","in":"query","required":false,"description":"Default: the first level available.","schema":{"type":"string","enum":["national","province","constituency"]}},{"name":"area","in":"query","required":false,"description":"Narrow to an area and everything inside it, e.g. `KN`.","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"Items per page (1–500, default 100).","schema":{"type":"integer"}},{"name":"cursor","in":"query","required":false,"description":"Value of `links.next` from the previous page.","schema":{"type":"string"}},{"name":"format","in":"query","required":false,"description":"`csv` for CSV instead of JSON (list endpoints).","schema":{"type":"string","enum":["json","csv"]}},{"name":"lang","in":"query","required":false,"description":"Language of the text fields (`name` of elections and the country, `note`, `statusNote`, `label`, `citation`): `fr` (default) or `en`. Without it, `Accept-Language` is used. Ids, numbers and names of people, parties and places never change. The response carries `Content-Language`.","schema":{"type":"string","enum":["fr","en"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ResultRow"}},"meta":{"$ref":"#/components/schemas/Meta"},"links":{"$ref":"#/components/schemas/Links"}}}},"text/csv":{"schema":{"type":"string"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"429":{"$ref":"#/components/responses/Problem"}}}},"/v1/elections/{id}/contests":{"get":{"summary":"Constituency races of a legislative election","operationId":"listContests","parameters":[{"name":"id","in":"path","required":true,"description":"Election id","schema":{"type":"string"}},{"name":"province","in":"query","required":false,"description":"Province code, e.g. `KN`","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"Items per page (1–500, default 100).","schema":{"type":"integer"}},{"name":"cursor","in":"query","required":false,"description":"Value of `links.next` from the previous page.","schema":{"type":"string"}},{"name":"format","in":"query","required":false,"description":"`csv` for CSV instead of JSON (list endpoints).","schema":{"type":"string","enum":["json","csv"]}},{"name":"lang","in":"query","required":false,"description":"Language of the text fields (`name` of elections and the country, `note`, `statusNote`, `label`, `citation`): `fr` (default) or `en`. Without it, `Accept-Language` is used. Ids, numbers and names of people, parties and places never change. The response carries `Content-Language`.","schema":{"type":"string","enum":["fr","en"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Contest"}},"meta":{"$ref":"#/components/schemas/Meta"},"links":{"$ref":"#/components/schemas/Links"}}}},"text/csv":{"schema":{"type":"string"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"429":{"$ref":"#/components/responses/Problem"}}}},"/v1/contests/{id}/results":{"get":{"summary":"Every candidate of one race","operationId":"getContestResults","parameters":[{"name":"id","in":"path","required":true,"description":"e.g. `2023-national-assembly:KN-funa`","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"Items per page (1–500, default 100).","schema":{"type":"integer"}},{"name":"cursor","in":"query","required":false,"description":"Value of `links.next` from the previous page.","schema":{"type":"string"}},{"name":"format","in":"query","required":false,"description":"`csv` for CSV instead of JSON (list endpoints).","schema":{"type":"string","enum":["json","csv"]}},{"name":"lang","in":"query","required":false,"description":"Language of the text fields (`name` of elections and the country, `note`, `statusNote`, `label`, `citation`): `fr` (default) or `en`. Without it, `Accept-Language` is used. Ids, numbers and names of people, parties and places never change. The response carries `Content-Language`.","schema":{"type":"string","enum":["fr","en"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ResultRow"}},"meta":{"$ref":"#/components/schemas/Meta"},"links":{"$ref":"#/components/schemas/Links"}}}},"text/csv":{"schema":{"type":"string"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"429":{"$ref":"#/components/responses/Problem"}}}},"/v1/areas":{"get":{"summary":"Country, provinces, constituencies and diaspora countries","operationId":"listAreas","parameters":[{"name":"type","in":"query","required":false,"description":"Area type","schema":{"type":"string","enum":["country","province","constituency","abroad"]}},{"name":"parent","in":"query","required":false,"description":"Parent area id, e.g. `KN`","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"Items per page (1–500, default 100).","schema":{"type":"integer"}},{"name":"cursor","in":"query","required":false,"description":"Value of `links.next` from the previous page.","schema":{"type":"string"}},{"name":"format","in":"query","required":false,"description":"`csv` for CSV instead of JSON (list endpoints).","schema":{"type":"string","enum":["json","csv"]}},{"name":"lang","in":"query","required":false,"description":"Language of the text fields (`name` of elections and the country, `note`, `statusNote`, `label`, `citation`): `fr` (default) or `en`. Without it, `Accept-Language` is used. Ids, numbers and names of people, parties and places never change. The response carries `Content-Language`.","schema":{"type":"string","enum":["fr","en"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Area"}},"meta":{"$ref":"#/components/schemas/Meta"},"links":{"$ref":"#/components/schemas/Links"}}}},"text/csv":{"schema":{"type":"string"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"429":{"$ref":"#/components/responses/Problem"}}}},"/v1/areas/{id}":{"get":{"summary":"One area and its children","operationId":"getArea","parameters":[{"name":"id","in":"path","required":true,"description":"e.g. `KN`","schema":{"type":"string"}},{"name":"lang","in":"query","required":false,"description":"Language of the text fields (`name` of elections and the country, `note`, `statusNote`, `label`, `citation`): `fr` (default) or `en`. Without it, `Accept-Language` is used. Ids, numbers and names of people, parties and places never change. The response carries `Content-Language`.","schema":{"type":"string","enum":["fr","en"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Area"},"meta":{"$ref":"#/components/schemas/Meta"},"links":{"$ref":"#/components/schemas/Links"}}}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"429":{"$ref":"#/components/responses/Problem"}}}},"/v1/candidates":{"get":{"summary":"Search candidates","operationId":"listCandidates","parameters":[{"name":"q","in":"query","required":false,"description":"Name, accents optional (2 characters minimum)","schema":{"type":"string"}},{"name":"election","in":"query","required":false,"description":"Election id","schema":{"type":"string"}},{"name":"area","in":"query","required":false,"description":"Area id (includes sub-areas)","schema":{"type":"string"}},{"name":"party","in":"query","required":false,"description":"Party id","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"Items per page (1–500, default 100).","schema":{"type":"integer"}},{"name":"cursor","in":"query","required":false,"description":"Value of `links.next` from the previous page.","schema":{"type":"string"}},{"name":"format","in":"query","required":false,"description":"`csv` for CSV instead of JSON (list endpoints).","schema":{"type":"string","enum":["json","csv"]}},{"name":"lang","in":"query","required":false,"description":"Language of the text fields (`name` of elections and the country, `note`, `statusNote`, `label`, `citation`): `fr` (default) or `en`. Without it, `Accept-Language` is used. Ids, numbers and names of people, parties and places never change. The response carries `Content-Language`.","schema":{"type":"string","enum":["fr","en"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Candidate"}},"meta":{"$ref":"#/components/schemas/Meta"},"links":{"$ref":"#/components/schemas/Links"}}}},"text/csv":{"schema":{"type":"string"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"429":{"$ref":"#/components/responses/Problem"}}}},"/v1/candidates/{id}":{"get":{"summary":"One candidate and all their results","operationId":"getCandidate","parameters":[{"name":"id","in":"path","required":true,"description":"Candidate id","schema":{"type":"string"}},{"name":"lang","in":"query","required":false,"description":"Language of the text fields (`name` of elections and the country, `note`, `statusNote`, `label`, `citation`): `fr` (default) or `en`. Without it, `Accept-Language` is used. Ids, numbers and names of people, parties and places never change. The response carries `Content-Language`.","schema":{"type":"string","enum":["fr","en"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Candidate"},"meta":{"$ref":"#/components/schemas/Meta"},"links":{"$ref":"#/components/schemas/Links"}}}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"429":{"$ref":"#/components/responses/Problem"}}}},"/v1/parties":{"get":{"summary":"List parties","operationId":"listParties","parameters":[{"name":"limit","in":"query","required":false,"description":"Items per page (1–500, default 100).","schema":{"type":"integer"}},{"name":"cursor","in":"query","required":false,"description":"Value of `links.next` from the previous page.","schema":{"type":"string"}},{"name":"format","in":"query","required":false,"description":"`csv` for CSV instead of JSON (list endpoints).","schema":{"type":"string","enum":["json","csv"]}},{"name":"lang","in":"query","required":false,"description":"Language of the text fields (`name` of elections and the country, `note`, `statusNote`, `label`, `citation`): `fr` (default) or `en`. Without it, `Accept-Language` is used. Ids, numbers and names of people, parties and places never change. The response carries `Content-Language`.","schema":{"type":"string","enum":["fr","en"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Party"}},"meta":{"$ref":"#/components/schemas/Meta"},"links":{"$ref":"#/components/schemas/Links"}}}},"text/csv":{"schema":{"type":"string"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"429":{"$ref":"#/components/responses/Problem"}}}},"/v1/parties/{id}":{"get":{"summary":"One party and its national results across elections","operationId":"getParty","parameters":[{"name":"id","in":"path","required":true,"description":"e.g. `udps`","schema":{"type":"string"}},{"name":"lang","in":"query","required":false,"description":"Language of the text fields (`name` of elections and the country, `note`, `statusNote`, `label`, `citation`): `fr` (default) or `en`. Without it, `Accept-Language` is used. Ids, numbers and names of people, parties and places never change. The response carries `Content-Language`.","schema":{"type":"string","enum":["fr","en"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Party"},"meta":{"$ref":"#/components/schemas/Meta"},"links":{"$ref":"#/components/schemas/Links"}}}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"429":{"$ref":"#/components/responses/Problem"}}}}},"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"Create a key at https://elections.congodata.app/account/api"}},"responses":{"Problem":{"description":"Error (RFC 9457)","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"}}}}}}},"schemas":{"Election":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d{4}-[a-z-]+$"},"kind":{"type":"string","enum":["presidential","national-assembly","provincial-assembly","senate"]},"year":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"name":{"type":"string"},"round":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"seats":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"registeredVoters":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"votesCast":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"turnout":{"type":"number","minimum":0,"maximum":100},"note":{"type":"string"}},"required":["id","kind","year","date","name"],"additionalProperties":false},"Area":{"type":"object","properties":{"id":{"type":"string","pattern":"^(CD|[A-Z]{2}|[A-Z]{2}-[a-z0-9-]+|ABROAD-[a-z0-9-]+)$"},"type":{"type":"string","enum":["country","province","constituency","abroad"]},"name":{"type":"string","minLength":1},"parentId":{"type":"string"},"capital":{"type":"string"},"areaKm2":{"type":"number","exclusiveMinimum":0},"registeredVotersEstimate":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["id","type","name"],"additionalProperties":false},"Party":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z0-9-]+$"},"name":{"type":"string","minLength":1},"fullName":{"type":"string"},"color":{"type":"string","pattern":"^#[0-9A-Fa-f]{6}$"}},"required":["id","name"],"additionalProperties":false},"Candidate":{"type":"object","properties":{"id":{"type":"string","minLength":1},"electionId":{"type":"string"},"areaId":{"type":"string"},"name":{"type":"string","minLength":1},"partyId":{"type":"string"},"sex":{"type":"string","enum":["M","F"]},"ballotNumber":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"ageAtElection":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"birthYear":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"incumbent":{"type":"boolean"}},"required":["id","electionId","areaId","name"],"additionalProperties":false},"Status":{"type":"string","enum":["official","provisional","estimate","illustrative"]},"Source":{"type":"object","properties":{"name":{"type":"string","minLength":1},"note":{"type":"string"},"url":{"type":"string","format":"uri"}},"required":["name"],"additionalProperties":false},"ResultRow":{"type":"object","properties":{"areaId":{"type":"string"},"areaName":{"type":"string"},"candidateId":{"type":"string"},"candidateName":{"type":"string"},"partyId":{"type":"string"},"partyName":{"type":"string"},"aggregate":{"const":"others","description":"The source grouped the remaining candidates or parties."},"label":{"type":"string"},"votes":{"type":"integer"},"percent":{"type":"number"},"seats":{"type":"integer"},"elected":{"type":"boolean"}},"required":["areaId"]},"Contest":{"type":"object","properties":{"id":{"type":"string"},"electionId":{"type":"string"},"areaId":{"type":"string"},"name":{"type":"string"},"provinceId":{"type":"string"},"candidates":{"type":"integer"},"votes":{"type":"integer"},"elected":{"type":"string","description":"Elected candidate ids, separated by `|`"}}},"Meta":{"type":"object","properties":{"datasetVersion":{"type":"string"},"license":{"type":"string"},"citation":{"type":"string"},"source":{"$ref":"#/components/schemas/Source"},"status":{"$ref":"#/components/schemas/Status"},"statusNote":{"type":"string"},"lastUpdated":{"type":"string","format":"date"},"total":{"type":"integer"}}},"Links":{"type":"object","properties":{"self":{"type":"string"},"next":{"type":"string"}}}}}}