New in 2.4: Test runs you can trust See what's new →

食谱 API

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

请求示例

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

cURL
curl -X GET "https://api.testingapis.com/api/Recipes?limit=2"
在 Studio 中运行
响应 · 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)

筛选、排序与分页

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