List all pets
GET
/pets
const url = 'http://petstore.swagger.io/v1/pets';const options = {method: 'GET'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url http://petstore.swagger.io/v1/petsParameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”limit
integer format: int32
How many items to return at one time (max 100)
filters
A list of filters
object
name
string
tag
string
Responses
Section titled “Responses”A paged array of pets
Media typeapplication/json
Array<object>
object
id
required
integer format: int64
name
required
string
tag
string
Examplegenerated
[ { "id": 1, "name": "example", "tag": "example" }]Headers
Section titled “Headers”x-next
string
A link to the next page of responses
default
Section titled “default”Unexpected error
Media typeapplication/json
object
code
required
integer format: int32
message
required
string
Examplegenerated
{ "code": 1, "message": "example"}