Alec
- ownerUserId
-
Judy Hackett @judy_hackett49
- name
- Alec
- species
- dog
- breedId
- Cavalier King Charles Spaniel
- gender
- unknown
- birthDate
- 2017-01-09
- weightKg
- 55.5
- color
- Black
- imageUrl
- https://picsum.photos/seed/pet-13/600/600
- createdAt
- updatedAt
Overview
pets / #13
Request
curl example
curl -sS \ "https://example-data.com/api/v1/pets/13" \ -H "Accept: application/json"
JavaScript example
const res = await fetch( "https://example-data.com/api/v1/pets/13" ); 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/13"
);
const pet = (await res.json()) as Pet; Python example
import requests
res = requests.get(
"https://example-data.com/api/v1/pets/13"
)
pet = res.json() Response
{
"id": 13,
"ownerUserId": 13,
"name": "Alec",
"species": "dog",
"breedId": 15,
"gender": "unknown",
"birthDate": "2017-01-09",
"weightKg": 55.5,
"color": "Black",
"imageUrl": "https://picsum.photos/seed/pet-13/600/600",
"createdAt": "2011-12-16T02:59:48.461Z",
"updatedAt": "2019-06-14T23:47:53.458Z"
}