example-data.com
Menu
Browse docs and collections

Overview

pets / #1

Component variants

Medium

Juwan

#1

Small
pets/1

Related

Request

curl example

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

JavaScript example

          const res = await fetch(
  "https://example-data.com/api/v1/pets/1"
);
const pet = await res.json();
        

TypeScript example

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

const res = await fetch(
  "https://example-data.com/api/v1/pets/1"
);
const pet = (await res.json()) as Pet;
        

Python example

          import requests

res = requests.get(
    "https://example-data.com/api/v1/pets/1"
)
pet = res.json()
        

Response

{
  "id": 1,
  "ownerUserId": 1,
  "name": "Juwan",
  "species": "reptile",
  "breedId": 71,
  "gender": "unknown",
  "birthDate": "2018-01-10",
  "weightKg": 5.1,
  "color": "Yellow",
  "imageUrl": "https://picsum.photos/seed/pet-1/600/600",
  "createdAt": "2014-07-16T00:37:39.435Z",
  "updatedAt": "2021-04-21T04:08:36.863Z"
}