example-data.com
Menu
Browse docs and collections

ingredients

ingredients

Page 3 of 9.

Overview

Request

curl example

curl -sS \
  "https://example-data.com/api/v1/ingredients?limit=25"

JavaScript example

const res = await fetch(
  "https://example-data.com/api/v1/ingredients?limit=25"
);
const { data, meta } = await res.json();

TypeScript example

// Download once: mkdir -p types && curl -o types/ingredients.d.ts https://example-data.com/types/ingredients.d.ts
import type { Ingredient, ListEnvelope } from "./types/ingredients";

const res = await fetch(
  "https://example-data.com/api/v1/ingredients?limit=25"
);
const { data, meta } = (await res.json()) as ListEnvelope<Ingredient>;

Python example

import requests

res = requests.get(
    "https://example-data.com/api/v1/ingredients",
    params={"limit": 25},
)
data = res.json()

Response

{
  "data": [
    {
      "id": 49,
      "name": "Shrimp",
      "slug": "shrimp-49",
      "foodCategoryId": null,
      "unit": "g",
      "defaultPricePerUnit": 18.55,
      "currency": "USD"
    },
    {
      "id": 50,
      "name": "Scallops",
      "slug": "scallops-50",
      "foodCategoryId": null,
      "unit": "piece",
      "defaultPricePerUnit": 19.19,
      "currency": "USD"
    },
    {
      "id": 51,
      "name": "Mussels",
      "slug": "mussels-51",
      "foodCategoryId": 10,
      "unit": "g",
      "defaultPricePerUnit": 20.07,
      "currency": "USD"
    }
  ],
  "meta": {
    "page": 3,
    "limit": 24,
    "total": 200,
    "totalPages": 9
  },
  "links": {
    "self": "/api/v1/ingredients?page=3&limit=24",
    "first": "/api/v1/ingredients?page=1&limit=24",
    "last": "/api/v1/ingredients?page=9&limit=24",
    "next": "/api/v1/ingredients?page=4&limit=24",
    "prev": "/api/v1/ingredients?page=2&limit=24"
  }
}