# Get a pet by ID

**GET** `/pets/{petId}`

Base URL: `https://petstore.swagger.io/v2`

Get a pet by ID

## Authorization

- X-API-Key (apiKey in header)

## Path parameters

- `petId` (string, required)
  The pet's unique ID

## Responses

### 200

A pet

- `name` (string, required)
- `tag` (string)
- `id` (string)

Example:

```json
{
  "name": "Rex",
  "tag": "dog",
  "id": "abc123"
}
```

### 404

Pet not found

- `error` (string)

Example:

```json
{
  "error": "Pet not found"
}
```