example-data.com
Menu
Browse docs and collections

Overview

restaurants / #43

Component variants

Related

Request

curl example

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

JavaScript example

const res = await fetch(
  "https://example-data.com/api/v1/restaurants/43"
);
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/43"
);
const restaurant = (await res.json()) as Restaurant;

Python example

import requests

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

Response

{
  "id": 43,
  "name": "Brown - Johnson",
  "slug": "brown-johnson-43",
  "cuisine": "mexican",
  "priceRange": "$$$",
  "rating": 3.3,
  "ratingCount": 1012,
  "countryAlpha2": "CA",
  "city": "West Bernie",
  "neighborhood": "Clark County",
  "address": "87151 East Street",
  "phone": "+1 202-555-0142 ext 1",
  "website": "https://brown-johnson-43.example.com",
  "hasDelivery": true,
  "isOpen": true,
  "latitude": -44.909813,
  "longitude": 105.632293,
  "createdAt": "2025-03-22T16:50:06.247Z",
  "updatedAt": "2025-03-22T16:50:06.247Z"
}