example-data.com
Menu
Browse docs and collections

meals

meals

Page 7 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": 145,
      "userId": 35,
      "name": "Banana",
      "kind": "snack",
      "calories": 360,
      "proteinGrams": 11,
      "carbsGrams": 73.5,
      "fatGrams": 2.4,
      "eatenAt": "2025-08-29T02:28:04.081Z",
      "createdAt": "2025-08-29T02:31:54.945Z"
    },
    {
      "id": 146,
      "userId": 35,
      "name": "Egg White Omelette",
      "kind": "breakfast",
      "calories": 572,
      "proteinGrams": 54.8,
      "carbsGrams": 76.8,
      "fatGrams": 5.1,
      "eatenAt": "2025-12-01T23:54:35.921Z",
      "createdAt": "2025-12-02T00:04:06.361Z"
    },
    {
      "id": 147,
      "userId": 36,
      "name": "Grilled Steak",
      "kind": "dinner",
      "calories": 423,
      "proteinGrams": 20.1,
      "carbsGrams": 46,
      "fatGrams": 17.6,
      "eatenAt": "2025-09-16T21:15:34.790Z",
      "createdAt": "2025-09-16T21:45:11.680Z"
    }
  ],
  "meta": {
    "page": 7,
    "limit": 24,
    "total": 1016,
    "totalPages": 43
  },
  "links": {
    "self": "/api/v1/meals?page=7&limit=24",
    "first": "/api/v1/meals?page=1&limit=24",
    "last": "/api/v1/meals?page=43&limit=24",
    "next": "/api/v1/meals?page=8&limit=24",
    "prev": "/api/v1/meals?page=6&limit=24"
  }
}