Caching terms for FatSecretAPI

59 views
Skip to first unread message

Guodong Zhao

unread,
Nov 7, 2023, 3:56:01 AM11/7/23
to FatSecret Platform API
I'm building a nutrition tracking app in which the users can look up foods and save calorie/macro data to their food logs.

I have an existing food database but I'd like to use the FatSecret API when the user looks up food with a barcode for their calorie/macro that is not in my own database.

How do the caching terms apply to this use case? For example, if a user looks up food via FatSecretAPI and saves it to their food log. Do I have to re-request the FatSecretAPI to display the calorie/macro info of the food when the user checks their food log?

seba...@fatsecret.com

unread,
Nov 7, 2023, 4:04:07 AM11/7/23
to FatSecret Platform API
Hi Guodong,

Thanks for reaching out.

We always recommend querying the API (i.e. the food_id) when your team or a user accesses a historic food log (i.e. food_id) given the nutritional information might have changed but also to ensure you are looking at the correct item/barcode. That said, we permit for the information to be stored on a user's device so you can do it that way, too.

Kind regards,
The FatSecret Platform API Team
Reply all
Reply to author
Forward
0 new messages