Question

Given the CKAN package at http://data.gov.au/api/3/action/package_show?id=national-public-toilet-map, it lists all the resources for the dataset.

Is there a way to query to find the most recent resource for that package?

I know I can just parse the results for the above query, but I'd prefer a more concise response if possible.

Was it helpful?

Solution

I think you may have to call package_show and then parse the result, as you've said you can. The most promising candidate that comes to mind for getting your answer directly from the API is resource_search with its order_by and limit params to get just the one most recently updated resource. But as far as I can see, it's not possible to restrict resource_search to only resources belonging to a particular package. That seems like a good use-case though, so I think a github issue or pull-request for this would be welcome.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top