All API requests require an API key to be included in the request headers:
const axios = require('axios');
const config = {
method: 'GET',
url: 'https://recipe-finder-api-3h6z.onrender.com/api/v1/recipe/name/spaghetti',
headers: {
'Content-Type': 'application/json',
'x-api-key': 'YOUR_API_KEY'
},
params: {
"key": "YOUR_API_KEY"
}
};
axios(config)
.then(response => console.log(JSON.stringify(response.data)))
.catch(error => console.log(error));
Headers: x-api-key : YOUR_API_KEY
Example Request: GET /name/spaghetti
{
"results": [
{
"id": 1,
"title": "Spaghetti Bolognese",
"image": "https://spoonacular.com/recipeImages/1-312x231.jpg"
}
]
}
Headers: x-api-key : YOUR_API_KEY
Example Request: GET /random
{
"recipes": [
{
"id": 2,
"title": "Chicken Curry",
"image": "https://spoonacular.com/recipeImages/2-312x231.jpg"
}
]
}
Headers: x-api-key : YOUR_API_KEY
Example Request: GET /id/638199
{
"id": 1,
"title": "Spaghetti Bolognese",
"image": "https://spoonacular.com/recipeImages/1-312x231.jpg",
"ingredients": [
"spaghetti",
"minced meat",
"tomato sauce"
]
}
Headers: x-api-key : YOUR_API_KEY
Example Request: GET /categories
{
"categories": [
{
"idCategory": "1",
"strCategory": "Beef",
"strCategoryThumb": "https://www.themealdb.com/images/category/beef.png",
"strCategoryDescription": "Beef is the culinary name for meat from cattle."
}
]
}
Headers: x-api-key : YOUR_API_KEY
Example Request: GET /category/Beef
{
"meals": [
{
"idMeal": "1",
"strMeal": "Beef and Mustard Pie",
"strMealThumb": "https://www.themealdb.com/images/media/meals/sytuqu1511553755.jpg"
}
]
}
Headers: x-api-key : YOUR_API_KEY
Example Request: GET /area/Italian
{
"meals": [
{
"idMeal": "1",
"strMeal": "Spaghetti Carbonara",
"strMealThumb": "https://www.themealdb.com/images/media/meals/llcbn01574260722.jpg"
}
]
}
Headers: x-api-key : YOUR_API_KEY
Example Request: GET /ingredient/tomato,cheese
[
{
"id": 1,
"title": "Tomato Cheese Pasta",
"image": "https://spoonacular.com/recipeImages/1-312x231.jpg"
}
]
Headers: x-api-key : YOUR_API_KEY
Example Request: GET /summary/id/638199
{
"id": 1,
"title": "Spaghetti Bolognese",
"summary": "A classic Italian pasta dish made with ground beef and tomato sauce."
}
Headers: x-api-key : YOUR_API_KEY
Example Request: GET /instructions/id/638199
{
"id": 1,
"title": "Spaghetti Bolognese",
"instructions": [
{
"step": 1,
"description": "Boil the spaghetti."
},
{
"step": 2,
"description": "Cook the minced meat."
}
]
}