Spoonacular API
api.spoonacular.com · Food
365,000+ recipes with detailed nutritional data, ingredient substitutions, wine pairings, grocery products, and menu item search. Free tier: 150 points/day.
Authentication
Sample Requests
Search recipes by query.
Hover any highlighted part to learn what it does
curl -X GET "https://api.spoonacular.com/recipes/complexSearch?query=pasta%20carbonara&apiKey=YOUR_KEY&number=5"
import requests
params = {
"query": "pasta carbonara",
"apiKey": "YOUR_KEY",
"number": "5"
}
response = requests.get(
"https://api.spoonacular.com/recipes/complexSearch",
params=params,
)
print(response.json())const url = new URL('https://api.spoonacular.com/recipes/complexSearch');
url.searchParams.set('query', 'pasta carbonara');
url.searchParams.set('apiKey', 'YOUR_KEY');
url.searchParams.set('number', '5');
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://api.spoonacular.com/recipes/complexSearch")
q := baseURL.Query()
q.Set("query", "pasta carbonara")
q.Set("apiKey", "YOUR_KEY")
q.Set("number", "5")
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://api.spoonacular.com/recipes/complexSearch")
uri.query = URI.encode_www_form({
"query" => "pasta carbonara",
"apiKey" => "YOUR_KEY",
"number" => "5"
})
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://api.spoonacular.com/recipes/complexSearch?" . http_build_query([
"query" => "pasta carbonara",
"apiKey" => "YOUR_KEY",
"number" => "5"
]);
$opts = ["http" => [
"method" => "GET",
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));Get full nutrition data for a recipe.
Hover any highlighted part to learn what it does
curl -X GET "https://api.spoonacular.com/recipes/716429/nutritionWidget.json?apiKey=YOUR_KEY"
import requests
params = {
"apiKey": "YOUR_KEY"
}
response = requests.get(
"https://api.spoonacular.com/recipes/716429/nutritionWidget.json",
params=params,
)
print(response.json())const url = new URL('https://api.spoonacular.com/recipes/716429/nutritionWidget.json');
url.searchParams.set('apiKey', 'YOUR_KEY');
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://api.spoonacular.com/recipes/716429/nutritionWidget.json")
q := baseURL.Query()
q.Set("apiKey", "YOUR_KEY")
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://api.spoonacular.com/recipes/716429/nutritionWidget.json")
uri.query = URI.encode_www_form({
"apiKey" => "YOUR_KEY"
})
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://api.spoonacular.com/recipes/716429/nutritionWidget.json?" . http_build_query([
"apiKey" => "YOUR_KEY"
]);
$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
- Get a free API key at spoonacular.com/food-api
- Pass apiKey=YOUR_KEY on every request
- Try GET /recipes/complexSearch?query=vegan+pizza&number=5&apiKey=YOUR_KEY
- Free tier uses a "points" system — each endpoint costs different points per call
What can you build with Spoonacular API?
Spoonacular API 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
API Key authentication. You'll receive a key after signing up. Send it with every request — in a header or query parameter. Keep it out of client-side code and never commit it to version control. Spoonacular API is free to use up to a usage limit, making it a low-risk choice to experiment with.
New to APIs? Read our beginner's guide