Get Pet
The Get Pet endpoint is used to retrieve information about an existing pet from the Petstore system.
This operation returns pet details based on the pet ID provided in the request path.
Endpoint
Base URL
https://petstore.swagger.io/v2/pet/{petId}
Path Parameters
| Parameter |
Type |
Required |
Description |
| petId |
integer |
Yes |
Unique identifier of the pet |
| Header |
Required |
Description |
| accept |
No |
Specifies the expected response format |
| api_key |
No |
API key used for authorized requests |
The endpoint supports the following response formats:
| Content Type |
Usage |
| application/json |
JSON response payload |
| application/xml |
XML response payload |
Sample Request
Successful Response
Response Codes
| Status Code |
Description |
| 200 |
Pet details retrieved successfully |
| 400 |
Invalid pet ID supplied |
| 404 |
Pet not found |
Error Response Example
{
"code": 404,
"type": "error",
"message": "Pet not found"
}
Notes
- The
petId value must match an existing pet record.
- Invalid or non-existing IDs may return an error response.
- JSON is the preferred response format for most integrations.
- Authentication may be required for restricted environments or protected resources.