Endpoints

List Datasets

GET /v1/datasets

List all available datasets. Returns paginated metadata and an array of dataset objects. Each entry includes the dataset's config name — use it to fetch data or schema for a specific dataset. Use category to filter by topic.

Query parameters

ParameterTypeDefaultDescription
categorystringFilter by topic (economy, agriculture, governance)
limitinteger100Records to return (1–100)
offsetinteger0Records to skip

Example request

curl "https://api.plus254.co.ke/v1/datasets?limit=2"
import requests

url = "https://api.plus254.co.ke/v1/datasets"
params = {"limit": 2}

response = requests.get(url, params=params)
print(response.json())
fetch("https://api.plus254.co.ke/v1/datasets?limit=2")
  .then(r => r.json())
  .then(data => console.log(data));
Response
{
  "metadata": {
    "resultset": {
      "count": 45,
      "offset": 0,
      "limit": 2
    }
  },
  "results": [
    {
      "config": "forex_period_average",
      "name": "Monthly Exchange Rates (Period Average)",
      "category": "economy",
      "description": "Monthly exchange rates of major currencies against KES",
      "source": "Central Bank of Kenya",
      "url": "https://www.centralbank.go.ke/..."
    }
  ]
}
Single Dataset

GET /v1/datasets/{config_name}

Retrieve all records for a specific dataset. Use the config value from the list endpoint. Unknown datasets return a 404 with a suggested correction via fuzzy matching.

Path parameters

ParameterTypeDescription
config_namestringDataset config, e.g. forex_period_average

Query parameters

ParameterTypeDefaultDescription
limitinteger100Records to return (1–100)
offsetinteger0Records to skip

Example request

curl "https://api.plus254.co.ke/v1/datasets/forex_period_average?limit=2"
import requests

url = "https://api.plus254.co.ke/v1/datasets/forex_period_average"
params = {"limit": 2}

response = requests.get(url, params=params)
print(response.json())
fetch("https://api.plus254.co.ke/v1/datasets/forex_period_average?limit=2")
  .then(r => r.json())
  .then(data => console.log(data));
Response
{
  "metadata": {
    "resultset": {
      "count": 7980,
      "offset": 0,
      "limit": 2
    }
  },
  "source": "Central Bank of Kenya",
  "description": "Monthly exchange rates of major currencies against KES (period average)",
  "url": "https://www.centralbank.go.ke/...",
  "results": [
    {
      "year": 1993,
      "month": "january",
      "metric": "united states dollar",
      "value": 36.23
    },
    {
      "year": 1993,
      "month": "january",
      "metric": "sterling pound",
      "value": 54.48
    }
  ]
}
Dataset Info

GET /v1/datasets/{config_name}/info

Retrieve metadata for a specific dataset without loading any data rows. Returns the same shape as an entry from the list endpoint.

Example request

curl "https://api.plus254.co.ke/v1/datasets/forex_period_average/info"
import requests

url = "https://api.plus254.co.ke/v1/datasets/forex_period_average/info"

response = requests.get(url)
print(response.json())
fetch("https://api.plus254.co.ke/v1/datasets/forex_period_average/info")
  .then(r => r.json())
  .then(data => console.log(data));
Response
{
  "config": "forex_period_average",
  "name": "Monthly Exchange Rates (Period Average)",
  "category": "economy",
  "description": "Monthly exchange rates of major currencies against KES (period average)",
  "source": "Central Bank of Kenya",
  "url": "https://www.centralbank.go.ke/..."
}
Dataset Schema

GET /v1/datasets/{config_name}/schema

Retrieve the column schema for a dataset, including data types, null counts, summary statistics, and sample values. Useful for understanding a dataset's structure before querying it.

Example request

curl "https://api.plus254.co.ke/v1/datasets/forex_period_average/schema"
import requests

url = "https://api.plus254.co.ke/v1/datasets/forex_period_average/schema"

response = requests.get(url)
print(response.json())
fetch("https://api.plus254.co.ke/v1/datasets/forex_period_average/schema")
  .then(r => r.json())
  .then(data => console.log(data));
Response (abbreviated)
{
  "config": "forex_period_average",
  "category": "economy",
  "name": "Monthly Exchange Rates (Period Average)",
  "source": "Central Bank of Kenya",
  "row_count": 7980,
  "columns": [
    {
      "name": "year",
      "type": "int64",
      "description": "Calendar year",
      "nullable": false,
      "null_count": 0,
      "sample_values": [1993, 1993, 1993, 1993, 1993],
      "stats": {
        "count": 7980,
        "mean": 2009.7,
        "min": 1993,
        "max": 2026
      }
    },
    {
      "name": "value",
      "type": "float64",
      "description": "Exchange rate in KES per unit of foreign currency",
      "nullable": false,
      "null_count": 0,
      "sample_values": [36.23, 54.48, 22.67, 28.3, 6.69],
      "stats": {
        "count": 7980,
        "mean": 41.65,
        "min": 1.08,
        "max": 203.79
      }
    }
  ]
}

All endpoints return structured error responses on failure. See Error Handling for the full error format, status codes, and what to do.

Next: Response Format