Sign in | Sign up

Only getting 10 items at a time

Tagged:

Currently contains 2 posts

Avatar

November 01, 2017 22:21

tejasmhosangadi

I am trying to get a list of all the fast food items on the database, but every time I run the code below, it only downloads 10 items at a time:

import json
import requests
data = {
“appId”:“appid”,
“appKey”:“key”,
“fields”:[“item_name”,“brand_name”,“nf_calories”,“nf_total_fat”],
“filters”:{
item_type
}
}
r = requests.post(‘https://api.nutritionix.com/v1_1/search’, json=data)
r.json()

I am using the filter item type=1, so it should get all restaurant items right?

Avatar

November 07, 2017 21:24

rmb2323

The developers token only allows 10 items to be returned at a time if I’m not mistaken

Reply to thread