example-data.com
Menu
Browse docs and collections

Overview

meals / #401

Protein Bar

userId
Esperanza Casper @esperanza_casper
name
Protein Bar
kind
snack
calories
356
proteinGrams
52.3
carbsGrams
30.5
fatGrams
2.7
eatenAt
createdAt

Component variants

Related

Request

curl example

curl -sS \
  "https://example-data.com/api/v1/meals/401" \
  -H "Accept: application/json"

JavaScript example

const res = await fetch(
  "https://example-data.com/api/v1/meals/401"
);
const meal = 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 } from "./types/meals";

const res = await fetch(
  "https://example-data.com/api/v1/meals/401"
);
const meal = (await res.json()) as Meal;

Python example

import requests

res = requests.get(
    "https://example-data.com/api/v1/meals/401"
)
meal = res.json()

Response

{
  "id": 401,
  "userId": 97,
  "name": "Protein Bar",
  "kind": "snack",
  "calories": 356,
  "proteinGrams": 52.3,
  "carbsGrams": 30.5,
  "fatGrams": 2.7,
  "eatenAt": "2025-08-08T16:44:13.320Z",
  "createdAt": "2025-08-08T17:04:28.901Z"
}