食谱 API

带食材、步骤、菜系和难度的只读食谱。

你的账号已解锁这些端点。在每个端点的页面上用 Try it 发送请求。

这些端点需要一个免费账号。创建账号或登录即可查看详情并在这里试用。

请求示例

List recipes with filtering, sorting, search and pagination. 完整参考和 Send 按钮(英文).

cURL
curl -X GET "https://api.testingapis.com/api/Recipes?limit=2"
响应 · 200 OK
[
  {
    "id": 1,
    "title": "Spicy Thai Basil Chicken",
    "cuisine": "Thai",
    "prepTime": 15,
    "cookTime": 10,
    "servings": 4,
    "difficulty": "medium",
    "ingredients": ["500g chicken breast", "1 cup thai basil leaves", "… 5 more items"],
    "instructions": ["Dice the chicken into small cubes.", "Mince garlic and slice chilies.", "… 5 more items"],
    "image": "https://picsum.photos/seed/recipe1/600/400",
… (3 more lines)

登录后查看详情

这些端点的参数、请求和响应示例以及实时 Try it 面板仅对已登录的成员开放。账号免费,几秒钟就能创建。

筛选、排序与分页

列表端点接受 limit、page、offset、sort、order 和 q,任何字段名都可用作精确筛选。总数通过 X-Total-Count 响应头返回。写入的数据在服务器重启前都保存在内存中,所以测试可以随意创建、修改和删除记录。 查询参数参考.