National Park Service, US API

⭐ Beginner's Pick Government / API Key Intermediate HTTPS CORS
Varies by plan (check documentation)

Overview

The National Park Service API provides data about US national parks, including park descriptions, alerts, visitor centers, campgrounds, and events. You need a free API key from the NPS developer site, which is quick to obtain. It is one of the most beginner-friendly government APIs with excellent documentation and consistent JSON responses.

💡

Beginner Tip

Get your free API key instantly at www.nps.gov/subjects/developer/get-started.htm with just an email address. Use the parkCode parameter to filter results for a specific park, such as parkCode=yose for Yosemite or parkCode=grca for the Grand Canyon.

Available Data

country name and code
population
capital city
region and subregion
flag image URL

Example Response

JSON Response
{
  "name": "Japan",
  "capital": "Tokyo",
  "population": 125800000,
  "region": "Asia",
  "languages": [
    "Japanese"
  ],
  "flag": "https://flagcdn.com/jp.svg",
  "currencies": [
    {
      "code": "JPY",
      "name": "Japanese yen"
    }
  ]
}

Field Reference

data Array of park or resource objects matching the query
fullName Official full name of the national park or site
parkCode Short unique code for the park, used to filter other API endpoints
description Detailed narrative description of the park, its history, and attractions
states Comma-separated list of US state abbreviations where the park is located
entranceFees Array of fee objects with cost, description, and fee type for park entry

Implementation Example

const url = "https://www.nps.gov/subjects/developer/";
// Replace headers or query params with the values required by this API.
const response = await fetch(url, {
  headers: {
  "X-API-Key": "YOUR_API_KEY"
  }
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data);

What Can You Build?

Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.

Common Errors & Troubleshooting

400 Bad Request: missing api_key The api_key query parameter is required for every request
Always append &api_key=YOUR_API_KEY to every request URL
Empty data array The parkCode value does not match any park in the system
Use the /parks endpoint without a filter to browse all park codes, or check the full list at nps.gov
429 Too Many Requests Exceeding the rate limit of 1,000 requests per hour
Cache responses locally since park data rarely changes, and add delays between bulk requests

Matrix Score Breakdown

🌐 Reachability 30/30
⚡ Speed 15/20
🔒 Security 15/15
🛠 Developer XP 17/20
✓ Reliability 10/15

Partially tested on Apr 5, 2026

Technical Specifications

Auth API Key
HTTPS REQUIRED
CORS YES
Category Government
Difficulty Intermediate
Verified: 2026-04-07

Similar APIs

View All →