Skip to content
Field Guide

undata · the Python package

UN data in Python, without the guessing.

Type a country's name and get a table with its source on every row. It is made for colleagues who need numbers for a report, with no API to learn first.

pip install undata

Unofficial · MIT licence · Python 3.11+ · cite it with its DOI

import undata as un

table = un.latest("3.1.1", ["Bangladesh", "Viet Nam"])
un.save(table, "maternal-mortality.xlsx")
countryyearvaluesource
Bangladesh2023115SDG Global Database
Viet Nam202347.6SDG Global Database
Real output, rounded: maternal mortality ratio (SDG 3.1.1), count per 100,000 live births, retrieved 26 October 2026 from the UN System Data Commons.

Two courses

All 11 undata videos

The functions you'll use most

Full API reference ↗

Countries go in the way you'd write them in an email ("Viet Nam", "Vietnam", "VNM"), or as a region or UN group: "Southern Asia", "LDCs", "SIDS". An SDG number such as "3.1.1" works wherever one series reports it.

Use it from an AI assistant

undata is also a connector for AI assistants (an MCP server): an assistant such as Claude can search UN indicators, fetch data and run the analyses itself, with the sources, years and gaps in every answer. It needs uv.

Claude Code

claude mcp add undata -- uvx --from "undata[mcp]" undata-mcp

Claude Desktop: Settings › Developer › Edit Config

{
  "mcpServers": {
    "undata": { "command": "uvx", "args": ["--from", "undata[mcp]", "undata-mcp"] }
  }
}
Watch: Ask an AI assistant, with sources

12 requests from UN work

See each with its output ↗

Each is a short script that ends with a sentence ready for the report. Every one runs in Google Colab, and runs against the live platform every night.

More about undata

undata is created and maintained by Mafizul Islam. It is unofficial: not affiliated with or endorsed by the United Nations. The data belongs to the agencies that publish it.

↑ ↓ to move · Enter to open · A match inside a video opens the lesson at the moment the words are said.