Skip to content

Instantly share code, notes, and snippets.

@extrasleepy
Created May 8, 2023 23:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save extrasleepy/53237bf43025efa5ee2623263e71ca7f to your computer and use it in GitHub Desktop.
Save extrasleepy/53237bf43025efa5ee2623263e71ca7f to your computer and use it in GitHub Desktop.
import json
import requests
from requests import get
app_id = 'your id'
app_key = 'your app key'
url = 'https://api.edamam.com/api/recipes/v2?type=public&q=chicken&app_id='+app_id+'&app_key='+app_key+'&cuisineType=American'
one_food = get(url).json()
print (one_food['hits'][0]['recipe']['label'])
print ('\n')
print (one_food['hits'][0]['recipe']['ingredientLines'])
print ('\n')
another_food = get(url).json()
print (another_food['hits'][1]['recipe']['label'])
print ('\n')
print (another_food['hits'][1]['recipe']['ingredientLines'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment