--- title: GET /pet/findByStatus keywords: summary: sidebar: mydoc_sidebar permalink: api_get_pet_findbystatus.html folder: petstore toc: false swaggerfile: petstore swaggerkey: /pet/findByStatus method: get --- ## Description {% include swagger_parsers/getattribute.md attribute="summary" %} {% include swagger_parsers/getattribute.md attribute="description" %} ## Path parameters {% include swagger_parsers/getparams.md paramtype="path" %} ## Query parameters {% include swagger_parsers/getparams.md paramtype="query" %} ## Responses {% include swagger_parsers/getresponses.md %} Content types: {% include swagger_parsers/getattribute.md attribute="produces" type="list" %} ## Examples
The example below shows how to request all pets listed as available. You'll need to install the Requests library into your virtual environment (pip install requests).
import requests
import json
url = 'http://petstore.swagger.io/v2/pet/findByStatus?status=available'
response = requests.get(url).json()
To display the first three results:
>>> response[:3]
[{'id': 1116,
'category': {'id': 0, 'name': 'string'},
'name': 'doggie',
'photoUrls': ['string'],
'tags': [{'id': 0, 'name': 'string'}],
'status': 'available'},
{'id': 1427504384,
'name': 'Fido',
'photoUrls': [],
'tags': [],
'status': 'available'},
{'id': 1427504385,
'category': {'id': 0, 'name': 'Lions'},
'name': 'Simba',
'photoUrls': ['Simba-photo'],
'tags': [{'id': 0, 'name': 'Sarko'}],
'status': 'available'}]
http://petstore.swagger.io/v2/pet/findByStatus?status=available
curl -X GET "http://petstore.swagger.io/v2/pet/findByStatus?status=available" -H "accept: application/json" | python -m json.tool
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 3446k 0 3446k 0 0 5989k 0 --:--:-- --:--:-- --:--:-- 5983k
[
{
"category": {
"id": 0,
"name": "string"
},
"id": 1116,
"name": "doggie",
"photoUrls": [
"string"
],
"status": "available",
"tags": [
{
"id": 0,
"name": "string"
}
]
},
{
"id": 1427504384,
"name": "Fido",
"photoUrls": [],
"status": "available",
"tags": []
},
...