example-data.com
Menu
Browse docs and collections

Overview

destinations / #17

New York

New York

destination · ★ 48.0

Component variants

Request

curl example

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

JavaScript example

const res = await fetch(
  "https://example-data.com/api/v1/destinations/17"
);
const destination = await res.json();

TypeScript example

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

const res = await fetch(
  "https://example-data.com/api/v1/destinations/17"
);
const destination = (await res.json()) as Destination;

Python example

import requests

res = requests.get(
    "https://example-data.com/api/v1/destinations/17"
)
destination = res.json()

Response

{
  "id": 17,
  "name": "New York",
  "slug": "new-york-17",
  "countryAlpha2": "US",
  "description": "A must-visit for its natural wonders, welcoming locals, and unique character.",
  "imageUrl": "https://picsum.photos/seed/dest-17/800/600",
  "popularity": 48
}