headers:
- x-app-id
- x-app-key
- Content-Type: application/json
POST request body:
{
"query":"ran 3 miles",
"gender":"female",
"weight_kg":72.5,
"height_cm":167.64,
"age":30
}
See comment below for sample API response.
Original documentation: https://docs.google.com/document/d/1_q-K-ObMTZvO0qUEAxROrN3bwMujwAN25sLHwJzliK0/edit#
Please can anyone help me out i l keep getting a 401 client error- attached below is my code;
"""
import requests
GENDER = "MALE"
WEIGHT_KG = "60"
HEIGHT = "7.5"
AGE = "50"
APP_ID = MY_ID
API_KEY = MY_KEY
exercise_endpoint = "https://trackapi.nutritionix.com/v2/natural/exercise"
exercise_input = input("Tell which exercise you did today?: ")
header = {
"x-app-id": "",
"x-remote-user-id": "",
}
parameters = {
"gender": GENDER,
"weight_kg": WEIGHT_KG,
"height": HEIGHT,
"age": AGE,
}
response = requests.post(url=exercise_endpoint, json=parameters, headers=header)
response.raise_for_status()
result = response.json()
print(result)"""
please I will really appreciate the advice