The Petstore API provides a complete set of endpoints for managing your pet store. All requests should be made to the base URL with the appropriate HTTP method.
Most endpoints require an API key. Include it in your request headers:
curl -H "api_key: your-key-here" https://petstore.swagger.io/v2/pet/1Fetch a pet by ID:
const response = await fetch("/v2/pet/42");
const pet = await response.json();
console.log(pet.name); // "Rex"Add a new pet:
import requests
pet = {
"name": "Buddy",
"status": "available",
"category": {"id": 1, "name": "Dogs"}
}
response = requests.post("/v2/pet", json=pet)All responses are returned in JSON format. Error responses include a
messagefield with details.
Everything about your Pets
/pet/{petId}/uploadImage/pet/pet/pet/findByStatus/pet/findByTags/pet/{petId}/pet/{petId}/pet/{petId}Access to Petstore orders
Operations about user
/user/createWithList/user/{username}/user/{username}/user/{username}/user/login/user/logout/user/createWithArray/user