Recipe API Documentation

Getting Started
Base URL:
BASE_URL
https://recipe-finder-api-3h6z.onrender.com/api/v1/recipe

Authentication

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));
1. Get Recipe by Name
GET /name/:name

Headers: x-api-key : YOUR_API_KEY

Example Request: GET /name/spaghetti

Sample Response:
{
  "results": [
    {
      "id": 1,
      "title": "Spaghetti Bolognese",
      "image": "https://spoonacular.com/recipeImages/1-312x231.jpg"
    }
  ]
}
2. Get Random Recipe
GET /random

Headers: x-api-key : YOUR_API_KEY

Example Request: GET /random

Sample Response:
{
  "recipes": [
    {
      "id": 2,
      "title": "Chicken Curry",
      "image": "https://spoonacular.com/recipeImages/2-312x231.jpg"
    }
  ]
}
3. Get Recipe by ID
GET /id/:id

Headers: x-api-key : YOUR_API_KEY

Example Request: GET /id/638199

Sample Response:
{
  "id": 1,
  "title": "Spaghetti Bolognese",
  "image": "https://spoonacular.com/recipeImages/1-312x231.jpg",
  "ingredients": [
    "spaghetti",
    "minced meat",
    "tomato sauce"
  ]
}
4. Get Recipe Categories
GET /categories

Headers: x-api-key : YOUR_API_KEY

Example Request: GET /categories

Sample Response:
{
  "categories": [
    {
      "idCategory": "1",
      "strCategory": "Beef",
      "strCategoryThumb": "https://www.themealdb.com/images/category/beef.png",
      "strCategoryDescription": "Beef is the culinary name for meat from cattle."
    }
  ]
}
5. Get Recipe by Category
GET /category/:category

Headers: x-api-key : YOUR_API_KEY

Example Request: GET /category/Beef

Sample Response:
{
  "meals": [
    {
      "idMeal": "1",
      "strMeal": "Beef and Mustard Pie",
      "strMealThumb": "https://www.themealdb.com/images/media/meals/sytuqu1511553755.jpg"
    }
  ]
}
6. Get Recipe by Area
GET /area/:area

Headers: x-api-key : YOUR_API_KEY

Example Request: GET /area/Italian

Sample Response:
{
  "meals": [
    {
      "idMeal": "1",
      "strMeal": "Spaghetti Carbonara",
      "strMealThumb": "https://www.themealdb.com/images/media/meals/llcbn01574260722.jpg"
    }
  ]
}
7. Get Recipe by Ingredient
GET /ingredient/:ingredients

Headers: x-api-key : YOUR_API_KEY

Example Request: GET /ingredient/tomato,cheese

Sample Response:
[
  {
    "id": 1,
    "title": "Tomato Cheese Pasta",
    "image": "https://spoonacular.com/recipeImages/1-312x231.jpg"
  }
]
8. Get Recipe Summary
GET /summary/id/:id

Headers: x-api-key : YOUR_API_KEY

Example Request: GET /summary/id/638199

Sample Response:
{
  "id": 1,
  "title": "Spaghetti Bolognese",
  "summary": "A classic Italian pasta dish made with ground beef and tomato sauce."
}
9. Get Recipe Instructions
GET /instructions/id/:id

Headers: x-api-key : YOUR_API_KEY

Example Request: GET /instructions/id/638199

Sample Response:
{
  "id": 1,
  "title": "Spaghetti Bolognese",
  "instructions": [
    {
      "step": 1,
      "description": "Boil the spaghetti."
    },
    {
      "step": 2,
      "description": "Cook the minced meat."
    }
  ]
}