Modern PetstoreAPI Docs
HomeGuidesModern PetstoreAPI
Classic PetstoreAPI
HomeGuidesModern PetstoreAPI
Classic PetstoreAPI
  1. Pet
  • Pet
    • Get Pet
      GET
    • Update Pet
      PUT
    • Delete Pet
      DELETE
    • Create Pet
      POST
    • List Pets
      GET
    • Advanced Pet Search (QUERY method)
      QUERY
    • Upload Pet Image
      POST
  • Chat
    • Pet Care AI Consultation
      POST
  • Payments
    • Pay Order
      POST
  • Store
    • Get Store Inventory
      GET
    • Create Order
      POST
    • Get Order
      GET
    • Cancel Order
      DELETE
    • Callback Example
      POST
  • User
    • Create User
      POST
    • Update User
      PUT
    • Get User
      GET
    • Delete User Account
      DELETE
    • Create Authentication Token
      POST
  • Webhooks
    • Order Status Changed Event
    • Payment Succeeded Event
  • Schemas
    • Pet
    • PetCollection
    • User
    • OrderPayment
    • Bank Card
    • Bank Account
    • Category
    • Links
    • Order
    • ApiResponse
    • Tag
    • Error
HomeGuidesModern PetstoreAPI
Classic PetstoreAPI
HomeGuidesModern PetstoreAPI
Classic PetstoreAPI
  1. Pet

Advanced Pet Search (QUERY method)

QUERY
https://api.petstoreapi.com/v1/pets
Perform complex pet searches using the QUERY HTTP method (RFC draft-ietf-httpbis-safe-method-w-body). Unlike GET, this allows sending structured search criteria in the request body while maintaining safe, idempotent semantics.

Why QUERY?#

The QUERY method is ideal for:
Complex queries that exceed URL length limits
Structured search criteria better expressed in JSON
Safe operations that don't modify resources
Cacheable results like GET requests

Use Cases#

Multi-criteria searches (medical history, temperament, location)
Saved search queries reused programmatically
Advanced filtering with nested conditions
This endpoint returns the same response format as GET /pets but accepts complex search criteria in the body.

Request

Authorization
JWT Bearer
Add the parameter
Authorization
to Headers
Example:
Authorization: ********************
or
OAuth 2.0
Authorization Code
deviceCode
Add the parameter
Authorization
to Headers
,whose value is to concatenate the Token after the Bearer.
Example:
Authorization: Bearer ********************
Authorize URL: https://auth.petstoreapi.com/authorize
Token URL: https://auth.petstoreapi.com/token
Refresh URL: https://auth.petstoreapi.com/refresh
or
Header Params

Body Params application/jsonRequired

Examples

Responses

🟢200
application/json
Search results
Headers

Body

Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request QUERY 'https://api.petstoreapi.com/v1/pets' \
--header 'X-Tenant-ID: 550e8400-e29b-41d4-a716-446655440000' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "criteria": {
        "species": [
            "DOG"
        ],
        "ageRange": {
            "min": 12,
            "max": 72
        },
        "size": [
            "medium",
            "large"
        ],
        "compatibility": {
            "goodWithKids": true
        },
        "medical": {
            "vaccinated": true,
            "spayedNeutered": true
        }
    },
    "sort": {
        "field": "age_months",
        "order": "asc"
    },
    "pagination": {
        "page": 1,
        "limit": 20
    }
}'
Response Response Example
{
    "data": [
        {
            "id": "019b4132-70aa-764f-b315-e2803d882a24",
            "species": "DOG",
            "name": "Whiskers",
            "breed": "Domestic Shorthair",
            "ageMonths": 18,
            "size": "SMALL",
            "color": "Orange Tabby",
            "gender": "MALE",
            "goodWithKids": true,
            "price": "75.00",
            "currency": "USD",
            "description": "string",
            "status": "AVAILABLE",
            "createdAt": "2025-12-21T13:56:23Z",
            "updatedAt": "2025-12-21T13:56:23Z",
            "tenantId": "550e8400-e29b-41d4-a716-446655440000",
            "photos": [
                "http://example.com"
            ],
            "medicalInfo": {
                "spayedNeutered": true,
                "vaccinated": true,
                "microchipped": true,
                "specialNeeds": true,
                "healthNotes": "string"
            }
        }
    ],
    "pagination": {}
}
Modified at 2026-02-11 13:45:42
Previous
List Pets
Next
Upload Pet Image
Built with