USDA / USDA-APIs

Do you have feedback, ideas, or questions for USDA APIs? Use this repository's Issue Tracker to join the discussion.
www.usda.gov/developer
107 stars 16 forks source link

How do I get more than 1 page of 50 food items per search? #84

Closed SteveCEms closed 4 years ago

SteveCEms commented 4 years ago

I'm doing 3 api gets to find up to 150 food items for each request. How can I get more than 50 food items per search? Is there a way to set pageNumber=1-3 or something similar to get up to 3 pages of results.

littlebunch commented 4 years ago

@SteveCEms Yeah, I think my proposed spec adds a "limit" parameter which would allow you to request 1 to MAX_DOC_SIZE. Hopefully that gets into the next release. Certainly 150 documents is a reasonable MAX_DOC_SIZE. I'd probably like a higher number, i.e. 1,500.

SteveCEms commented 4 years ago

I limited to 150 in the old api and told the user to add more search terms to his search. It takes a long time to scroll through even 150 lines that may have folded on a small phone screen. Adding a limit parameter would mean I wouldn't have to search 3 times for most searches to get at least 150 food items.

SteveCEms commented 4 years ago

@littlebunch When is the next release?

SteveCEms commented 4 years ago

The new api has a pageSize value that allows me to do 1 search and get a page size of 150 food items. I consider this issue closed. Thanks @littlebunch .