---
title: Finds Pets by tags
slug: custom-main-prod/finds-pets-by-tags
createdAt: 2025-06-24T07:41:50.935Z
---

{
  "id": "28PLfGKF_hQTJmsKdmTlZ",
  "type": "api-oas-v2",
  "data": {
    "method": "GET",
    "url": "//petstore.swagger.io/v2/pet/findByTags",
    "servers": [
      {
        "url": "//petstore.swagger.io/v2/pet/findByTags",
        "description": "Default server"
      },
      {
        "url": "//petstore.swagger.io/sandbox/pet/findByTags",
        "description": "Sandbox server"
      }
    ],
    "name": "Finds Pets by tags",
    "description": "<p>Warning: Deprecated\nMultiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.</p>",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [],
      "queryParameters": [
        {
          "kind": "required",
          "name": "tags",
          "type": "array",
          "description": "Tags to filter by",
          "schema": [],
          "itemType": "string",
          "customType": "string[]"
        }
      ],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "successful operation",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "array",
            "description": "",
            "customType": "Pet[]",
            "schema": [
              {
                "name": "id",
                "kind": "optional",
                "type": "integer",
                "readOnly": true,
                "description": "Pet ID",
                "modelRef": "#/components/schemas/Id",
                "customType": "Id",
                "schema": []
              },
              {
                "name": "category",
                "kind": "optional",
                "type": "object",
                "description": "Categories this pet belongs to",
                "modelRef": "#/components/schemas/Category",
                "customType": "Category",
                "schema": [
                  {
                    "name": "id",
                    "kind": "optional",
                    "type": "integer",
                    "readOnly": true,
                    "description": "Category ID",
                    "modelRef": "#/components/schemas/Id",
                    "customType": "Id",
                    "schema": []
                  },
                  {
                    "name": "name",
                    "kind": "optional",
                    "type": "string",
                    "description": "Category name",
                    "example": ""
                  },
                  {
                    "name": "sub",
                    "kind": "optional",
                    "type": "object",
                    "description": "Test Sub Category",
                    "example": "",
                    "schema": [
                      {
                        "name": "prop1",
                        "kind": "optional",
                        "type": "string",
                        "description": "Dumb Property",
                        "example": ""
                      }
                    ]
                  }
                ]
              },
              {
                "name": "name",
                "kind": "required",
                "type": "string",
                "description": "The name given to a pet",
                "example": "GuruIsExample",
                "default": "FluffyIsDefault"
              },
              {
                "name": "photoUrls",
                "kind": "required",
                "type": "string,integer,null",
                "description": "The list of URL to a cute photos featuring pet",
                "example": ""
              },
              {
                "name": "friend",
                "kind": "optional",
                "type": "object",
                "description": "",
                "modelRef": "#/components/schemas/Pet",
                "customType": "Pet",
                "schema": [
                  {
                    "name": "",
                    "description": "",
                    "customType": "Circular-Reference"
                  }
                ]
              },
              {
                "name": "tags",
                "kind": "optional",
                "type": "array",
                "description": "Tags attached to the pet",
                "modelRef": "#/components/schemas/Tag",
                "customType": "Tag[]",
                "schema": [
                  {
                    "name": "id",
                    "kind": "optional",
                    "type": "integer",
                    "readOnly": true,
                    "description": "Tag ID",
                    "modelRef": "#/components/schemas/Id",
                    "customType": "Id",
                    "schema": []
                  },
                  {
                    "name": "name",
                    "kind": "optional",
                    "type": "string",
                    "description": "Tag name",
                    "example": ""
                  }
                ]
              },
              {
                "name": "status",
                "kind": "optional",
                "type": "string<available | pending | sold>",
                "description": "Pet status in the store",
                "example": "",
                "default": "pending"
              },
              {
                "name": "petType",
                "kind": "optional",
                "type": "string",
                "description": "Type of a pet",
                "example": "k9"
              },
              {
                "name": "huntingSkill",
                "kind": "optional",
                "type": "integer",
                "example": ""
              }
            ],
            "modelRef": "#/components/schemas/Pet",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "400",
        "description": "Invalid tag value",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false,
    "deprecated": true,
    "examples": {
      "languages": [
        {
          "id": "example-0-curl",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request GET \\\n     --url '//petstore.swagger.io/v2/pet/findByTags?tags=array' \\\n     --header 'accept: application/json'"
        },
        {
          "id": "example-1-javascript",
          "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(\"//petstore.swagger.io/v2/pet/findByTags?tags=array\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "example-2-ruby",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"//petstore.swagger.io/v2/pet/findByTags?tags=array\")\n\nhttp = Net::HTTP.new(url.host, url.port);\nrequest = Net::HTTP::Get.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\n\nresponse = http.request(request)\nputs response.read_body\n"
        },
        {
          "id": "example-3-python",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"//petstore.swagger.io/v2/pet/findByTags?tags=array\"\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": "example-0-curl"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "// successful operation\n[\n  {\n    \"id\": 0,\n    \"category\": {\n      \"id\": 0,\n      \"name\": \"\",\n      \"sub\": {\n        \"prop1\": \"\"\n      }\n    },\n    \"name\": \"GuruIsExample\",\n    \"photoUrls\": \"\",\n    \"friend\": {\n      \"\": \"\"\n    },\n    \"tags\": [\n      {\n        \"id\": 0,\n        \"name\": \"\"\n      }\n    ],\n    \"status\": \"\",\n    \"petType\": \"k9\",\n    \"huntingSkill\": 0\n  }\n]"
        },
        {
          "id": "response-1-400",
          "language": "400",
          "code": "// Invalid tag value\n"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "children": [
    {
      "id": "ojCkIKxNXZY5RM7fpnitA",
      "type": "paragraph",
      "children": [
        {
          "text": "Warning: Deprecated\nMultiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing."
        }
      ]
    }
  ]
}