example-data.com
Menu
Browse docs and collections

Overview

restaurants / #42

Component variants

Related

Request

curl example

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

JavaScript example

const res = await fetch(
  "https://example-data.com/api/v1/restaurants/42"
);
const restaurant = await res.json();

TypeScript example

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

const res = await fetch(
  "https://example-data.com/api/v1/restaurants/42"
);
const restaurant = (await res.json()) as Restaurant;

Python example

import requests

res = requests.get(
    "https://example-data.com/api/v1/restaurants/42"
)
restaurant = res.json()

Response

{
  "id": 42,
  "name": "Braun and Sons",
  "slug": "braun-and-sons-42",
  "cuisine": "japanese",
  "priceRange": "$$$",
  "rating": 3.6,
  "ratingCount": 1815,
  "countryAlpha2": "AT",
  "city": "Deckowland",
  "neighborhood": "Greater Manchester",
  "address": "58813 Tremblay Port",
  "phone": "+1 202-555-0141 ext 1",
  "website": "https://braun-and-sons-42.example.com",
  "hasDelivery": true,
  "isOpen": true,
  "latitude": -50.330882,
  "longitude": -17.400631,
  "createdAt": "2025-05-18T15:16:25.538Z",
  "updatedAt": "2025-05-18T15:16:25.538Z"
}