Skip to content
pets

List pets

On this page
GET /pets
Production: https://petstore.example.com/v1Sandbox: https://sandbox.petstore.example.com/v1Live demo on docvia.dev; accepts any token: /api/petstore/v1

Returns pets in the order they were listed, newest first. Results are paginated with a cursor: pass the nextCursor of one page as cursor to get the next.

curl 'https://petstore.example.com/v1/pets?species=dog&limit=20' \
  --header 'Authorization: Bearer <token>'
Try it Sent from your browser; this site proxies the spec's own servers. Open in workspace
GET /api/petstore/v1/pets?species=dog&limit=20

/api/petstore/v1

Kept in memory for this visit and used on every page of this API; never saved.

Query

Authorization

bearerAuth JWT bearer token in the Authorization header

A token from the dashboard's API keys page.

Query parameters

species string

Only return pets of this species.

One of dog cat bird rabbit
limit integer

Maximum number of pets to return.

Default 20 >= 1<= 100
cursor string

Cursor from a previous response.

Responses

A page of pets.

Headers
X-RateLimit-Remaining integer

Requests left in the current window.

Response application/json
data array<Pet> required
id integer<int64> required read-only
status string required
One of available pending adopted archived
createdAt string<date-time> required read-only
name string required

Display name.

min length 1max length 64
species string required
One of dog cat bird rabbit
birthDate string<date>
tags array<string>
microchip Microchip | null

Identification, when the pet has one.

Exactly one of

id string required

The 15-digit ISO 11784 number.

pattern ^[0-9]{15}$
vendor string
nextCursor string | null

Pass as cursor for the next page; null on the last page.

Example
{
  "data": [
    {
      "id": 1042,
      "status": "available",
      "createdAt": "2024-01-01T12:00:00Z",
      "name": "Rex",
      "species": "dog",
      "birthDate": "2024-01-01",
      "tags": [
        "string"
      ],
      "microchip": {
        "id": "string",
        "vendor": "string"
      }
    }
  ],
  "nextCursor": "string"
}