---
title: Finds Pets by status
slug: mihai-tests/finds-pets-by-status
createdAt: 2024-05-23T13:14:55.472Z
---

{
  "id": "7x5xYmCoCGcIKcqxldSB2",
  "type": "api-oas-v2",
  "data": {
    "method": "GET",
    "url": "https://petstore3.swagger.io/api/v3/pet/findByStatus",
    "servers": [
      {
        "url": "https://petstore3.swagger.io/api/v3/pet/findByStatus"
      }
    ],
    "name": "Finds Pets by status",
    "description": "Multiple status values can be provided with comma separated strings",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [],
      "queryParameters": [
        {
          "kind": "optional",
          "name": "status",
          "type": "string",
          "description": "Status values that need to be considered for filter",
          "default": "available"
        }
      ],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "successful operation",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "array",
            "customType": "Pet[]",
            "schema": [
              {
                "name": "id",
                "kind": "optional",
                "type": "integer<int64>",
                "example": 10
              },
              {
                "name": "name",
                "kind": "required",
                "type": "string",
                "example": "doggie"
              },
              {
                "name": "category",
                "kind": "optional",
                "type": "object",
                "modelRef": "#/components/schemas/Category",
                "customType": "Category",
                "schema": [
                  {
                    "name": "id",
                    "kind": "optional",
                    "type": "integer<int64>",
                    "example": 1
                  },
                  {
                    "name": "name",
                    "kind": "optional",
                    "type": "string",
                    "example": "Dogs"
                  }
                ]
              },
              {
                "name": "photoUrls",
                "kind": "required",
                "type": "array",
                "example": "",
                "itemType": "string",
                "customType": "string[]",
                "itemExample": "",
                "itemDefault": ""
              },
              {
                "name": "tags",
                "kind": "optional",
                "type": "array",
                "modelRef": "#/components/schemas/Tag",
                "customType": "Tag[]",
                "schema": [
                  {
                    "name": "id",
                    "kind": "optional",
                    "type": "integer<int64>",
                    "example": 0
                  },
                  {
                    "name": "name",
                    "kind": "optional",
                    "type": "string",
                    "example": ""
                  }
                ]
              },
              {
                "name": "status",
                "kind": "optional",
                "type": "string<available | pending | sold>",
                "description": "pet status in the store",
                "example": ""
              }
            ],
            "modelRef": "#/components/schemas/Pet",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "400",
        "description": "Invalid status value",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "examples": {
      "languages": [
        {
          "id": "D-Sbz0jWsMwx_Rk9wtQ5a",
          "language": "curl",
          "label": "cURL",
          "code": "curl --location 'https://petstore3.swagger.io/api/v3/pet/findByStatus?status=available' \\\n--header 'Accept: application/json' \\\n--header 'Content-Type: application/json'"
        },
        {
          "id": "GhRh0Cl3asBbanJ5kRE3Q",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"Accept\", \"application/json\");\nmyHeaders.append(\"Content-Type\", \"application/json\");\n\nvar requestOptions = {\n   method: 'GET',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"https://petstore3.swagger.io/api/v3/pet/findByStatus?status=available\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "2cgvZI13K0SxkE5FmiS0i",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://petstore3.swagger.io/api/v3/pet/findByStatus?status=available\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Get.new(url)\nrequest[\"Accept\"] = \"application/json\"\nrequest[\"Content-Type\"] = \"application/json\"\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "L3F-j0Q7It63WP1aTagIt",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://petstore3.swagger.io/api/v3/pet/findByStatus?status=available\"\n\npayload = {}\nheaders = {\n   'Accept': 'application/json',\n   'Content-Type': 'application/json'\n}\n\nresponse = requests.request(\"GET\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "D-Sbz0jWsMwx_Rk9wtQ5a"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "// successful operation\n[\n  {\n    \"id\": 10,\n    \"name\": \"doggie\",\n    \"category\": {\n      \"id\": 1,\n      \"name\": \"Dogs\"\n    },\n    \"photoUrls\": [\n      \"\"\n    ],\n    \"tags\": [\n      {\n        \"id\": \"\",\n        \"name\": \"\"\n      }\n    ],\n    \"status\": \"\"\n  }\n]"
        },
        {
          "id": "response-1-400",
          "language": "400",
          "code": "// Invalid status value\n"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "children": [
    {
      "id": "Kvr2BEyzHgDxbIZKUK_-M",
      "type": "paragraph",
      "children": [
        {
          "text": "Multiple status values can be provided with comma separated strings"
        }
      ]
    }
  ]
}