example-data.com
Menu
Browse docs and collections

Overview

restaurants / #72

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 72,
  "name": "Schamberger LLC",
  "slug": "schamberger-llc-72",
  "cuisine": "ethiopian",
  "priceRange": "$$$$",
  "rating": 4.1,
  "ratingCount": 1798,
  "countryAlpha2": "ID",
  "city": "Walshville",
  "neighborhood": "Fife",
  "address": "5276 Church Avenue",
  "phone": "+1 202-555-0171 ext 1",
  "website": "https://schamberger-llc-72.example.com",
  "hasDelivery": false,
  "isOpen": true,
  "latitude": -41.765323,
  "longitude": -145.399419,
  "createdAt": "2024-10-17T14:38:55.700Z",
  "updatedAt": "2024-10-17T14:38:55.700Z"
}