example-data.com
Menu
Browse docs and collections

meals

meals

Page 29 of 43.

Overview

Request

curl example

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

JavaScript example

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

TypeScript example

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

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

Python example

import requests

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

Response

{
  "data": [
    {
      "id": 673,
      "userId": 163,
      "name": "Sushi Roll",
      "kind": "lunch",
      "calories": 531,
      "proteinGrams": 23.8,
      "carbsGrams": 41.4,
      "fatGrams": 30,
      "eatenAt": "2025-05-28T19:20:05.168Z",
      "createdAt": "2025-05-28T19:28:11.453Z"
    },
    {
      "id": 674,
      "userId": 164,
      "name": "Almonds",
      "kind": "snack",
      "calories": 471,
      "proteinGrams": 17.8,
      "carbsGrams": 47,
      "fatGrams": 23.5,
      "eatenAt": "2025-10-23T02:53:35.957Z",
      "createdAt": "2025-10-23T03:18:41.692Z"
    },
    {
      "id": 675,
      "userId": 164,
      "name": "Turkey Sandwich",
      "kind": "lunch",
      "calories": 569,
      "proteinGrams": 39.2,
      "carbsGrams": 76.7,
      "fatGrams": 11.7,
      "eatenAt": "2025-10-30T12:24:10.696Z",
      "createdAt": "2025-10-30T12:32:17.902Z"
    }
  ],
  "meta": {
    "page": 29,
    "limit": 24,
    "total": 1016,
    "totalPages": 43
  },
  "links": {
    "self": "/api/v1/meals?page=29&limit=24",
    "first": "/api/v1/meals?page=1&limit=24",
    "last": "/api/v1/meals?page=43&limit=24",
    "next": "/api/v1/meals?page=30&limit=24",
    "prev": "/api/v1/meals?page=28&limit=24"
  }
}