# UN SDG API
> The United Nations Sustainable Development Goals as an API, powered by the official UN Statistics Division SDG API. The SDGs are the world's shared plan — 17 goals, 169 targets and 200+ indicators — to end poverty and hunger, ensure good health and quality education, achieve gender equality, provide clean water and affordable energy, drive decent work and economic growth, build sustainable cities, take climate action and protect life on land and below water, all by 2030. Browse the 17 goals with their full titles and descriptions; open any goal to see every target and the indicators that measure it; list the statistical data series behind an indicator (with their machine codes and descriptions); pull a series' complete time-series for any country — each data point with its year, value, unit, breakdown dimensions (sex, age, location, …) and source; and look up countries, regions and the world with their UN M49 numeric area codes. Ideal for development research, NGO and policy dashboards, journalism, ESG and sustainability reporting, and education. Indicator codes come from the goal endpoint, series codes from the series endpoint, and area codes from the areas endpoint (276 = Germany, 826 = United Kingdom, 1 = World). Data from the UN Statistics Division Global SDG Indicators Database.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/sdg-api/..."
```

## Pricing
- **Free** (Free) — 580 calls/Mo, 2 req/s
- **Starter** ($6/Mo) — 21,000 calls/Mo, 6 req/s
- **Pro** ($19/Mo) — 88,000 calls/Mo, 15 req/s
- **Mega** ($54/Mo) — 365,000 calls/Mo, 40 req/s

## Endpoints

### SDG

#### `GET /v1/areas` — UN M49 areas & codes

**Parameters:**
- `q` (query, optional, string) — Filter by name, e.g. germany

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/sdg-api/v1/areas"
```

**Response:**
```json
{
    "data": {
        "areas": [
            {
                "code": "4",
                "name": "Afghanistan"
            },
            {
                "code": "248",
                "name": "Åland Islands"
            },
            {
                "code": "8",
                "name": "Albania"
            },
            {
                "code": "12",
                "name": "Algeria"
            },
            {
                "code": "16",
                "name": "American Samoa"
            },
            {
                "code": "20",
                "name": "Andorra"
            },
            {
                "code": "24",
                "name": "Angola"
            },
            {
                "code": "660",
                "name": "Anguilla"
            },
            {
                "code": "10",
                "name": "Antarctica"
            },
            {
                "code": "28",
                "name": "Antigua and Barbuda"
            },
            {
                "code": "32",
                "name": "Argentina"
            },
            {
                "code": "51",
                "name": "Armenia"
            },
            {
                "code": "533",
                "name": "Aruba"
            },
            {
                "code": "36",
                "name": "Australia"
            },
            {
                "code": "40",
                "name": "Austria"
            },
            {
                "cod
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/data` — A series time-series for a country

**Parameters:**
- `series` (query, required, string) — Series code, e.g. SH_STA_MORT Example: `SH_STA_MORT`
- `area` (query, required, string) — UN M49 area code, e.g. 276 Example: `276`
- `limit` (query, optional, string) — Max points (1-500)

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/sdg-api/v1/data?series=SH_STA_MORT&area=276"
```

**Response:**
```json
{
    "data": {
        "area": "276",
        "data": [
            {
                "area": "Germany",
                "unit": "PER_100000_LIVE_BIRTHS",
                "year": 2023,
                "value": "3.62022",
                "source": "MMEIG estimates available at https://www.who.int/publications/i/item/9789240108462",
                "area_code": "276",
                "dimensions": {
                    "Sex": "FEMALE",
                    "Reporting Type": "G"
                },
                "value_type": "Float"
            },
            {
                "area": "Germany",
                "unit": "PER_100000_LIVE_BIRTHS",
                "year": 2022,
                "value": "4.03073",
                "source": "MMEIG estimates available at https://www.who.int/publications/i/item/9789240108462",
                "area_code": "276",
                "dimensions": {
                    "Sex": "FEMALE",
                    "Reporting Type": "G"
                },
                "value_type": "Float"
            },
            {
                "area": "Germany",
                "unit": "PER_100000_LIVE_BIRTHS",
                "year": 2021,
                "value": "4.45641",
                "source": "MMEIG estimates available at https://www.who.int/publications/i/item/9789240108462",
                "area_code": "276",
                "dimensions": {
                    "Sex": "FEMALE",
                    "Reporting Type": "G"
                },
        
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/goal` — A goal with targets & indicators

**Parameters:**
- `id` (query, required, string) — Goal number 1-17 Example: `3`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/sdg-api/v1/goal?id=3"
```

**Response:**
```json
{
    "data": {
        "goal": {
            "code": "3",
            "title": "Ensure healthy lives and promote well-being for all at all ages",
            "targets": [
                {
                    "code": "3.1",
                    "title": "By 2030, reduce the global maternal mortality ratio to less than 70 per 100,000 live births",
                    "indicators": [
                        {
                            "code": "3.1.1",
                            "tier": "1",
                            "description": "Maternal mortality ratio"
                        },
                        {
                            "code": "3.1.2",
                            "tier": "1",
                            "description": "Proportion of births attended by skilled health personnel"
                        }
                    ]
                },
                {
                    "code": "3.2",
                    "title": "By 2030, end preventable deaths of newborns and children under 5 years of age, with all countries aiming to reduce neonatal mortality to at least as low as 12 per 1,000 live births and under-5 mortality to at least as low as 25 per 1,000 live births",
                    "indicators": [
                        {
                            "code": "3.2.1",
                            "tier": "1",
                            "description": "Under‑5 mortality rate"
                        },
                        {
                  
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/goals` — The 17 SDG goals

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/sdg-api/v1/goals"
```

**Response:**
```json
{
    "data": {
        "count": 17,
        "goals": [
            {
                "uri": "/v1/sdg/Goal/1",
                "code": "1",
                "title": "End poverty in all its forms everywhere",
                "description": "Goal 1 calls for an end to poverty in all its manifestations, including extreme poverty, over the next 15 years. All people everywhere, including the poorest and most vulnerable, should enjoy a basic standard of living and social protection benefits."
            },
            {
                "uri": "/v1/sdg/Goal/2",
                "code": "2",
                "title": "End hunger, achieve food security and improved nutrition and promote sustainable agriculture",
                "description": "Goal 2 seeks to end hunger and all forms of malnutrition and to achieve sustainable food production by 2030. It is premised on the idea that everyone should have access to sufficient nutritious food, which will require widespread promotion of sustainable agriculture, a doubling of agricultural productivity, increased investments and properly functioning food markets."
            },
            {
                "uri": "/v1/sdg/Goal/3",
                "code": "3",
                "title": "Ensure healthy lives and promote well-being for all at all ages",
                "description": "Goal 3 aims to ensure health and well-being for all at all ages by improving reproductive, maternal and child health; ending the epidemics of major communicable d
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/series` — Data series behind an indicator

**Parameters:**
- `indicator` (query, required, string) — Indicator code, e.g. 3.1.1 Example: `3.1.1`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/sdg-api/v1/series?indicator=3.1.1"
```

**Response:**
```json
{
    "data": {
        "count": 1,
        "series": [
            {
                "code": "SH_STA_MORT",
                "release": "2026.Q1.G.01",
                "description": "Maternal mortality ratio"
            }
        ],
        "indicator": "3.1.1",
        "description": "Maternal mortality ratio"
    },
    "meta": {
        "timestamp": "2026-06-01T08:13:09.661Z",
        "request_id": "727a7f61-c1cc-43e1-925d-fe9f47217cbd"
    },
    "status": "ok",
    "message": "Series retrieved",
    "success": true
}
```

### Meta

#### `GET /v1/meta` — Usage notes

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/sdg-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "note": "The UN Sustainable Development Goals — the global framework of 17 goals, 169 targets and 200+ indicators for ending poverty, protecting the planet and ensuring prosperity by 2030. /v1/goals = the 17 goals with title and description; /v1/goal?id=3 = a goal with all of its targets and the indicators under each target; /v1/series?indicator=3.1.1 = the statistical data series that measure an indicator, with each series' code and description (e.g. SH_STA_MORT = maternal mortality ratio); /v1/data?series=SH_STA_MORT&area=276 = a series' full time-series for a country, each point with year, value, unit, breakdown dimensions (sex, age, location…) and source; /v1/areas?q=germany = UN M49 areas (countries, regions and the world) with their numeric area codes — use the code as the area parameter for /v1/data (e.g. 276 = Germany, 826 = United Kingdom, 1 = World). Indicator codes come from /v1/goal, series codes from /v1/series and area codes from /v1/areas. Data from the UN Statistics Division Global SDG Indicators Database. For WHO health statistics see the WHO API, for World Bank development indicators the World Bank API.",
        "source": "United Nations SDG API — UN Statistics Division (unstats.un.org)",
        "endpoints": [
            "/v1/goals",
            "/v1/goal",
            "/v1/series",
            "/v1/data",
            "/v1/areas",
            "/v1/meta"
        ]
    },
    "meta": {
        "timestamp": "2026-06-01T08:13:0
…(truncated, see openapi.json for full schema)
```


---
Marketplace page: https://www.oanor.com/api/sdg-api
OpenAPI spec: https://www.oanor.com/api/sdg-api/openapi.json
