example-data.com
Menu
Browse docs and collections

Overview

menu-items / #41

Component variants

Related

Request

curl example

curl -sS \
  "https://example-data.com/api/v1/menu-items/41" \
  -H "Accept: application/json"

JavaScript example

const res = await fetch(
  "https://example-data.com/api/v1/menu-items/41"
);
const menuItem = await res.json();

TypeScript example

// Download once: mkdir -p types && curl -o types/menu-items.d.ts https://example-data.com/types/menu-items.d.ts
import type { MenuItem } from "./types/menu-items";

const res = await fetch(
  "https://example-data.com/api/v1/menu-items/41"
);
const menuItem = (await res.json()) as MenuItem;

Python example

import requests

res = requests.get(
    "https://example-data.com/api/v1/menu-items/41"
)
menu_item = res.json()

Response

{
  "id": 41,
  "menuId": 5,
  "name": "Garden Duck Sandwich",
  "slug": "garden-duck-sandwich-41",
  "description": "Inspired by traditional recipes with a modern twist.",
  "price": 33.45,
  "currency": "USD",
  "foodCategoryId": 9,
  "spicyLevel": 0,
  "isVegetarian": false,
  "isVegan": false,
  "isGlutenFree": false,
  "imageUrl": "https://picsum.photos/seed/menu-item-41/640/480",
  "createdAt": "2024-12-13T17:18:04.986Z"
}