example-data.com
Menu
Browse docs and collections

Overview

pets / #6

Component variants

Medium

Emie

#6

Small
pets/6

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 6,
  "ownerUserId": 5,
  "name": "Emie",
  "species": "rabbit",
  "breedId": null,
  "gender": "unknown",
  "birthDate": null,
  "weightKg": 4.5,
  "color": "Black",
  "imageUrl": "https://picsum.photos/seed/pet-6/600/600",
  "createdAt": "2012-06-10T01:25:47.507Z",
  "updatedAt": "2019-06-03T16:44:42.107Z"
}