nationalparkservice / nps-api-samples

Sample Code using calls to the NPS API
32 stars 9 forks source link

Parameter using multiple park codes #1

Closed spenpeq-cav closed 2 years ago

spenpeq-cav commented 2 years ago

Hello, I am having trouble getting data using multiple park codes and not sure if it a mistake on my end or not.

The docs say to use "A comma delimited list of park codes (each 4-10 characters in length)."

Ignoring base url, api key, the parameter in my request I have tried

parkCode=zion,romo,bibe,deva

Returns no results.

There isn't a clear example using the parameter with multiple park codes. Any help would be appreciated!

tmedgar commented 2 years ago

Greetings, Spencer.

You are doing everything right. There was a system change on our end and we did not recognize that it had impacted queries for data from multiple parks. We've adjusted how those queries are processed on our end and the request you made (parkCode=zion,romo,bibe,deva) should now work as you expected.

You should also be able to make a request filtering for one or more state code (e.g., stateCode=me,ak) but that is not working quite yet. I'll reply here once we get that working, too.

Thanks for letting us know about the issue.

spenpeq-cav commented 2 years ago

Awesome Todd, thanks for the quick response and fix. I've enjoyed using the API for a side project and this was the only issue I have had.

tmedgar commented 2 years ago

Howdy, Spencer. That is great that the API is working well for you. I just wanted to report that, for the endpoints that support filtering by state, requests for multiple states (e.g., stateCode=ak,me) is now working. And, as you know, support for multiple parks (e.g., parkCode=acad,dena) is working, too.

Thank you again for letting us know there was an issue! Have a great weekend.