Along with these frequently asked questions, please be sure to check out the guides and code samples available on this site.
FAQ include:
FAQ include:
- How long should I wait for the API key to be emailed?
- I've tried to make an API call via a web browser; why am I not getting a response?
- How do I get images from the "parks" endpoint on the NPS API since they are not included by default in the API response?
- When using the API to grab events, how can I get the events for the current day?
- Why don't the alerts on the park site on NPS.gov match the alerts in the API?
How long should I wait for the API key to be emailed?
API keys should show up within an hour of being requested. If you have not received an email with your personal API key after an hour, please contact us.
Top
API keys should show up within an hour of being requested. If you have not received an email with your personal API key after an hour, please contact us.
Top
I've tried to make an API call via a web browser; why am I not getting a response?
The documentation outlines the request format needed to make a successful API call. Please remember that your API key must be sent as a request header (Authorization) and not as a query string parameter on the URL. Check out our guide on authentication to learn more about how to pass your API key via a request header in a few different languages. And, look at the other guides and sample code for more examples that return API data.
Top
The documentation outlines the request format needed to make a successful API call. Please remember that your API key must be sent as a request header (Authorization) and not as a query string parameter on the URL. Check out our guide on authentication to learn more about how to pass your API key via a request header in a few different languages. And, look at the other guides and sample code for more examples that return API data.
Top
How do I get images from the "parks" endpoint on the NPS API since they are not included by default in the API response?
In order to include non default properties in the API response, you should use the "fields" query string parameter. Please see the API documentation page for detailed information on the query string parameters.
For example, an API request to the URL below would return the default fields and the images property (fields=images) for all parks located in DC and MD (stateCode=DC,MD).
Top
In order to include non default properties in the API response, you should use the "fields" query string parameter. Please see the API documentation page for detailed information on the query string parameters.
For example, an API request to the URL below would return the default fields and the images property (fields=images) for all parks located in DC and MD (stateCode=DC,MD).
https://developer.nps.gov/api/v0/parks?stateCode=DC,MD,VA&fields=images
Top
When using the API to grab events, how can I get the events for the current day?
An API call for events will return events that are by default sorted by date starting with the current date. This allows you to then loop through the results and search for any event that has the current day (or any other day you wish) in the “dates” property for the event. The current format for a date in the “dates” property is YYYY-MM-DD.
If there is a discrepancy in the number of events returned via the API and the number of events on a calendar page on NPS.gov, this could be because the API data load job runs every 2 hours. So, there may be a 2-hour period where content on NPS.gov does match the data returned by the API.
Top
An API call for events will return events that are by default sorted by date starting with the current date. This allows you to then loop through the results and search for any event that has the current day (or any other day you wish) in the “dates” property for the event. The current format for a date in the “dates” property is YYYY-MM-DD.
If there is a discrepancy in the number of events returned via the API and the number of events on a calendar page on NPS.gov, this could be because the API data load job runs every 2 hours. So, there may be a 2-hour period where content on NPS.gov does match the data returned by the API.
Top
Why don't the alerts on the park site on NPS.gov match the alerts in the API?
The schedule for the API data load job runs every 2 hours, so there may be a 2-hour period where content on NPS.gov does match the data returned by the API. We are investigating ways to decouple the alert refresh rate to reduce that interval. Please see the API Road Map page for more information.
Top
The schedule for the API data load job runs every 2 hours, so there may be a 2-hour period where content on NPS.gov does match the data returned by the API. We are investigating ways to decouple the alert refresh rate to reduce that interval. Please see the API Road Map page for more information.
Top
Last updated: August 31, 2017