Swagger Petstore

Single example of Petstore API, with easy endpoints about pets. and smart usage of tags to sort and group these endpoints.

This is the documentation for version 1.0.0 of the API. Last update on Feb 24, 2021.

This API is provided under license MIT.

Base URL
http://petstore.swagger.io/v1

All pets

All pets

Query parameters
  • limit integer(int32)

    How many items to return at one time (max 100)

Responses
  • 200 array[object]

    A paged array of pets

    • x-next string

      A link to the next page of responses

    • id Required / integer(int64)
    • name Required / string
    • tag string
  • default object

    unexpected error

    • code Required / integer(int32)
    • message Required / string
GET /pets
$ curl \
 -X GET http://petstore.swagger.io/v1/pets
Response example (200)
# Headers
x-next: string

# Payload
[
  {
    "id": 42,
    "name": "string",
    "tag": "string"
  }
]
Response example (default)
{
  "code": 42,
  "message": "string"
}

Single pet

Create a pet

Responses
  • 201

    Null response

  • default object

    unexpected error

    • code Required / integer(int32)
    • message Required / string
POST /pets
$ curl \
 -X POST http://petstore.swagger.io/v1/pets
Response example (default)
{
  "code": 42,
  "message": "string"
}

Info for a specific pet

Path parameters
  • petId Required / string

    The id of the pet to retrieve

Responses
  • 200 object

    Expected response to a valid request

    • id Required / integer(int64)
    • name Required / string
    • tag string
  • default object

    unexpected error

    • code Required / integer(int32)
    • message Required / string
GET /pets/{petId}
$ curl \
 -X GET http://petstore.swagger.io/v1/pets/{petId}
Response example (200)
{
  "id": 42,
  "name": "string",
  "tag": "string"
}
Response example (default)
{
  "code": 42,
  "message": "string"
}