example-data.com
Menu
Browse docs and collections

Overview

restaurants / #71

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 71,
  "name": "Gislason Group",
  "slug": "gislason-group-71",
  "cuisine": "mediterranean",
  "priceRange": "$$$$",
  "rating": 3.2,
  "ratingCount": 944,
  "countryAlpha2": "CN",
  "city": "Marinafield",
  "neighborhood": "Avon",
  "address": "69309 Brekke Lake",
  "phone": "+1 202-555-0170 ext 1",
  "website": "https://gislason-group-71.example.com",
  "hasDelivery": true,
  "isOpen": true,
  "latitude": 38.033994,
  "longitude": -59.987288,
  "createdAt": "2024-05-28T08:56:05.345Z",
  "updatedAt": "2024-05-28T08:56:05.345Z"
}