example-data.com
Menu
Browse docs and collections

Overview

restaurants / #30

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 30,
  "name": "Mills, Kassulke and Marquardt",
  "slug": "mills-kassulke-and-marquardt-30",
  "cuisine": "vietnamese",
  "priceRange": "$$$",
  "rating": 3.6,
  "ratingCount": 1380,
  "countryAlpha2": "GR",
  "city": "Jeffersonville",
  "neighborhood": "Jefferson County",
  "address": "12293 Hillside Road",
  "phone": "+1 202-555-0129 ext 1",
  "website": "https://mills-kassulke-and-marquardt-30.example.com",
  "hasDelivery": true,
  "isOpen": true,
  "latitude": 57.324171,
  "longitude": -58.077778,
  "createdAt": "2024-07-04T11:42:40.012Z",
  "updatedAt": "2024-07-04T11:42:40.012Z"
}