Info for a specific pet
GET
/pets/{petId}
const url = 'http://petstore.swagger.io/v1/pets/example';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/pets/exampleParameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”petId
required
string
The id of the pet to retrieve
Responses
Section titled “Responses”Expected response to a valid request
Media typeapplication/json
object
id
required
integer format: int64
name
required
string
tag
string
Examplegenerated
{ "id": 1, "name": "example", "tag": "example"}default
Section titled “default”Unexpected error
Media typeapplication/json
object
code
required
integer format: int32
message
required
string
Examplegenerated
{ "code": 1, "message": "example"}