TheMealDB Recipe API

REST API providing search, lookup, filtering, and browsing of 669 meals across categories, areas, and ingredients. Free V1 access uses the public test key "1" in the URL path. Premium V2 access unlocks multi-ingredient filters, random sets, latest meals, and custom meal upload for lifetime supporters (£10 one-time).

OpenAPI Specification

openapi.json Raw ↑
{
  "openapi": "3.0.0",
  "info": {
    "title": "TheMealDB API",
    "description": "An open, crowd-sourced database of meals and recipes from around the world",
    "version": "1.0.0",
    "contact": {
      "url": "https://www.themealdb.com"
    }
  },
  "servers": [
    {
      "url": "https://www.themealdb.com/api/json/v1/{apiKey}",
      "variables": {
        "apiKey": {
          "default": "1",
          "description": "API key - use '1' for testing/development. Premium supporters use their personal key."
        }
      }
    }
  ],
  "paths": {
    "/search.php": {
      "get": {
        "summary": "Search meals",
        "description": "Search for meals by name or list meals by first letter.",
        "operationId": "searchMeals",
        "parameters": [
          {
            "name": "s",
            "in": "query",
            "description": "Search meal by name (e.g. s=Arrabiata)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "f",
            "in": "query",
            "description": "List meals by first letter (single character, e.g. f=a)",
            "schema": {
              "type": "string",
              "maxLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response with array of meals or null if none found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "meals": {
                      "type": "array",
                      "nullable": true,
                      "items": {
                        "$ref": "#/components/schemas/Meal"
                      }
                    }
                  }
                },
                "example": {
                  "meals": [
                    {
                      "idMeal": "52771",
                      "strMeal": "Spicy Arrabiata Penne",
                      "strCategory": "Vegetarian",
                      "strArea": "Italian",
                      "strInstructions": "Bring a large pot of water to a boil...",
                      "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",
                      "strMeasure1": "1 pound"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/lookup.php": {
      "get": {
        "summary": "Lookup full meal details by ID",
        "description": "Retrieve complete recipe payload including all ingredients and measurements by meal ID.",
        "operationId": "lookupMeal",
        "parameters": [
          {
            "name": "i",
            "in": "query",
            "description": "Numeric meal ID (e.g. i=52772)",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response with full meal details",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "meals": {
                      "type": "array",
                      "nullable": true,
                      "items": {
                        "$ref": "#/components/schemas/Meal"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/random.php": {
      "get": {
        "summary": "Get a single random meal",
        "description": "Retrieve one randomly selected meal with complete recipe data.",
        "operationId": "getRandomMeal",
        "responses": {
          "200": {
            "description": "Successful response with one random meal",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "meals": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Meal"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/randomselection.php": {
      "get": {
        "summary": "Get 10 random meals (Premium only)",
        "description": "Retrieve 10 randomly selected meals in a single call. Requires a premium supporter API key.",
        "operationId": "getRandomSelection",
        "tags": [
          "Premium"
        ],
        "responses": {
          "200": {
            "description": "Successful response with 10 random meals",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "meals": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Meal"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/latest.php": {
      "get": {
        "summary": "Get latest 10 meals (Premium only)",
        "description": "Retrieve the 10 most recently added meals. Requires a premium supporter API key.",
        "operationId": "getLatestMeals",
        "tags": [
          "Premium"
        ],
        "responses": {
          "200": {
            "description": "Successful response with the 10 newest meals",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "meals": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Meal"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/categories.php": {
      "get": {
        "summary": "List all meal categories",
        "description": "Return all meal categories with thumbnail images and descriptions.",
        "operationId": "listCategories",
        "responses": {
          "200": {
            "description": "Successful response with all categories",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "categories": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Category"
                      }
                    }
                  }
                },
                "example": {
                  "categories": [
                    {
                      "idCategory": "1",
                      "strCategory": "Beef",
                      "strCategoryThumb": "https://www.themealdb.com/images/category/beef.png",
                      "strCategoryDescription": "Beef is the culinary name for meat from cattle..."
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/list.php": {
      "get": {
        "summary": "List categories, areas, or ingredients",
        "description": "Return a flat list of all available categories, cuisine areas, or ingredients. Provide exactly one query parameter.",
        "operationId": "listOptions",
        "parameters": [
          {
            "name": "c",
            "in": "query",
            "description": "List all meal categories (value must be 'list')",
            "schema": {
              "type": "string",
              "enum": ["list"]
            }
          },
          {
            "name": "a",
            "in": "query",
            "description": "List all cuisine areas (value must be 'list')",
            "schema": {
              "type": "string",
              "enum": ["list"]
            }
          },
          {
            "name": "i",
            "in": "query",
            "description": "List all ingredients (value must be 'list')",
            "schema": {
              "type": "string",
              "enum": ["list"]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response with list of category, area, or ingredient names",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "meals": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/filter.php": {
      "get": {
        "summary": "Filter meals by ingredient, category, or area",
        "description": "Return a list of meals matching the specified filter. Free tier supports a single ingredient. Premium tier supports multiple comma-separated ingredients.",
        "operationId": "filterMeals",
        "parameters": [
          {
            "name": "i",
            "in": "query",
            "description": "Filter by ingredient name (e.g. i=chicken_breast). Comma-separate multiple values for premium multi-ingredient filtering.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "c",
            "in": "query",
            "description": "Filter by category name (e.g. c=Seafood)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "a",
            "in": "query",
            "description": "Filter by cuisine area (e.g. a=Italian)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response with abbreviated meal list",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "meals": {
                      "type": "array",
                      "nullable": true,
                      "items": {
                        "$ref": "#/components/schemas/MealSummary"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Meal": {
        "type": "object",
        "description": "Full meal record with recipe details, ingredients, and measurements.",
        "properties": {
          "idMeal": {
            "type": "string",
            "description": "Unique numeric identifier for the meal",
            "example": "52771"
          },
          "strMeal": {
            "type": "string",
            "description": "Meal name",
            "example": "Spicy Arrabiata Penne"
          },
          "strDrinkAlternate": {
            "type": "string",
            "nullable": true,
            "description": "Suggested drink pairing"
          },
          "strCategory": {
            "type": "string",
            "description": "Meal category (e.g. Vegetarian, Beef, Dessert)",
            "example": "Vegetarian"
          },
          "strArea": {
            "type": "string",
            "description": "Cuisine area / country of origin",
            "example": "Italian"
          },
          "strInstructions": {
            "type": "string",
            "description": "Step-by-step cooking instructions"
          },
          "strMealThumb": {
            "type": "string",
            "format": "uri",
            "description": "URL to the meal thumbnail image. Append /small, /medium, or /large for sized variants.",
            "example": "https://www.themealdb.com/images/media/meals/ustsqw1468250014.jpg"
          },
          "strTags": {
            "type": "string",
            "nullable": true,
            "description": "Comma-separated tags",
            "example": "Pasta,Curry"
          },
          "strYoutube": {
            "type": "string",
            "nullable": true,
            "format": "uri",
            "description": "YouTube video URL for recipe walkthrough"
          },
          "strIngredient1": { "type": "string", "nullable": true },
          "strIngredient2": { "type": "string", "nullable": true },
          "strIngredient3": { "type": "string", "nullable": true },
          "strIngredient4": { "type": "string", "nullable": true },
          "strIngredient5": { "type": "string", "nullable": true },
          "strIngredient6": { "type": "string", "nullable": true },
          "strIngredient7": { "type": "string", "nullable": true },
          "strIngredient8": { "type": "string", "nullable": true },
          "strIngredient9": { "type": "string", "nullable": true },
          "strIngredient10": { "type": "string", "nullable": true },
          "strIngredient11": { "type": "string", "nullable": true },
          "strIngredient12": { "type": "string", "nullable": true },
          "strIngredient13": { "type": "string", "nullable": true },
          "strIngredient14": { "type": "string", "nullable": true },
          "strIngredient15": { "type": "string", "nullable": true },
          "strIngredient16": { "type": "string", "nullable": true },
          "strIngredient17": { "type": "string", "nullable": true },
          "strIngredient18": { "type": "string", "nullable": true },
          "strIngredient19": { "type": "string", "nullable": true },
          "strIngredient20": { "type": "string", "nullable": true },
          "strMeasure1": { "type": "string", "nullable": true },
          "strMeasure2": { "type": "string", "nullable": true },
          "strMeasure3": { "type": "string", "nullable": true },
          "strMeasure4": { "type": "string", "nullable": true },
          "strMeasure5": { "type": "string", "nullable": true },
          "strMeasure6": { "type": "string", "nullable": true },
          "strMeasure7": { "type": "string", "nullable": true },
          "strMeasure8": { "type": "string", "nullable": true },
          "strMeasure9": { "type": "string", "nullable": true },
          "strMeasure10": { "type": "string", "nullable": true },
          "strMeasure11": { "type": "string", "nullable": true },
          "strMeasure12": { "type": "string", "nullable": true },
          "strMeasure13": { "type": "string", "nullable": true },
          "strMeasure14": { "type": "string", "nullable": true },
          "strMeasure15": { "type": "string", "nullable": true },
          "strMeasure16": { "type": "string", "nullable": true },
          "strMeasure17": { "type": "string", "nullable": true },
          "strMeasure18": { "type": "string", "nullable": true },
          "strMeasure19": { "type": "string", "nullable": true },
          "strMeasure20": { "type": "string", "nullable": true },
          "strSource": {
            "type": "string",
            "nullable": true,
            "format": "uri",
            "description": "Original recipe source URL"
          },
          "strImageSource": {
            "type": "string",
            "nullable": true,
            "description": "Image attribution source"
          },
          "strCreativeCommonsConfirmed": {
            "type": "string",
            "nullable": true,
            "description": "Indicates if the image is confirmed Creative Commons licensed"
          },
          "dateModified": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "Date the meal record was last modified"
          }
        }
      },
      "MealSummary": {
        "type": "object",
        "description": "Abbreviated meal record returned by filter endpoints.",
        "properties": {
          "strMeal": {
            "type": "string",
            "description": "Meal name",
            "example": "Spicy Arrabiata Penne"
          },
          "strMealThumb": {
            "type": "string",
            "format": "uri",
            "description": "URL to the meal thumbnail image"
          },
          "idMeal": {
            "type": "string",
            "description": "Unique numeric identifier for the meal",
            "example": "52771"
          }
        }
      },
      "Category": {
        "type": "object",
        "description": "Meal category record.",
        "properties": {
          "idCategory": {
            "type": "string",
            "description": "Unique numeric category identifier",
            "example": "1"
          },
          "strCategory": {
            "type": "string",
            "description": "Category name",
            "example": "Beef"
          },
          "strCategoryThumb": {
            "type": "string",
            "format": "uri",
            "description": "URL to the category thumbnail image",
            "example": "https://www.themealdb.com/images/category/beef.png"
          },
          "strCategoryDescription": {
            "type": "string",
            "description": "Text description of the category"
          }
        }
      }
    }
  },
  "tags": [
    {
      "name": "Premium",
      "description": "Premium-only endpoints requiring a paid lifetime supporter API key"
    }
  ]
}