TheMealDB
www.themealdb.com · Food
Free community recipe database — search meals by name, ingredient, or category. Includes ingredients, instructions, photos, and YouTube video links. No API key for basic use.
Authentication
Sample Requests
Search meals by name.
Hover any highlighted part to learn what it does
curl -X GET "https://www.themealdb.com/api/json/v1/1/search.php?s=chicken"
import requests
params = {
"s": "chicken"
}
response = requests.get(
"https://www.themealdb.com/api/json/v1/1/search.php",
params=params,
)
print(response.json())const url = new URL('https://www.themealdb.com/api/json/v1/1/search.php');
url.searchParams.set('s', 'chicken');
const response = await fetch(url);
const data = await response.json();
console.log(data);package main
import (
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
baseURL, _ := url.Parse("https://www.themealdb.com/api/json/v1/1/search.php")
q := baseURL.Query()
q.Set("s", "chicken")
baseURL.RawQuery = q.Encode()
targetURL := baseURL.String()
req, _ := http.NewRequest("GET", targetURL, nil)
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}require "net/http"
require "json"
uri = URI("https://www.themealdb.com/api/json/v1/1/search.php")
uri.query = URI.encode_www_form({
"s" => "chicken"
})
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
req = Net::HTTP::Get.new(uri)
res = http.request(req)
puts JSON.parse(res.body)<?php
$url = "https://www.themealdb.com/api/json/v1/1/search.php?" . http_build_query([
"s" => "chicken"
]);
$opts = ["http" => [
"method" => "GET",
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));Get a random recipe.
Hover any highlighted part to learn what it does
curl -X GET "https://www.themealdb.com/api/json/v1/1/random.php"
import requests
response = requests.get(
"https://www.themealdb.com/api/json/v1/1/random.php",
)
print(response.json())const url = 'https://www.themealdb.com/api/json/v1/1/random.php'; const response = await fetch(url); const data = await response.json(); console.log(data);
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
targetURL := "https://www.themealdb.com/api/json/v1/1/random.php"
req, _ := http.NewRequest("GET", targetURL, nil)
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}require "net/http"
require "json"
uri = URI("https://www.themealdb.com/api/json/v1/1/random.php")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
req = Net::HTTP::Get.new(uri)
res = http.request(req)
puts JSON.parse(res.body)<?php
$url = "https://www.themealdb.com/api/json/v1/1/random.php";
$opts = ["http" => [
"method" => "GET",
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));Find meals containing salmon.
Hover any highlighted part to learn what it does
curl -X GET "https://www.themealdb.com/api/json/v1/1/filter.php?i=salmon"
import requests
params = {
"i": "salmon"
}
response = requests.get(
"https://www.themealdb.com/api/json/v1/1/filter.php",
params=params,
)
print(response.json())const url = new URL('https://www.themealdb.com/api/json/v1/1/filter.php');
url.searchParams.set('i', 'salmon');
const response = await fetch(url);
const data = await response.json();
console.log(data);package main
import (
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
baseURL, _ := url.Parse("https://www.themealdb.com/api/json/v1/1/filter.php")
q := baseURL.Query()
q.Set("i", "salmon")
baseURL.RawQuery = q.Encode()
targetURL := baseURL.String()
req, _ := http.NewRequest("GET", targetURL, nil)
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}require "net/http"
require "json"
uri = URI("https://www.themealdb.com/api/json/v1/1/filter.php")
uri.query = URI.encode_www_form({
"i" => "salmon"
})
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
req = Net::HTTP::Get.new(uri)
res = http.request(req)
puts JSON.parse(res.body)<?php
$url = "https://www.themealdb.com/api/json/v1/1/filter.php?" . http_build_query([
"i" => "salmon"
]);
$opts = ["http" => [
"method" => "GET",
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));Postman Setup Guide
- No API key — use "1" in the URL
- Search: GET /search.php?s=pasta
- Random: GET /random.php
- Filter by ingredient: GET /filter.php?i=chicken
- Categories: GET /categories.php
What can you build with TheMealDB?
TheMealDB is a Food API. Developers commonly use food APIs for:
- surfacing recipes, nutrition, and ingredient data
- building menu and restaurant discovery apps
- powering diet, calorie, and meal-planning tools
- accessing food safety and product information
- integrating grocery ordering and delivery
No authentication required. This API is open — no signup or key needed. Ideal for quick prototypes and public-facing features. TheMealDB is free to use, making it a low-risk choice to experiment with.
New to APIs? Read our beginner's guide