# Find pet by ID.

Returns a single pet.

[Find pet by ID.](https://clay-doc.github.io/clay-example-repo/api/petstore/pet/get-pet-by-id.md)

```sh
curl 'https://petstore3.swagger.io/api/v3/pet/0' \
  -H 'api_key: <api_key>'
```
## Authentication

Requests need one of these:

::: fields
- `api_key`

  [API key in the header `api_key`](https://clay-doc.github.io/clay-example-repo/api/petstore.md#authentication)
- `petstore_auth` *write:pets* *read:pets*

  [OAuth 2.0](https://clay-doc.github.io/clay-example-repo/api/petstore.md#authentication)
:::

## Parameters

::: fields
- `petId` integer (int64) **required** *path*

  ID of pet to return
:::

## Responses

::: tabs status
== 200

successful operation

:badge[application/json]{note} :badge[application/xml]{note} · Type: [Pet](https://clay-doc.github.io/clay-example-repo/api/petstore/schemas/pet.md)

::: fields
- `id` integer (int64)
- `name` string **required**
- `category` [Category](https://clay-doc.github.io/clay-example-repo/api/petstore/schemas/category.md)
- `photoUrls` array of string **required**
- `tags` array of [Tag](https://clay-doc.github.io/clay-example-repo/api/petstore/schemas/tag.md)
- `status` string

  pet status in the store

  Allowed values: `"available"`, `"pending"`, `"sold"`
:::

::: code-group
```json [application/json]
{
  "id": 10,
  "name": "doggie",
  "category": {
    "id": 1,
    "name": "Dogs"
  },
  "photoUrls": [
    "string"
  ],
  "tags": [
    {
      "id": 0,
      "name": "string"
    }
  ],
  "status": "available"
}
```
```xml [application/xml]
<pet>
  <id>10</id>
  <name>doggie</name>
  <category>
    <id>1</id>
    <name>Dogs</name>
  </category>
  <photoUrls>
    <photoUrl>string</photoUrl>
  </photoUrls>
  <tags>
    <tag>
      <id>0</id>
      <name>string</name>
    </tag>
  </tags>
  <status>available</status>
</pet>
```
:::

== 400

Invalid ID supplied

== 404

Pet not found

== default

Unexpected error
:::

---

All pages of these docs, as Markdown for language models: https://clay-doc.github.io/clay-example-repo/llms.txt
