example-data.com
Menu
Browse docs and collections

Overview

restaurants / #66

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 66,
  "name": "Bergstrom LLC",
  "slug": "bergstrom-llc-66",
  "cuisine": "korean",
  "priceRange": "$",
  "rating": 3,
  "ratingCount": 302,
  "countryAlpha2": "DK",
  "city": "South Gate",
  "neighborhood": "Isle of Wight",
  "address": "8922 Northfield Road",
  "phone": "+1 202-555-0165 ext 1",
  "website": "https://bergstrom-llc-66.example.com",
  "hasDelivery": true,
  "isOpen": false,
  "latitude": 30.156243,
  "longitude": -14.551925,
  "createdAt": "2024-08-22T13:04:05.614Z",
  "updatedAt": "2024-08-22T13:04:05.614Z"
}