Reference
Government
Query African government offices, people, tenure history, sourced institutional relationships and country government overviews.
Government History In Africa API
Government history is a separate domain from governance indicators.
Query:
- current heads of state and government
- historical leadership terms
- offices grouped into executive, legislature, regional and local government, related institutions, and other recorded offices
- sourced office-to-institution relationships, where recorded
- leader detail pages across countries
- country-level government overviews
- recent elections embedded into those country overviews
- recent policy and law records plus policy-event summaries embedded into those country overviews
Current sources:
wikidata_government_historywikidata_current_governmentswikidata_government_structure(office and institutional metadata)
Use:
GET /v1/government/overview/{country_code}GET /v1/government/structure/{country_code}GET /v1/government/leadersGET /v1/government/leaders/{leader_wikidata_id}GET /v1/government/termsGET /v1/government/cabinet/{country_code}GET /v1/government/cabinet-members
Related elections routes:
GET /v1/electionsGET /v1/elections/country/{country_code}GET /v1/elections/{election_wikidata_id}GET /v1/elections/results/{election_wikidata_id}
Scope Note
- Governance covers annual institutional indicators like rule of law or corruption control.
Governmentcovers leaders, terms of office, cabinet records and related public offices. Coverage outside the national executive is partial.- Elections covers election events and candidate-level results.
Offices, people and institutional relationships
The structure endpoint combines leadership and cabinet records by office. It keeps historical terms and related offices, including parliamentary, regional and local roles. It does not provide a complete government roster.
curl "https://api.africa-api.com/v1/government/structure/ke" \
-H "Authorization: Bearer $AFRICA_API_KEY"The response has these fields under data:
| Field | Contents |
|---|---|
country | Country code, name and region |
generated_at | When this response was generated; not a source verification date |
groups | Display group names with office and term counts |
offices | Office identity, classification, source and recorded tenures |
institutions | Institutions named by the returned relationships |
relationships | Recorded Wikidata connections with source URLs, date qualifiers and retrieval times |
limitations | Coverage and interpretation notes |
Each office has a group: executive, legislature, subnational, related or unclassified. Its classification identifies the evidence used. Office identity and dedicated leadership records take priority over title matching. A title-based classification is an inference, not a verified organizational placement.
Each term includes a person, dates where available, a source URL and a status:
| Status | Meaning |
|---|---|
historical | A recorded end, death date or supported correction places the term in the past; the exact end date can still be unknown |
current_reported | The source marks the term current and a non-future start date is recorded; current service is not independently verified |
unknown | The available dates and evidence do not establish current service |
future | The recorded start date is in the future |
status_basis explains the result. source_is_current preserves the source flag separately. When the same statement appears in multiple sources, it is returned as one term with its source_codes, source_urls and leadership_roles retained. A null date means the exact date is unknown; it can reflect missing, partial or conflicting source dates. start_date_evidence and end_date_evidence preserve the source value, numeric Wikidata precision, calendar_model and validated earliest, latest and exact_date bounds. The explorer displays supported years and months with precision labels, shows multiple differing candidates as uncertain, and leaves unsupported dates unresolved. Terms are ordered by a supported start year, then by name within a year; no exact day is invented for sorting. With no usable evidence it shows “Start unknown”, “End unknown” or “Dates unknown”. Do not turn a null end date into “present” or use an undated source flag as proof of current service. The structure status is evaluated when requested; the older cabinet and leadership endpoints retain their existing current-flag semantics.
Relationships carry a type, display label, property_id, source_url, reference_count, retrieved_at and optional start_date/end_date. Supported relationship types include part of, jurisdiction, organization led, parent organization and membership. These are the specific relationships recorded in Wikidata; they do not establish a general reporting hierarchy. An undated relationship has status: "undated". A retrieval timestamp records when metadata was fetched, not when the connection was independently verified. Missing relationships are returned as an empty array.
Office terms may include image: { file, license, attribution } from Wikimedia Commons. An image or individual credit field can be null. Link to the Commons file page, display the supplied licence and attribution, and check the file's reuse terms. Do not invent missing credit text.
The Kenya government explorer presents these records with search, government-area filters and tenure history.
Source observations and official relationships
The government records explorer presents a separate research layer. Records retain source identities and date precision. Observation counts are source rows, not unique people or continuous tenures.
| Endpoint | Contents |
|---|---|
GET /v1/government/research/jurisdictions | Country and administration labels, status notes and evidence |
GET /v1/government/research/coverage | Observation and relationship counts grouped by source, edition, type and jurisdiction |
GET /v1/government/research/{jurisdiction}/observations | Person and office source records, including unknown names and source-reported vacancies |
GET /v1/government/research/{jurisdiction}/relationships | Typed institutional evidence with source locations and applicability limits |
curl "https://api.africa-api.com/v1/government/research/ke/observations?year=2000&limit=30&offset=0" \
-H "Authorization: Bearer $AFRICA_API_KEY"Responses include data, meta.total, pagination metadata where applicable, and limitations. Observation filters include q (person or office), year, kind, source_code and dataset_version. Relationship filters include relationship_type, applicability, source_code and dataset_version. Both record endpoints accept limit (up to 500) and offset.
Observation types have different meanings:
observation_kind | Meaning |
|---|---|
annual_snapshot | A source’s annual record, possibly with a known month; it does not imply service for the entire year |
dated_snapshot | A source snapshot; a live-page retrieval date may differ substantially from the source’s update date |
research_wave | A study observation whose collection window may span years; individual office dates can remain unknown |
undated_snapshot | The source observation lacks an established date |
documented_event | A dated event such as nomination, appointment or taking office, retained as that event |
Read date_precision alongside the observation components. A year or month is not converted into an exact day. Source publication, source update, retrieval and event dates remain separate. A page retrieved today can contain a roster last updated years earlier. When a page has no established observation date, the explorer says so and displays its retrieval date separately; retrieval does not date the officeholder’s service. A blank name is unknown; only an explicit source vacancy is vacant_reported. Source identifiers and matching names do not by themselves establish that records describe the same person.
Relationships preserve their direction and type. reports_to, provides_reports_to, accountable_to, appointed_by, member_of and independent_of must not be combined into a single managerial hierarchy. applicability is current_verified, historical or unknown. An official publication can support a source-attributed statement while current legal applicability remains unknown; review notes in context explain that distinction. A review date is not a legal effective date. Held evidence is not a confirmed current relationship.
Jurisdiction slugs include two-letter country codes and separately labelled administrations such as somaliland and sadr. Their status notes describe the source coverage and do not determine sovereignty, recognition or territorial control. Consult the returned registry for available entries.
Each observation or relationship includes a joined source with edition, citation, licence and dataset limitations. The research views use initials when no portrait is supplied. Existing office terms and Commons portrait credits remain available in the office and tenure explorer.
Country Overview Example
curl "https://api.africa-api.com/v1/government/overview/ke" \
-H "Authorization: Bearer $AFRICA_API_KEY"Illustrative response shape. Values are examples, not a current government roster:
{
"data": {
"country": {
"code": "ke",
"name": "Kenya",
"region": "East Africa"
},
"current_head_of_state": {
"leader_wikidata_id": "LEADER_WIKIDATA_ID",
"leader_name": "William Ruto",
"office_name": "President of Kenya",
"role_type": "head_of_state",
"start_date": "2022-09-13",
"source": "wikidata_government_history"
},
"current_head_of_government": {
"leader_wikidata_id": "LEADER_WIKIDATA_ID",
"leader_name": "William Ruto",
"office_name": "President of Kenya",
"role_type": "head_of_government",
"start_date": "2022-09-13",
"source": "wikidata_government_history"
},
"cabinet_member_count": 3,
"current_cabinet_members": [
{
"statement_id": "STATEMENT_ID",
"leader_wikidata_id": "LEADER_WIKIDATA_ID",
"leader_name": "John Mbadi",
"country_code": "ke",
"country_name": "Kenya",
"office_name": "Cabinet Secretary for National Treasury",
"role_category": "minister",
"party_name": "ODM",
"start_date": "2024-08-08",
"is_current": true,
"source": "wikidata_current_governments",
"source_url": "https://www.wikidata.org/wiki/LEADER_WIKIDATA_ID"
}
],
"recent_terms": [],
"recent_elections": []
}
}Leader Search Example
curl "https://api.africa-api.com/v1/government/leaders?q=ruto¤t_only=true&limit=20" \
-H "Authorization: Bearer $AFRICA_API_KEY"Historical Terms Example
curl "https://api.africa-api.com/v1/government/terms?country_code=ng&role_type=head_of_state&start_date_from=2000-01-01&limit=20" \
-H "Authorization: Bearer $AFRICA_API_KEY"Current Cabinet Example
curl "https://api.africa-api.com/v1/government/cabinet-members?country_code=ke¤t_only=true&limit=25" \
-H "Authorization: Bearer $AFRICA_API_KEY"How It Fits The Rest Of The API
Country profiles include current leaders, selected cabinet members, and the latest election when available. Use the Elections and Policies endpoints for event histories. Annual governance indicators are queryable through /v1/data.
Countries
Read government records alongside selected indicators and trade data.
Elections
Use the elections domain for country election timelines and result rows.
Policies
Use the policies domain for laws, policy documents, and policy-event timelines.
Governance
Use governance indicators for country-year institutional comparisons.
Data
Query annual governance indicators by country and year.
Trade
Use the dedicated trade domain for African trade overviews, partner data, product data, and trade flows, with aggregate trade metrics also available through shared data endpoints.
Elections
Query African election events, country election overviews, and candidate-level results from Wikidata where available.