Skip to content

National Park Service

This example shows how to call the National Park Service (NPS) API using the ICDC proxy. With ICDC, you do not need to manage vendor credentials. Instead, you:

  • Replace the vendor hostname with the ICDC proxy hostname
  • Send your ICDC token in the X-Api-Key header

ICDC handles upstream authentication, metering, and logging.


  • An approved ICDC developer account and access to the NPS data source
  • An NPS API token from ICDC
  • The NPS API path you want to call (reference: https://developer.nps.gov/api/v1/...)

See the NPS API Documentation for the full NPS documentation.


  • NPS API URL: https://developer.nps.gov/api/v1
  • ICDC proxy URL: https://nps.api.10xicdc.com/api/v1

Keep the path and query string unchanged. Only the hostname changes.

Example mapping:

  • Vendor: https://developer.nps.gov/api/v1/parks?stateCode=CA&limit=3
  • ICDC: https://nps.api.10xicdc.com/api/v1/parks?stateCode=CA&limit=3

Set these environment variables for the snippets below:

Terminal window
export ICDC_PROXY_HOST="nps.api.10xicdc.com" # Found in the Data Source Developer Portal
export ICDC_TOKEN="<your-icdc-token>" # ICDC-issued NPS API key

Terminal window
curl -s \
-H "X-Api-Key: $ICDC_TOKEN" \
"https://$ICDC_PROXY_HOST/api/v1/parks?stateCode=CA&limit=3"

NPS example:

Terminal window
curl -H 'X-Api-Key: INSERT-API-KEY-HERE' \
'https://developer.nps.gov/api/v1/parks?parkCode=acad'

With ICDC, swap the hostname and use your ICDC-issued NPS API key:

Terminal window
curl -H "X-Api-Key: $ICDC_TOKEN" \
"https://$ICDC_PROXY_HOST/api/v1/parks?parkCode=acad"

const proxyHost = process.env.ICDC_PROXY_HOST;
const token = process.env.ICDC_TOKEN;
async function listParks() {
const url = `https://${proxyHost}/api/v1/parks?stateCode=CA&limit=3`;
const res = await fetch(url, {
headers: { 'X-Api-Key': token }
});
if (!res.ok) {
throw new Error(`Request failed: ${res.status} ${res.statusText}`);
}
const data = await res.json();
console.log(data);
}
listParks().catch((err) => {
console.error(err);
process.exit(1);
});

import os
import requests
proxy_host = os.environ.get("ICDC_PROXY_HOST")
token = os.environ.get("ICDC_TOKEN")
url = f"https://{proxy_host}/api/v1/parks"
params = {"stateCode": "CA", "limit": 3}
headers = {"X-Api-Key": token}
resp = requests.get(url, params=params, headers=headers, timeout=30)
resp.raise_for_status()
print(resp.json())

Use the same pattern for other NPS endpoints. For example, webcams:

Terminal window
curl -s \
-H "X-Api-Key: $ICDC_TOKEN" \
"https://$ICDC_PROXY_HOST/api/v1/webcams?limit=2"

  • Do not use your ICDC token directly with the vendor API; it won’t be valid.
  • Query parameters are passed through unchanged.
  • Your ICDC token scopes and rate limits apply and are enforced by ICDC.
  • Refer to the vendor API docs for endpoint paths and parameters.