example-data.com
Menu
Browse docs and collections

Overview

restaurant-photos / #542

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 542,
  "restaurantId": 98,
  "url": "https://picsum.photos/seed/restaurant-98-2/1200/800",
  "alt": "Aufderhar - Johns interior photo 3",
  "caption": "Ventus umerus umbra pax rerum fugiat appositus decimus utique debilito.",
  "isPrimary": false,
  "createdAt": "2024-08-28T09:12:40.541Z"
}