Skip to content
Get started

Find pet by ID.

client.pets.retrieve(numberpetID, RequestOptionsoptions?): Pet { name, photoUrls, id, 3 more }
get/pet/{petId}

Find pet by ID.

ParametersExpand Collapse
petID: number
formatint64
ReturnsExpand Collapse
Pet { name, photoUrls, id, 3 more }
name: string
photoUrls: Array<string>
id?: number
formatint64
category?: Category { id, name }
id?: number
formatint64
name?: string
status?: "available" | "pending" | "sold"

pet status in the store

Accepts one of the following:
"available"
"pending"
"sold"
tags?: Array<Tag>
id?: number
formatint64
name?: string
Find pet by ID.
import Barkend from 'barkend';

const client = new Barkend({
  apiKey: process.env['BARKEND_API_KEY'], // This is the default and can be omitted
});

const pet = await client.pets.retrieve(0);

console.log(pet.id);
{
  "error": {
    "id": "invalid_id",
    "message": "Invalid ID supplied"
  }
}
{
  "error": {
    "id": "not_found",
    "message": "Pet not found"
  }
}
Returns Examples
{
  "error": {
    "id": "invalid_id",
    "message": "Invalid ID supplied"
  }
}
{
  "error": {
    "id": "not_found",
    "message": "Pet not found"
  }
}