{
  "openapi": "3.1.0",
  "info": {
    "title": "Il Vino Bello open data API",
    "version": "1.0.0",
    "description": "Read-only JSON access to Il Vino Bello, your one-stop shop for the wines of Piemonte: Piemonte (Italy) wineries, wines and editorial. No authentication. Please cite https://ilvinobello.com when using the data."
  },
  "servers": [
    {
      "url": "https://ilvinobello.com"
    }
  ],
  "paths": {
    "/api/search": {
      "get": {
        "operationId": "search",
        "summary": "Search wineries and wines",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Search words, e.g. \"barolo brunate\""
          },
          {
            "name": "type",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "all",
                "winery",
                "wine"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "maximum": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Matches"
          }
        }
      }
    },
    "/api/wineries": {
      "get": {
        "operationId": "listWineries",
        "summary": "List wineries",
        "parameters": [
          {
            "name": "sub_region",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "curated",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "tastings",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "tours",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "maximum": 100
            }
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Wineries"
          }
        }
      }
    },
    "/api/wineries/{slug}": {
      "get": {
        "operationId": "getWinery",
        "summary": "Winery profile with its wines",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Winery"
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/api/wines": {
      "get": {
        "operationId": "listWines",
        "summary": "List wines",
        "parameters": [
          {
            "name": "denomination",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "grape",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "type",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "winery",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Winery slug"
          },
          {
            "name": "sub_region",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "maximum": 100
            }
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Wines"
          }
        }
      }
    },
    "/api/wines/{slug}": {
      "get": {
        "operationId": "getWine",
        "summary": "Wine details",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Wine"
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/api/sub-regions": {
      "get": {
        "operationId": "listSubRegions",
        "summary": "Piemonte sub-regions with winery counts",
        "responses": {
          "200": {
            "description": "Sub-regions"
          }
        }
      }
    },
    "/api/editorial": {
      "get": {
        "operationId": "listEditorial",
        "summary": "Latest editorial",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "maximum": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Articles"
          }
        }
      }
    }
  }
}