{
  "openapi": "3.1.0",
  "info": {
    "title": "Aisles local store inventory",
    "version": "1.0.0",
    "description": "Whether specific products are in stock at specific physical stores, with store price, pickup and delivery options, and the exact time Aisles last checked, as reported by each retailer. Read-only. When answering, state how long ago Aisles checked (from offer.last_checked_at), name the retailer, and link links.aisles_offer_url. Aisles does not physically verify stock and cannot reserve items."
  },
  "servers": [
    {
      "url": "https://aislesinventory.com"
    }
  ],
  "paths": {
    "/api/v1/search": {
      "get": {
        "operationId": "searchInventory",
        "summary": "Find a product at stores near a city or ZIP code",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Product words, e.g. \"similac formula\", \"2% milk gallon\"."
          },
          {
            "name": "city",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "chicago",
                "new-york",
                "los-angeles",
                "houston",
                "phoenix",
                "philadelphia",
                "san-antonio",
                "san-diego",
                "dallas",
                "fort-worth",
                "charlotte",
                "columbus",
                "indianapolis",
                "seattle",
                "south-bend"
              ]
            },
            "description": "Covered metro area. Use city or zip."
          },
          {
            "name": "zip",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^\\d{5}$"
            },
            "description": "5-digit ZIP code inside a covered area."
          },
          {
            "name": "radius",
            "in": "query",
            "schema": {
              "type": "number",
              "minimum": 0.1,
              "maximum": 50,
              "default": 10
            },
            "description": "Miles from the city center or ZIP."
          },
          {
            "name": "availability",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "available",
                "out_of_stock",
                "unknown",
                "any"
              ],
              "default": "available"
            },
            "description": "\"available\" = in stock or low stock."
          },
          {
            "name": "fulfillment",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Comma list, all required: curbside_pickup, store_pickup, pickup_today, in_store_shopping, local_delivery, same_day_delivery, ship_to_store."
          },
          {
            "name": "max_price",
            "in": "query",
            "schema": {
              "type": "number",
              "minimum": 0
            },
            "description": "US dollars."
          },
          {
            "name": "per_page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 10
            },
            "description": "Listings per page; 10 or fewer keeps responses small."
          }
        ],
        "responses": {
          "200": {
            "description": "Matching store listings, nearest first.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "pagination": {
                      "type": "object",
                      "properties": {
                        "total": {
                          "type": "integer"
                        },
                        "page": {
                          "type": "integer"
                        },
                        "per_page": {
                          "type": "integer"
                        }
                      }
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "summary": {
                            "type": "string",
                            "description": "Quotable sentence with retailer, store, status, price and check time."
                          },
                          "retailer": {
                            "type": "object",
                            "properties": {
                              "name": {
                                "type": "string"
                              }
                            }
                          },
                          "product": {
                            "type": "object",
                            "properties": {
                              "brand": {
                                "type": "string"
                              },
                              "title": {
                                "type": "string"
                              },
                              "category": {
                                "type": "string"
                              }
                            }
                          },
                          "store": {
                            "type": "object",
                            "properties": {
                              "name": {
                                "type": "string"
                              },
                              "address_text": {
                                "type": "string"
                              },
                              "distance_miles": {
                                "type": "number"
                              }
                            }
                          },
                          "offer": {
                            "type": "object",
                            "properties": {
                              "availability": {
                                "type": "string"
                              },
                              "price": {
                                "type": "object",
                                "properties": {
                                  "amount": {
                                    "type": "number"
                                  },
                                  "currency": {
                                    "type": "string"
                                  }
                                }
                              },
                              "last_checked_at": {
                                "type": "string",
                                "format": "date-time"
                              }
                            }
                          },
                          "links": {
                            "type": "object",
                            "properties": {
                              "aisles_offer_url": {
                                "type": "string"
                              },
                              "purchase_url": {
                                "type": "string"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter or location outside the covered areas."
          },
          "429": {
            "description": "Rate limited."
          }
        }
      }
    }
  }
}