Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get the food record for an item returned by autocomplete #1

Open
xanderdunn opened this issue Jul 26, 2015 · 0 comments
Open

Comments

@xanderdunn
Copy link

My code:

# import inside your project
from nutritionix.nutritionix import NutritionixClient

nutritionix = NutritionixClient(
    application_id='',
    api_key='',
    debug=True
)
print(nutritionix.autocomplete(q='greek y'))
print(nutritionix.item(id=130))

The autocomplete line will return a list where one of the items is:

{"id":130,"text":"greek yogurt"}

I would expect to be able to get the full food record for that item using nutritionix.item on the 130 id. However, I get:

{u'status': 404, u'errors': [{u'status': 404, u'message': u'the resource you requested could not be located.', u'code': u'resource_not_found'}]}

How am I supposed to get food records for items returned by the autocompleter?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants