WritedocsWritedocs

Get a pet by ID

GET/pets/{petId}

Path Parameters

petIdstringrequired

The pet's unique ID

Response

A pet

namestring
tagstring
idstring

Pet not found

errorstring
Request
curl -X GET "https://petstore.swagger.io/v2/pets/<petId>" \
  -H "X-API-Key: <X-API-Key>"
Response
{
  "name": "Rex",
  "tag": "dog",
  "id": "abc123"
}