Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Search Food Endpoint sometimes returns food, sometimes doesn't

Hi,

So Im creating a web app and sends the search food endpoint with a query, which i tested with the string "choc" (I also tried Oatmeal, chocolate, chocolate milk all url encoded). I sometimes get arrays back other times it comes back as a 0...as seen in this

JobeGeorge_0-1580743107847.png

The code I am using is this in JavaScript

JobeGeorge_3-1580743161214.png

Hope someone can help me with this asap.

Thanks,

Jobe

Best Answer
0 Votes
2 REPLIES 2

Hi @JobeGeorge,

 

Sorry to hear that you are encountering inconsistent responses with the Search Food API. 

 

Can you let me know how often you are encountering this issue? Is this something you are noticing throughout the day? I attempted to reproduce on my end and received consistent results from 10 API calls in a row.

 

Additionally, can you PM me your Client ID as well as a screenshot of a successful JSON response versus an unsuccessful JSON response when querying the Search Foods endpoint?

 

Hope to hear from you soon. Please let me know if you have any additional questions.

Best Answer
0 Votes

Hi @JohnFitbit ,

Thanks for the reply I will send what I am getting soon, I am currently getting a status 500 across all the requests to the api at the moment, will that be resolved soon? But yes I get inconsistent response each time I use it i send the request based on the jquery keyup function and map the response into a dropdown list but sometimes i dont get  responses with objects till I type in a good few characters... I can PM you once the api requests work again?

 

 

Best Answer
0 Votes