Recipe API

The Recipe API provides access to hundreds of thousands of creative recipes from all cuisines.

/v1/recipe GET

https://api.api-ninjas.com/v1/recipe

Get a list of recipes for a given search query. Returns at most 10 results. To access more than the first 10 results, use the offset parameter to offset results in multiple API calls.


Parameters

  • query  required

    Query text to search.

  • offset  optional

    Number of results to offset for pagination.

Headers

  • X-Api-Key  required

    API Key associated with your account.

Sample Request Live Demo!

query
https://api.api-ninjas.com/v1/recipe?query=italian wedding soup

Headers

X-Api-KeyLog in or sign up to get your API Key

Sample Response

JSON
1 2 3 4 5 6 7 8 [ { "title": "Stracciatella (Italian Wedding Soup)", "ingredients": "3 1/2 c Chicken broth; homemade|1 lb Fresh spinach; wash/trim/chop|1 Egg|1 c Grated parmesan cheese; --or--|1 c Romano cheese; freshly grated|Salt and pepper; to taste", "servings": "4 servings", "instructions": "Bring 1 cup of the broth to a boil. Add spinach and cook until softened but still bright green. Remove spinach with a slotted spoon and set aside. Add remaining broth to pot. Bring to a boil. Meanwhile, beat egg lightly with a fork. Beat in 1/4 cup of cheese. When broth boils pour in egg mixture, stirring constantly for a few seconds until it cooks into "rags." Add reserved spinach, salt and pepper. Serve immediately, passing remaining cheese. NOTES: Someone asked for this recipe a while back. I believe this soup, known as "Stracciatella" is synonymous with Italian Wedding Soup, however, I seem to remember from I-don't-know-where that Italian Wedding Soup is the same as this but with the addition of tiny meatballs." } ]

Code Examples

1 2 3 4 5 6 7 8 9 import requests query = 'italian wedding soup' api_url = 'https://api.api-ninjas.com/v1/recipe?query={}'.format(query) response = requests.get(api_url, headers={'X-Api-Key': 'YOUR_API_KEY'}) if response.status_code == requests.codes.ok: print(response.text) else: print("Error:", response.status_code, response.text)

If your programming language is not listed in the Code Example above, you can still make API calls by using a HTTP request library written in your programming language and following the above documentation.