example-data.com
Menu
Browse docs and collections

Overview

restaurants / #1

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 1,
  "name": "O'Hara and Sons",
  "slug": "o-hara-and-sons-1",
  "cuisine": "mediterranean",
  "priceRange": "$",
  "rating": 4.4,
  "ratingCount": 2759,
  "countryAlpha2": "NZ",
  "city": "New Eloisaboro",
  "neighborhood": "Hamilton County",
  "address": "96634 Ursula Forks",
  "phone": "+1 202-555-0100 ext 1",
  "website": "https://o-hara-and-sons-1.example.com",
  "hasDelivery": false,
  "isOpen": false,
  "latitude": 24.816431,
  "longitude": -126.109296,
  "createdAt": "2025-11-16T06:33:21.422Z",
  "updatedAt": "2025-11-16T06:33:21.422Z"
}