find pet by id
GET
/pets/{id}
const url = 'https://petstore.swagger.io/v2/pets/1';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 https://petstore.swagger.io/v2/pets/1Returns a user based on a single ID, if the user does not have access to the pet
Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ” id
required
integer format: int64
ID of pet to fetch
Query Parameters
Section titled “Query Parameters ” age
integer format: int32
Age of pet to fetch
Responses
Section titled “ Responses ”Pet response
Media type application/json
object
name
required
string
tag
string
id
required
integer format: int64
Example generated
{ "name": "example", "tag": "example", "id": 1}default
Section titled “default ”Unexpected error
Media type application/json
object
code
required
integer format: int32
message
required
string
Example generated
{ "code": 1, "message": "example"}