Skip to main content
The GSS StatsBank API provides access to multiple databases containing survey and census data from the Ghana Statistical Service. Use the base URL to query available databases and navigate to specific tables.

Base API URL

URL = "https://statsbank.statsghana.gov.gh:443/api/v1/en/"

Available Databases

PHC 2021 StatsBank

Population and Housing Census 2021 data including population, housing, education, economic activity, and more.Topics Available:
  • Difficulties in Performing Activities
  • Economic Activity
  • Education and Literacy
  • Fertility and Mortality
  • Housing
  • Human Development Indicators
  • ICT
  • Multidimensional Poverty
  • Population
  • Structures
  • Water and Sanitation

PHC2010

Population and Housing Census 2010 historical data for comparative analysis.

GLSS7

Ghana Living Standards Survey Round 7 (GLSS7) data on household living conditions and welfare.

Annual Household Income and Expenditure Survey (AHIES)

Annual survey data on household income, consumption, and expenditure patterns.

Ghana Census of Agriculture (GCA)

Agricultural census data including farm holdings, crop production, and livestock.

Education(Admin)

Administrative data from educational institutions including enrollment and performance statistics.

Macro Economic Indicators

Key macroeconomic indicators including GDP, inflation, and trade statistics.

Macroeconomic Indicators

Additional macroeconomic indicators and time series data.

Trade

Import and export statistics, trade balance, and international trade data.

Search Bar

Search functionality across all databases.

Accessing Database Contents

To explore what’s inside a database, make a GET request by appending the database ID to the base URL:
library(httr2)

# List all databases
request(URL) |> 
  req_perform() |> 
  resp_body_json()

# Explore a specific database
request(URL) |> 
  req_url_path_append("PHC 2021 StatsBank") |> 
  req_perform() |> 
  resp_body_json()

Database Hierarchy

The API follows a hierarchical structure:
  1. Databases - Top-level collections (e.g., “PHC 2021 StatsBank”)
  2. Levels/Topics - Categories within databases (e.g., “Water and Sanitation”)
  3. Tables - Individual data tables ending in .px extension
Use the build_url() helper function from the Quick Start guide to navigate the database hierarchy efficiently.

Build docs developers (and LLMs) love