Swagger Petstore - OpenAPI 3.0
GET/pet/{petId}

Get a pet by ID

Retrieves one pet from the store by its numeric identifier. Use petId to identify the pet whose details you want to retrieve.

1 parameter
petIdintegerrequired
The 64-bit integer identifier of the pet to retrieve.

4 status codes
200Returns the pet object with its identifier, name, category, image URLs, tags, and store status.
idintegeroptional
namestringrequired
categoryobjectoptional
photoUrlsarray<string>required
tagsarray<object>optional
statusstringoptional
pet status in the store
Allowed:availablependingsold
400Returned when `petId` is not a valid pet identifier.
404Returned when no pet exists with the supplied `petId`.
defaultReturned when an unexpected error occurs.

Error handling

petId must be a valid 64-bit integer identifying a pet. An invalid identifier returns a 400, while an identifier for a pet that does not exist returns a 404.