example-data.com
Menu
Browse docs and collections

Overview

pets / #46

Component variants

Medium

Ike

#46

Small
pets/46

Related

Request

curl example

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

JavaScript example

const res = await fetch(
  "https://example-data.com/api/v1/pets/46"
);
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/46"
);
const pet = (await res.json()) as Pet;

Python example

import requests

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

Response

{
  "id": 46,
  "ownerUserId": 51,
  "name": "Ike",
  "species": "dog",
  "breedId": null,
  "gender": "unknown",
  "birthDate": "2024-02-04",
  "weightKg": 2.7,
  "color": "Gray",
  "imageUrl": "https://picsum.photos/seed/pet-46/600/600",
  "createdAt": "2012-08-14T11:31:16.646Z",
  "updatedAt": "2016-07-29T10:09:03.419Z"
}