example-data.com
Menu
Browse docs and collections

Overview

restaurants / #59

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 59,
  "name": "Blanda and Sons",
  "slug": "blanda-and-sons-59",
  "cuisine": "thai",
  "priceRange": "$$",
  "rating": 4.1,
  "ratingCount": 2682,
  "countryAlpha2": "DE",
  "city": "New Odashire",
  "neighborhood": "Dumfries and Galloway",
  "address": "55400 Carmela Ramp",
  "phone": "+1 202-555-0158 ext 1",
  "website": "https://blanda-and-sons-59.example.com",
  "hasDelivery": true,
  "isOpen": true,
  "latitude": 26.34044,
  "longitude": 163.664341,
  "createdAt": "2024-08-27T21:15:41.971Z",
  "updatedAt": "2024-08-27T21:15:41.971Z"
}