example-data.com
Menu
Browse docs and collections

restaurants

restaurants

Page 4 of 5.

Overview

Request

curl example

curl -sS \
  "https://example-data.com/api/v1/restaurants?limit=25"

JavaScript example

const res = await fetch(
  "https://example-data.com/api/v1/restaurants?limit=25"
);
const { data, meta } = 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, ListEnvelope } from "./types/restaurants";

const res = await fetch(
  "https://example-data.com/api/v1/restaurants?limit=25"
);
const { data, meta } = (await res.json()) as ListEnvelope<Restaurant>;

Python example

import requests

res = requests.get(
    "https://example-data.com/api/v1/restaurants",
    params={"limit": 25},
)
data = res.json()

Response

{
  "data": [
    {
      "id": 73,
      "name": "Hauck, Larson and West",
      "slug": "hauck-larson-and-west-73",
      "cuisine": "chinese",
      "priceRange": "$$$",
      "rating": 4.4,
      "ratingCount": 2362,
      "countryAlpha2": "VN",
      "city": "Port Shayna",
      "neighborhood": "Cornwall",
      "address": "4924 Stanford Hollow",
      "phone": "+1 202-555-0172 ext 1",
      "website": null,
      "hasDelivery": true,
      "isOpen": false,
      "latitude": 34.790708,
      "longitude": -179.537102,
      "createdAt": "2024-11-04T08:23:16.156Z",
      "updatedAt": "2024-11-04T08:23:16.156Z"
    },
    {
      "id": 74,
      "name": "Schoen, Rice and Koss",
      "slug": "schoen-rice-and-koss-74",
      "cuisine": "japanese",
      "priceRange": "$$$",
      "rating": 3.6,
      "ratingCount": 815,
      "countryAlpha2": "BE",
      "city": "South Danielabury",
      "neighborhood": "Logan County",
      "address": "934 Rosenbaum Shores",
      "phone": "+1 202-555-0173 ext 1",
      "website": "https://schoen-rice-and-koss-74.example.com",
      "hasDelivery": true,
      "isOpen": true,
      "latitude": -5.015172,
      "longitude": -135.306777,
      "createdAt": "2024-10-31T20:55:52.558Z",
      "updatedAt": "2024-10-31T20:55:52.558Z"
    },
    {
      "id": 75,
      "name": "Glover, Hoppe and Quigley",
      "slug": "glover-hoppe-and-quigley-75",
      "cuisine": "italian",
      "priceRange": "$",
      "rating": 3.8,
      "ratingCount": 707,
      "countryAlpha2": "ET",
      "city": "Reynoldscester",
      "neighborhood": "Washington County",
      "address": "26196 Harvey Hills",
      "phone": "+1 202-555-0174 ext 1",
      "website": null,
      "hasDelivery": false,
      "isOpen": true,
      "latitude": -36.364666,
      "longitude": -86.207307,
      "createdAt": "2024-06-24T18:31:05.509Z",
      "updatedAt": "2024-06-24T18:31:05.509Z"
    }
  ],
  "meta": {
    "page": 4,
    "limit": 24,
    "total": 100,
    "totalPages": 5
  },
  "links": {
    "self": "/api/v1/restaurants?page=4&limit=24",
    "first": "/api/v1/restaurants?page=1&limit=24",
    "last": "/api/v1/restaurants?page=5&limit=24",
    "next": "/api/v1/restaurants?page=5&limit=24",
    "prev": "/api/v1/restaurants?page=3&limit=24"
  }
}