example-data.com
Menu
Browse docs and collections

Overview

restaurants / #74

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 74,
  "name": "Schoen, Rice and Koss",
  "slug": "schoen-rice-and-koss-74",
  "cuisine": "japanese",
  "priceRange": "$$$",
  "rating": 3.6,
  "ratingCount": 815,
  "countryAlpha2": "BE",
  "city": "South Danielabury",
  "neighborhood": "Logan County",
  "address": "934 Rosenbaum Shores",
  "phone": "+1 202-555-0173 ext 1",
  "website": "https://schoen-rice-and-koss-74.example.com",
  "hasDelivery": true,
  "isOpen": true,
  "latitude": -5.015172,
  "longitude": -135.306777,
  "createdAt": "2024-10-31T20:55:52.558Z",
  "updatedAt": "2024-10-31T20:55:52.558Z"
}