Last answered:

02 May 2024

Posted on:

19 Nov 2021

0

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.

6 answers ( 0 marked as helpful)
Posted on:

22 Nov 2021

0

I'm also facing the same issue

Posted on:

15 Feb 2022

1

and me too facing the same error for this and most of the rest videos. plz,365 data science team   review and update code

Posted on:

17 Apr 2022

2

This is really getting ridiculous. Having a course like this means updating it regularly. Otherwise don't do it.

Posted on:

18 May 2023

1

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.

Super learner
This user is a Super Learner. To become a Super Learner, you need to reach Level 8.
Posted on:

02 May 2024

0

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))

Submit an answer