BYTETOOLS

TheMealDB API

Free recipe API with no signup: search meals by name, ingredient, category or area, with full instructions, ingredient lists and photos. Tested example.

No API key requiredCORS enabledHTTPSFree tier

Endpoint tested and returned HTTP 200 on 2026-08-19

What is the TheMealDB API?

TheMealDB is a free recipe API providing meals with full cooking instructions, measured ingredient lists, category, cuisine and photos. The developer test key `1` works without registration.

TheMealDB is the most complete free recipe API available, returning full instructions, a photo, category, cuisine and an itemised ingredient list with measurements — enough to render a genuinely usable recipe page.

Its one notable design quirk is the ingredient format. Rather than an array, ingredients arrive as 40 flat numbered fields: `strIngredient1` through `strIngredient20` paired with `strMeasure1` through `strMeasure20`, with unused slots left as empty strings or null. You have to loop and filter them into a usable list.

Quick facts

Base URL
https://www.themealdb.com/api/json/v1/1
Authentication
The test key `1` in the URL path works for everyone with no registration. Supporters get a production key with extra endpoints.
Rate limit
No published limit on the test key.
Pricing
Free with the test key; a small Patreon supports development and unlocks extra endpoints.
CORS
Enabled — callable directly from browser JavaScript
Official docs
Read the docs

How to use the TheMealDB API

Every request below was executed against the live API on 2026-08-19, and the response shown is the real body it returned — not an illustration.

1. Search for a meal by name

GET https://www.themealdb.com/api/json/v1/1/search.php?s=arrabiata

curl
curl 'https://www.themealdb.com/api/json/v1/1/search.php?s=arrabiata'
JavaScript (fetch)
const res = await fetch("https://www.themealdb.com/api/json/v1/1/search.php?s=arrabiata");
if (!res.ok) throw new Error(`Request failed: ${res.status}`);
const data = await res.json();
console.log(data);
Python (requests)
import requests

res = requests.get("https://www.themealdb.com/api/json/v1/1/search.php?s=arrabiata", timeout=20)
res.raise_for_status()
print(res.json())
Response — HTTP 200 (truncated)
{
  "meals": [
    {
      "idMeal": "52771",
      "strMeal": "Spicy Arrabiata Penne",
      "strMealAlternate": null,
      "strCategory": "Vegetarian",
      "strArea": "Italian",
      "strCountry": "Italy",
      "strInstructions": "Bring a large pot of water to a boil. Add kosher salt to the boiling water, then add the pasta. Cook according to the package instructions, about 9 minutes.\r\nIn a large skillet over medium-high heat, add the olive oil and heat until the oil starts to shimmer. Add the garlic and cook, stirring, until fragrant, 1 to 2 minutes. Add the chopped tomatoes, red chile flakes, Italian seasoning and salt and pepper to taste. Bring to a boil and cook for 5 minutes. Remove from the heat and add the chopped basil.\r\nDrain the pasta and add it to the sauce. Garnish with Parmigiano-Reggiano flakes and more basil and serve warm.",
      "strMealThumb": "https://www.themealdb.com/images/media/meals/ustsqw1468250014.jpg",
      "strTags": "Pasta,Curry",
      "strYoutube": "https://www.youtube.com/watch?v=1IszT_guI08",
      "strIngredient1": "penne rigate",
      "strIngredient2": "olive oil",
      "strIngredient3": "garlic",
      "strIngredient4": "chopped tomatoes",
      "strIngredient5": "red chilli flakes",
      "strIngredient6": "italian seasoning",
      "strIngredient7": "basil",
      "strIngredient8": "Parmigiano-Reggiano",
      "strIngredient9": "",
      "strIngredient10": "",
      "strIngredient11": "",
      "strIngredient12": "",
      "strIngredient13": "",
      "strIngredient14": "",
      "strIngredient15": "",
      "strIngredien

Parameters

ParameterTypeRequiredDescription
sstringOptionalSearch meals by name, on /search.php. arrabiata
istringOptionalFilter by main ingredient on /filter.php, or look up by id on /lookup.php. chicken_breast
cstringOptionalFilter by category on /filter.php. Seafood
astringOptionalFilter by area or cuisine on /filter.php. Italian

Response fields

mealsarray|null
Array of meals, or null when nothing matched — not an empty array.
meals[].strMealstring
Meal name.
meals[].strInstructionsstring
Full cooking instructions as one text block.
meals[].strMealThumbstring
Photo URL.
meals[].strIngredient1-20string
Ingredient names in 20 numbered fields; unused ones are empty or null.
meals[].strMeasure1-20string
Matching measurements for each ingredient slot.

What you can build with the TheMealDB API

  • Build a recipe search and browsing app
  • Generate meal plans filtered by cuisine or main ingredient
  • Create a random meal suggestion feature
  • Practise transforming awkward flat API data into clean structures

Common errors and how to fix them

meals: null

No results — the API returns null, not an empty array.

Fix: Check for null explicitly before iterating, or your code will throw.

Empty ingredient slots

Unused ingredient fields are empty strings or null.

Fix: Loop 1 to 20 and skip entries where the ingredient is falsy or whitespace.

TheMealDB API — frequently asked questions

Is TheMealDB API free?

Yes. The developer test key `1` is built into the URL path and works for everyone with no registration. A small Patreon unlocks additional endpoints.

Why are ingredients in 20 separate fields?

It is a legacy schema decision — ingredients come as strIngredient1 through strIngredient20 with matching strMeasure fields. Loop through them and filter out the empty slots to build a normal array.

Why does the API return null instead of an empty array?

When nothing matches, `meals` is null rather than []. Check for null before iterating, otherwise your code will throw on a no-results search.

Is there a drinks equivalent?

Yes, TheCocktailDB is built by the same team with an identical schema and the same test key, covering cocktails and drinks.

Tools that pair with this API

TheMealDB is an independent third-party service and is not affiliated with ByteTools or ByteVancer. Details on this page were verified on 2026-08-19; always check the official documentation before relying on this API in production, as terms and limits can change.