Sign in | Sign up

Please Provide Sample Search

Tagged:

Currently contains 1 post

Avatar

January 14, 2020 14:46

bethanybeachbum

I am trying to create a simple python file that searches the nutritionix API.
I have a working AppID and AppKey.
Status code returns 404
Can you please see simple code below and let me know what is wrong?
Thank you,
~ ~ ~ ~ ~ ~ ~ ~ ~

import requests

url = “https://trackapi.nutritionix.com/v2/natural/nutrients”
response = requests.get(url,
headers = {
“Content-Type”:“application/json”,
“x-app-id”:“<my app id>”,
“x-app-key”:“<my app key>”,
“x-remote-user-id”:“<my user name>”,
“query”:“hamburger”
}
)

print(f"Status code: {response.status_code}")

Reply to thread