---
title: Find pet by ID.
description: Returns a single pet.
url: "https://cbotai.shahrear.msf.bd/docs/find-pet-by-id/"
updated: "2026-08-16"
category: Full setup / pet
---

# Find pet by ID.

GET`/pet/{petId}`

## Code Samples

```curl

                curl --request GET \
  --url '/api/v3/pet/{petId}' \
  --header 'api_key: YOUR_API_KEY'

                const response = await fetch('/api/v3/pet/{petId}', {
  method: 'GET',
  headers: {
    'api_key': 'YOUR_API_KEY'
  }
});

const data = await response.json();
console.log(data);

                import requests

headers = {
    "api_key": "YOUR_API_KEY"
}

response = requests.get("/api/v3/pet/{petId}", headers=headers)

print(response.json())

                <?php
$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => '/api/v3/pet/{petId}',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => [
  'api_key: YOUR_API_KEY'
  ],
]);

$response = curl_exec($curl);
curl_close($curl);

echo $response;

                using System.Net.Http;

var client = new HttpClient();
var request = new HttpRequestMessage(new HttpMethod("GET"), "/api/v3/pet/{petId}");
request.Headers.Add("api_key", "YOUR_API_KEY");
var response = await client.SendAsync(request);
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);

                import java.net.URI;
import java.net.http.*;

HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("/api/v3/pet/{petId}"))
    .header("api_key", "YOUR_API_KEY")
    .method("GET", HttpRequest.BodyPublishers.noBody())
    .build();

HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
```

Returns [A](https://cbotai.shahrear.msf.bd/encyclopedia/a/) single pet.

## Path Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `petId` | integer (int64) | **Required** | ID of pet to return |

## Responses

### 200 — successful operation

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer (int64) | Optional |  |
| `name` | string | **Required** |  |
| `category` | object | Optional |  |
| `category.id` | integer (int64) | Optional |  |
| `category.name` | string | Optional |  |
| `photoUrls` | array of string | **Required** |  |
| `tags` | array of object | Optional |  |
| `status` | string | Optional | pet status in the store Allowed: available, pending, sold |

```json

                {
    "id": 10,
    "name": "doggie",
    "category": {
        "id": 1,
        "name": "Dogs"
    },
    "photoUrls": [
        "string"
    ],
    "tags": [
        {
            "id": 1,
            "name": "string"
        }
    ],
    "status": "available"
}
```

### 400 — Invalid ID supplied

### 404 — Pet not found

### default — Unexpected error

## Response

```
200
{
    "id": 10,
    "name": "doggie",
    "category": {
        "id": 1,
        "name": "Dogs"
    },
    "photoUrls": [
        "string"
    ],
    "tags": [
        {
            "id": 1,
            "name": "string"
        }
    ],
    "status": "available"
}
```
