I am new to OpenFDA API, and I just got my API key and I want to get a food recalls that falls within range of dates. Could anyone provide me with an example of what would be the URL with range of dates for food recalls?
You might want to try hurl.it for testing your calls: https://www.hurl.it/ it's really useful.
I looked at the API reference: https://open.fda.gov/api/reference/ which has directions, but all of the info there is geared towards drugs, not food.
This URL has food recall info: https://open.fda.gov/food/enforcement/
The examples are pretty good. Does that page help, or did you have a more specific question? Just remove the limit from the first example,
https://api.fda.gov/food/enforcement.json?search=report_date:[20040101+TO+20131231] and that should be your call. You may not need an API key if you are below the limit. Otherwise, you would probably add it in:
-
Here's an example of using Hurl.it's templates to pre-fill in a URL: hurl.it/?url=https://api.fda.gov/food/… You can do that for all sorts of request data: hurl.it/about – John Sheehan Jan 21 '15 at 18:03
Also if you just want to visualize this call this might help - http://www.researchae.com/recalls Code is on Github here - https://github.com/GeekNurse/ResearchAE-Open-Source/blob/master/app.rb#L1609