# World Heritage API
> Every UNESCO World Heritage Site as an API — all 1,236 inscribed sites worldwide (cultural, natural and mixed) from the official UNESCO World Heritage List. Look up any site by its WHC id (e.g. Galápagos Islands, Machu Picchu, Historic Centre of Rome) with its country, exact coordinates, the year it was inscribed and the UNESCO selection criteria. Search and filter by name, country, category (cultural / natural / mixed) and inscription year, or find every World Heritage Site near any coordinate by great-circle distance. Ideal for travel, tourism, maps, education and cultural-discovery apps.

## 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/heritage-api/..."
```

## Pricing
- **Free** (Free) — 4,000 calls/Mo, 2 req/s
- **Starter** ($5/Mo) — 48,000 calls/Mo, 8 req/s
- **Pro** ($13/Mo) — 240,000 calls/Mo, 20 req/s
- **Mega** ($34/Mo) — 1,200,000 calls/Mo, 50 req/s

## Endpoints

### World Heritage

#### `GET /v1/nearby` — Sites near a coordinate (great-circle)

**Parameters:**
- `lat` (query, optional, string) — Latitude (-90..90) Example: `41.9`
- `lon` (query, optional, string) — Longitude (-180..180) Example: `12.5`
- `radius_km` (query, optional, string) — Search radius in km (1-20000, default 500)
- `category` (query, optional, string) — Optional category filter
- `limit` (query, optional, string) — Max results (1-100, default 20)

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/heritage-api/v1/nearby?lat=41.9&lon=12.5"
```

**Response:**
```json
{
    "data": {
        "count": 20,
        "total": 62,
        "center": {
            "lat": 41.9,
            "lon": 12.5
        },
        "results": [
            {
                "name": "Historic Centre of Rome, the Properties of the Holy See in that City Enjoying Extraterritorial Rights and San Paolo Fuori le Mura",
                "whc_id": 91,
                "country": "Vatican City",
                "category": "cultural",
                "criteria": [
                    "i",
                    "ii",
                    "iii",
                    "iv",
                    "vi"
                ],
                "latitude": 41.8928,
                "longitude": 12.4866,
                "distance_km": 1,
                "year_inscribed": 1980
            },
            {
                "name": "Vatican City",
                "whc_id": 286,
                "country": "Vatican City",
                "category": "cultural",
                "criteria": [
                    "i",
                    "ii",
                    "iv",
                    "vi"
                ],
                "latitude": 41.904,
                "longitude": 12.453,
                "distance_km": 4,
                "year_inscribed": 1984
            },
            {
                "name": "Appian Way",
                "whc_id": 1708,
                "country": "Italy",
                "category": "cultural",
                "criteria": [
                    "i",
                    "
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/search` — Search & filter sites

**Parameters:**
- `q` (query, optional, string) — Search term matched against the site name Example: `castle`
- `country` (query, optional, string) — Restrict to a country, e.g. Italy
- `category` (query, optional, string) — cultural | natural | mixed
- `year_from` (query, optional, string) — Inscribed in or after this year
- `year_to` (query, optional, string) — Inscribed in or before this year
- `limit` (query, optional, string) — Results per page (1-100, default 20) Example: `20`
- `offset` (query, optional, string) — Pagination offset Example: `0`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/heritage-api/v1/search?q=castle&limit=20&offset=0"
```

**Response:**
```json
{
    "data": {
        "count": 12,
        "limit": 20,
        "query": "castle",
        "total": 12,
        "offset": 0,
        "filters": {
            "country": null,
            "year_to": null,
            "category": null,
            "year_from": null
        },
        "results": [
            {
                "name": "Castles and Town Walls of King Edward in Gwynedd",
                "whc_id": 374,
                "country": "United Kingdom",
                "category": "cultural",
                "criteria": [
                    "i",
                    "iii",
                    "iv"
                ],
                "latitude": 53.139722,
                "longitude": -4.276944,
                "year_inscribed": 1986
            },
            {
                "name": "Forts and Castles, Volta, Greater Accra, Central and Western Regions",
                "whc_id": 34,
                "country": "Ghana",
                "category": "cultural",
                "criteria": [
                    "vi"
                ],
                "latitude": 5.103694,
                "longitude": -1.241,
                "year_inscribed": 1979
            },
            {
                "name": "Durham Castle and Cathedral",
                "whc_id": 370,
                "country": "United Kingdom",
                "category": "cultural",
                "criteria": [
                    "ii",
                    "iv",
                    "vi"
                ],
       
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/site` — One World Heritage Site by WHC id

**Parameters:**
- `id` (query, required, string) — WHC site id, e.g. 1 (Galápagos Islands) Example: `1`

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

**Response:**
```json
{
    "data": {
        "site": {
            "name": "Galápagos Islands",
            "whc_id": 1,
            "country": "Ecuador",
            "category": "natural",
            "criteria": [
                "ix",
                "vii",
                "viii",
                "x"
            ],
            "latitude": -0.622977,
            "longitude": -90.361243,
            "year_inscribed": 1978
        }
    },
    "meta": {
        "timestamp": "2026-05-31T07:26:14.782Z",
        "request_id": "3f2b9945-16da-427e-9d06-9d14116d9e68"
    },
    "status": "ok",
    "message": "Site retrieved",
    "success": true
}
```

### Meta

#### `GET /v1/meta` — Totals & breakdown

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

**Response:**
```json
{
    "data": {
        "note": "1,236 inscribed UNESCO World Heritage Sites. category: cultural | natural | mixed. criteria: UNESCO selection criteria i-vi (cultural) / vii-x (natural).",
        "total": 1236,
        "fields": [
            "whc_id",
            "name",
            "country",
            "latitude",
            "longitude",
            "year_inscribed",
            "category",
            "criteria"
        ],
        "source": "UNESCO World Heritage List (via Wikidata)",
        "countries": 174,
        "by_category": {
            "mixed": 41,
            "natural": 236,
            "cultural": 957
        },
        "top_countries": [
            {
                "count": 57,
                "country": "People's Republic of China"
            },
            {
                "count": 54,
                "country": "Italy"
            },
            {
                "count": 51,
                "country": "France"
            },
            {
                "count": 49,
                "country": "Germany"
            },
            {
                "count": 46,
                "country": "Spain"
            },
            {
                "count": 43,
                "country": "India"
            },
            {
                "count": 35,
                "country": "Mexico"
            },
            {
                "count": 33,
                "country": "United Kingdom"
            },
            {
                "count": 29,
            
…(truncated, see openapi.json for full schema)
```


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