Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Miguelcds/Recipe-Hub/llms.txt

Use this file to discover all available pages before exploring further.

TheMealDB is a free, open meal and recipe database. The v1 API requires no API key or authentication, making it well-suited for learning projects and demos.
The v1 API (/api/json/v1/1/) is free and has no documented rate limits. Do not use it in production applications with high traffic — switch to a v2 key or a self-hosted mirror for anything beyond demos.
Base URL
https://themealdb.com/api/json/v1/1/
Recipe Hub uses three endpoints from this API:

Search by name

Find meals matching a name query.

Lookup by ID

Fetch full detail for a single meal.

Random meal

Retrieve a random meal from the database.

Search by name

GET https://themealdb.com/api/json/v1/1/search.php?s={name}
Returns all meals whose name matches the search string.

Parameters

s
string
required
The meal name to search for. Partial matches are supported (e.g., chicken returns all meals containing “chicken”).

Example request

example request
curl "https://themealdb.com/api/json/v1/1/search.php?s=chicken"

Raw API response shape

The API returns a meals array. Each object contains the full meal record:
example response
{
  "meals": [
    {
      "idMeal": "52772",
      "strMeal": "Teriyaki Chicken Casserole",
      "strMealThumb": "https://www.themealdb.com/images/media/meals/wvpsxx1468256321.jpg",
      "strCategory": "Chicken",
      "strInstructions": "Preheat oven to 350°...",
      "strYoutube": "https://www.youtube.com/watch?v=4aZr5hZXP_s",
      "strIngredient1": "soy sauce",
      "strIngredient2": "water",
      "strIngredient3": "brown sugar",
      "strIngredient4": "",
      "strMeasure1": "3/4 cup",
      "strMeasure2": "1/2 cup",
      "strMeasure3": "1/4 cup",
      "strMeasure4": ""
    }
  ]
}
TheMealDB always returns exactly 20 ingredient fields (strIngredient1strIngredient20) and 20 measure fields (strMeasure1strMeasure20) per meal. Unused slots are empty strings or null. The app loops over all 20 and filters out the empty ones before returning them to the UI.

What the app returns

The service layer maps the raw response to a leaner shape before passing it to the UI:
id
string
required
TheMealDB meal ID (idMeal).
name
string
required
Meal name (strMeal).
picture
string
required
URL to the meal thumbnail image (strMealThumb).
category
string
required
Meal category, e.g. “Chicken”, “Dessert” (strCategory).

Lookup by ID

GET https://themealdb.com/api/json/v1/1/lookup.php?i={id}
Returns the full detail record for a single meal identified by its TheMealDB ID.

Parameters

i
string
required
The TheMealDB meal ID. Obtain this from a search or random result (idMeal).

Example request

example request
curl "https://themealdb.com/api/json/v1/1/lookup.php?i=52772"

Raw API response shape

The response structure is identical to the search endpoint — a meals array with one item:
example response
{
  "meals": [
    {
      "idMeal": "52772",
      "strMeal": "Teriyaki Chicken Casserole",
      "strMealThumb": "https://www.themealdb.com/images/media/meals/wvpsxx1468256321.jpg",
      "strCategory": "Chicken",
      "strInstructions": "Preheat oven to 350°...",
      "strYoutube": "https://www.youtube.com/watch?v=4aZr5hZXP_s",
      "strIngredient1": "soy sauce",
      "strIngredient2": "water",
      "strIngredient3": "brown sugar",
      "strIngredient4": "",
      "strMeasure1": "3/4 cup",
      "strMeasure2": "1/2 cup",
      "strMeasure3": "1/4 cup",
      "strMeasure4": ""
    }
  ]
}

What the app returns

The lookup response is mapped to an extended shape that includes the full recipe detail:
id
string
required
TheMealDB meal ID (idMeal).
name
string
required
Meal name (strMeal).
picture
string
required
URL to the meal thumbnail image (strMealThumb).
category
string
required
Meal category (strCategory).
instructions
string
required
Step-by-step cooking instructions (strInstructions).
video
string
YouTube video URL for the recipe (strYoutube). May be empty.
ingredients
object[]
required
Parsed ingredient list. Each item is an object:

Random meal

GET https://themealdb.com/api/json/v1/1/random.php
Returns a single randomly chosen meal each time it is called.

Parameters

This endpoint takes no parameters.

Example request

example request
curl "https://themealdb.com/api/json/v1/1/random.php"

How the app uses this endpoint

To populate the home page grid, Recipe Hub fires 9 parallel requests using Promise.all:
parallel random fetch
const requests = Array.from({ length: 9 }, () =>
  fetch(`${URL_BASE}random.php`)
);
const responses = await Promise.all(requests);
Because each request is independent, they can all be in-flight simultaneously, which is faster than making them sequentially.

What the app returns

Each random meal is mapped to the same lean shape used by the search endpoint:
id
string
required
TheMealDB meal ID.
name
string
required
Meal name.
picture
string
required
URL to the meal thumbnail image.
category
string
required
Meal category.

Build docs developers (and LLMs) love