example-data.com
Menu
Browse docs and collections

Overview

restaurant-photos / #134

Component variants

Related

Request

curl example

curl -sS \
  "https://example-data.com/api/v1/restaurant-photos/134" \
  -H "Accept: application/json"

JavaScript example

const res = await fetch(
  "https://example-data.com/api/v1/restaurant-photos/134"
);
const restaurantPhoto = await res.json();

TypeScript example

// Download once: mkdir -p types && curl -o types/restaurant-photos.d.ts https://example-data.com/types/restaurant-photos.d.ts
import type { RestaurantPhoto } from "./types/restaurant-photos";

const res = await fetch(
  "https://example-data.com/api/v1/restaurant-photos/134"
);
const restaurantPhoto = (await res.json()) as RestaurantPhoto;

Python example

import requests

res = requests.get(
    "https://example-data.com/api/v1/restaurant-photos/134"
)
restaurant_photo = res.json()

Response

{
  "id": 134,
  "restaurantId": 24,
  "url": "https://picsum.photos/seed/restaurant-24-1/1200/800",
  "alt": "Hirthe, Klein and Baumbach interior photo 2",
  "caption": "Approbo consectetur commodo tamisium supplanto deficio videlicet vox.",
  "isPrimary": false,
  "createdAt": "2024-11-25T01:15:44.101Z"
}