example-data.com
Menu
Browse docs and collections

Overview

restaurants / #86

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 86,
  "name": "Schimmel LLC",
  "slug": "schimmel-llc-86",
  "cuisine": "japanese",
  "priceRange": "$$$",
  "rating": 3.3,
  "ratingCount": 2000,
  "countryAlpha2": "JP",
  "city": "Clovis",
  "neighborhood": "Strathclyde",
  "address": "8777 Turner Wells",
  "phone": "+1 202-555-0185 ext 1",
  "website": "https://schimmel-llc-86.example.com",
  "hasDelivery": true,
  "isOpen": false,
  "latitude": 57.169855,
  "longitude": -34.888335,
  "createdAt": "2024-10-01T15:41:58.902Z",
  "updatedAt": "2024-10-01T15:41:58.902Z"
}