Developing Country · 22 November 2026

Data API

List the tables, filter them, and download any one as CSV for R or Python. No account or key needed.

Three requests

Every request is a plain GET on https://explore.developing-country.org/api/tables.

Each dataset page on this site also has a Download CSV button and shows the table’s id in its link.

The CSV

The first line holds the column names: short lower-case ids such as geography_name or headline_index, the same ids the metadata lists. There is one row per record, and an empty cell means the value is missing. The file has no comment lines, so read.csv(url) in R and pandas.read_csv(url) in Python read it with no extra arguments.

Filtering

Add filters to the CSV link. An unknown column name returns an error listing the valid ones.

  • ?geography_name=Colombo keeps rows equal to a value; ?geography_name=Colombo,Gampaha keeps any of several.
  • ?year.gte=2020&year.lte=2024 keeps a range, both ends included.
  • ?fields=year,geography_name,population keeps only those columns, in that order.
  • ?order_by=-year sorts; a leading - means newest or largest first.

You can combine up to eight filters. A download returns at most 50,000 rows; the largest table today has fewer than 10,000.

Python

import json
import urllib.request

import pandas as pd

API = "https://explore.developing-country.org/api/tables"

# 1. List every table
tables = pd.DataFrame(json.load(urllib.request.urlopen(API))["tables"])
print(tables[["dataset_id", "title", "publisher"]].head())

# 2. Fetch one whole table
cpi = pd.read_csv(f"{API}/ccpi-monthly.csv")

# 3. Filter rows and pick columns in the URL
pop = pd.read_csv(
    f"{API}/population-estimates-district.csv"
    "?geography_name=Colombo,Gampaha&year.gte=2022&fields=geography_name,year,sex,population"
)

# 4. Licence, sources and a citation for the same table
meta = json.load(urllib.request.urlopen(f"{API}/ccpi-monthly"))
print(meta["reuse"]["label"], meta["reuse"]["terms_url"])
print(meta["citation"])

R

API <- "https://explore.developing-country.org/api/tables"

# 1. List every table (needs the jsonlite package)
tables <- jsonlite::fromJSON(API)$tables
head(tables[, c("dataset_id", "title", "publisher")])

# 2. Fetch one whole table
cpi <- read.csv(paste0(API, "/ccpi-monthly.csv"))

# 3. Filter rows and pick columns in the URL
pop <- read.csv(paste0(
  API, "/population-estimates-district.csv",
  "?geography_name=Colombo,Gampaha&year.gte=2022&fields=geography_name,year,sex,population"
))

# 4. Licence, sources and a citation for the same table
meta <- jsonlite::fromJSON(paste0(API, "/ccpi-monthly"))
meta$reuse$label
meta$citation

Both examples were run as written against a development copy of this API on 22 November 2026.

Licences

Each table carries a reuse record taken from its publisher’s own website, with the page it came from (terms_url) and the date we checked (checked_on). Its status is one of:

  • open_licence: the publisher names an open licence, such as CC BY 4.0.
  • reuse_with_attribution: the publisher allows reproduction with credit, with limits given in statement.
  • all_rights_reserved: the publisher’s site carries a copyright notice and grants no general reuse permission.
  • no_licence_stated: we found no reuse terms at all.

Most Sri Lankan government publishers do not state an open licence. Being able to download a table does not by itself give permission to republish it. Read the statement and the publisher’s page before you redistribute a table; quoting figures with a citation in coursework or research is a different matter from republishing the data.

Citing a dataset

Use the citation field from the table’s metadata. It names the publisher, the table, this site as distributor, the dataset version when there is one, the dataset page and the date you accessed it:

Department of Census and Statistics, Sri Lanka. Colombo Consumer Price Index. Distributed by developing-country.org. https://developing-country.org/data/ccpi-monthly (accessed 2026-11-22).

Also credit the publisher the way its terms ask (reuse.attribution), and cite the original publication listed under sources when you quote a figure.

Maps, aggregation and AI tools

Spatial layers, grouped totals and saved charts are available through the MCP server, which reads the same tables.