I am trying to build a code that download all files from the provided end points. However, I do not want to download the files everytime and will only download the files if the data in the endpoints is changed/added. I assume that this is provided by the "last_updated" field in the JSON as shown in the API reference JSON snippet - https://open.fda.gov/api/reference/. What is the URL that provides me similar JSON output?
-
Thanks a lot Hans. That helped. Glad to see active participation in the community.– Pratik KulkarniCommented Jun 25, 2016 at 7:09
-
Please don't add "thank you" as an answer. Once you have sufficient reputation, you will be able to vote up questions and answers that you found helpful. - From Review– philshemCommented Jun 25, 2016 at 14:55
2 Answers
The endpoint for downloads is: https://api.fda.gov/download.json
I would log a bug on https://github.com/FDA/open.fda.gov letting them know that the above endpoint should be documented.
Confusing indeed -- the site doesn't appear to provide a query URL to get the provided JSON output, as you noticed.
For now, it seems like your best bet might be paginating through AWS S3 directory listings available at http://download.open.fda.gov/ and looking at each <Content>
's <Key>
and <LastModified>
timestamp.