# National Parks API
> National parks around the world as an API — 2,400+ national parks from 160+ countries, from Wikidata, each with its country, exact coordinates, the year it was established and its official website. Search and filter parks by name, country and establishment-year range, or find every national park near any coordinate by great-circle distance (great for "national parks near me" and trip planning). From Yellowstone and the Grand Canyon to Kruger, Banff, Torres del Paine and Kakadu, it is ideal for travel, tourism, maps, outdoor, education and nature apps. Open data from Wikidata.

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

## Pricing
- **Free** (Free) — 3,680 calls/Mo, 2 req/s
- **Starter** ($4/Mo) — 49,400 calls/Mo, 8 req/s
- **Pro** ($13/Mo) — 243,000 calls/Mo, 20 req/s
- **Mega** ($34/Mo) — 1,204,000 calls/Mo, 50 req/s

## Endpoints

### National Parks

#### `GET /v1/nearby` — National parks near a coordinate

**Parameters:**
- `lat` (query, optional, string) — Latitude (-90..90) Example: `44.6`
- `lon` (query, optional, string) — Longitude (-180..180) Example: `-110.5`
- `radius_km` (query, optional, string) — Search radius in km (1-5000, default 250)
- `limit` (query, optional, string) — Max results (1-100, default 20)

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

**Response:**
```json
{
    "data": {
        "count": 2,
        "total": 2,
        "center": {
            "lat": 44.6,
            "lon": -110.5
        },
        "results": [
            {
                "name": "Yellowstone National Park",
                "country": "United States",
                "website": "http://nps.gov/yell",
                "latitude": 44.6,
                "longitude": -110.5,
                "distance_km": 0,
                "established_year": 1872
            },
            {
                "name": "Grand Teton National Park",
                "country": "United States",
                "website": "https://nps.gov/grte",
                "latitude": 43.83333,
                "longitude": -110.70083,
                "distance_km": 86.7,
                "established_year": 1929
            }
        ],
        "radius_km": 250
    },
    "meta": {
        "timestamp": "2026-05-31T12:00:38.759Z",
        "request_id": "e0dbbfd2-ebbb-41f1-a6cd-34ce3920a85a"
    },
    "status": "ok",
    "message": "Nearby parks retrieved",
    "success": true
}
```

#### `GET /v1/search` — Search & filter national parks

**Parameters:**
- `q` (query, optional, string) — Search by park name
- `country` (query, optional, string) — Country, e.g. United States, Australia Example: `United States`
- `year_from` (query, optional, string) — Established in or after this year
- `year_to` (query, optional, string) — Established 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/nationalparks-api/v1/search?country=United+States&limit=20&offset=0"
```

**Response:**
```json
{
    "data": {
        "count": 20,
        "limit": 20,
        "total": 59,
        "offset": 0,
        "filters": {
            "q": null,
            "country": "United States",
            "year_to": null,
            "year_from": null
        },
        "results": [
            {
                "name": "Arches National Park",
                "country": "United States",
                "website": "https://nps.gov/arch",
                "latitude": 38.72806,
                "longitude": -109.54,
                "established_year": 1971
            },
            {
                "name": "Badlands National Park",
                "country": "United States",
                "website": "https://nps.gov/badl",
                "latitude": 43.75,
                "longitude": -102.5,
                "established_year": 1939
            },
            {
                "name": "Battery Kemble Park",
                "country": "United States",
                "website": "https://www.nps.gov/places/battery-kemble.htm",
                "latitude": 38.93028,
                "longitude": -77.09556,
                "established_year": null
            },
            {
                "name": "Biscayne National Park",
                "country": "United States",
                "website": "https://nps.gov/bisc",
                "latitude": 25.50185,
                "longitude": -80.18097,
                "established_year": 1980
            },
            {
                "name": "Br
…(truncated, see openapi.json for full schema)
```

### Meta

#### `GET /v1/meta` — Totals & top countries

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

**Response:**
```json
{
    "data": {
        "note": "National parks worldwide. Search by name, country and establishment-year range; /v1/nearby finds national parks near a coordinate by great-circle distance.",
        "total": 2428,
        "fields": [
            "name",
            "country",
            "latitude",
            "longitude",
            "established_year",
            "website"
        ],
        "source": "Wikidata (national parks)",
        "countries": 164,
        "with_year": 2080,
        "top_countries": [
            {
                "count": 670,
                "country": "Australia"
            },
            {
                "count": 114,
                "country": "India"
            },
            {
                "count": 74,
                "country": "Brazil"
            },
            {
                "count": 59,
                "country": "United States"
            },
            {
                "count": 52,
                "country": "Canada"
            },
            {
                "count": 51,
                "country": "Norway"
            },
            {
                "count": 47,
                "country": "Chile"
            },
            {
                "count": 43,
                "country": "Pakistan"
            },
            {
                "count": 40,
                "country": "Venezuela"
            },
            {
                "count": 39,
                "country": "Philippines"
            },
            {
        
…(truncated, see openapi.json for full schema)
```


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