Getting error 401 for edamam API
While requesting using POST for the edamam API, I get error code 401. Also, I see that the documentation has been changed a bit. The body parameter is required.
I'm also facing the same issue
and me too facing the same error for this and most of the rest videos. plz,365 data science team review and update code
This is really getting ridiculous. Having a course like this means updating it regularly. Otherwise don't do it.
This is the only method that worked for me after hours of search
from requests.auth import HTTPBasicAuth
r = requests.post(url, headers = headers, auth=HTTPBasicAuth(APP_ID, APP_KEY),
json = recipe)
if you can please update the course URLs and codes because its very hard to continue with the course like this.
I think this course missed certain details...
To fix it,
1. From your dashboard, check the tab "applications".
2. Create a new application
3. Pick Nutrition Analysis API
4. Fill the form and click create application
5. Go back to your code replace the APP_ID and APP_KEY from this newly created app.
Try this:
url = 'https://api.edamam.com/api/nutrition-details'
headers = {
'Content-Type': 'application/json'
}
recipe = {
'title': 'cappucino',
'ingr': ['18 gr ground espresso', '150ml milk']
}
r = requests.post(url, headers=headers, json=recipe, params={'app_id': APP_ID, 'app_key': APP_KEY})
capp_info = r.json()
print(json.dumps(capp_info, indent=4))