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
No authentication requiredFree to use with no key needed.
Sample Requests
GET
Search meals
Search meals by name.
https://www.themealdb.com/api/json/v1/1/search.php?s=chicken
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
Get random meal
Get a random recipe.
https://www.themealdb.com/api/json/v1/1/random.php
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));
GET
Filter by ingredient
Find meals containing salmon.
https://www.themealdb.com/api/json/v1/1/filter.php?i=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