· 3 years ago · Sep 23, 2022, 01:40 PM
1# Get Your API: https://developer.edamam.com/
2import requests
3apiKey = "Your API KEY"
4apiID = "Your API ID"
5url = "https://api.edamam.com/api/nutrition-details?app_id=" + apiID + "&app_key=" + apiKey
6headers = {'Content-Type': "application/json",}
7data = {
8 "title": "Chicken Soup",
9 "ingr": [
10 "1 cup chicken broth",
11 "1 cup water",
12 "1 cup chicken, cooked and chopped",
13 "1/2 cup carrots, sliced",
14 ]
15}
16response = requests.post(url, json=data, headers=headers)
17print(response.text)