{
  "openapi": "3.1.0",
  "info": {
    "title": "hyralada.se API",
    "version": "0.1.0",
    "description": "Läs-API för lador, logar och gårdar att hyra för bröllop och fest i Sverige. Samma verktyg finns som MCP-server på https://hyralada.se/mcp. Alla uppgifter är kända (med källa och datum) eller \"unknown\".",
    "contact": {
      "email": "hej@hyralada.se"
    }
  },
  "servers": [
    {
      "url": "https://hyralada.se/api/v1"
    }
  ],
  "paths": {
    "/venues": {
      "get": {
        "operationId": "search_venues",
        "summary": "Sök lador",
        "description": "Search Swedish barns, lofts and farms for rent for weddings and parties. Filter by province (landskap), locality or distance, guest count, own drinks, winter use and overnight stay. With date and guests every result includes an estimated total cost in SEK. Facts that are unknown are never treated as a match; `excludedBecauseUnknown` tells how many venues were left out for that reason. Content is in Swedish.",
        "parameters": [
          {
            "name": "landskap",
            "in": "query",
            "required": false,
            "description": "Province slug, e.g. \"skane\", \"uppland\", \"gotland\"",
            "schema": {
              "type": "string",
              "enum": [
                "skane",
                "blekinge",
                "halland",
                "smaland",
                "oland",
                "gotland",
                "vastergotland",
                "bohuslan",
                "dalsland",
                "ostergotland",
                "sodermanland",
                "narke",
                "varmland",
                "vastmanland",
                "uppland",
                "dalarna",
                "gastrikland",
                "halsingland",
                "harjedalen",
                "jamtland",
                "medelpad",
                "angermanland",
                "vasterbotten",
                "norrbotten",
                "lappland"
              ]
            }
          },
          {
            "name": "place",
            "in": "query",
            "required": false,
            "description": "Locality slug, e.g. \"lovestad\"",
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
            }
          },
          {
            "name": "lat",
            "in": "query",
            "required": false,
            "description": "Search centre latitude (WGS84)",
            "schema": {
              "type": "number",
              "minimum": 55,
              "maximum": 69.1
            }
          },
          {
            "name": "lng",
            "in": "query",
            "required": false,
            "description": "Search centre longitude (WGS84)",
            "schema": {
              "type": "number",
              "minimum": 10.9,
              "maximum": 24.2
            }
          },
          {
            "name": "radiusKm",
            "in": "query",
            "required": false,
            "description": "Radius around lat/lng, default 50 km",
            "schema": {
              "type": "number",
              "exclusiveMinimum": 0,
              "maximum": 500
            }
          },
          {
            "name": "date",
            "in": "query",
            "required": false,
            "description": "Event date YYYY-MM-DD. With guests, results get an estimated total",
            "schema": {
              "type": "string",
              "format": "date",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
            }
          },
          {
            "name": "guests",
            "in": "query",
            "required": false,
            "description": "Number of guests at a seated dinner",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000
            }
          },
          {
            "name": "ownAlcohol",
            "in": "query",
            "required": false,
            "description": "true = must allow bringing your own drinks (corkage fee allowed)",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "winter",
            "in": "query",
            "required": false,
            "description": "true = must be usable in winter",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "overnight",
            "in": "query",
            "required": false,
            "description": "true = beds on site or accommodation within 10 km",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "maxTotalSek",
            "in": "query",
            "required": false,
            "description": "Max total in SEK; compared with the estimate if date and guests are given, else with the from-price",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 10,
              "type": "integer",
              "minimum": 1,
              "maximum": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Ogiltiga parametrar",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Ladan finns inte",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/venues/{slug}": {
      "get": {
        "operationId": "get_venue",
        "summary": "Hämta faktablad",
        "description": "Get the full, standardised fact sheet for one venue: capacity, season, facilities, rules (own drinks, own food, music end time), all price periods and addons, overnight options, location and honest caveats. Every fact is either known, with source and verification date, or \"unknown\". Facts without their own `source` inherit `provenance`. Cite `links.page` and `provenance.verifiedAt` when you use the data.",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "Venue slug from search_venues",
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Ogiltiga parametrar",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Ladan finns inte",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/venues/{slug}/estimate": {
      "get": {
        "operationId": "estimate_cost",
        "summary": "Räkna ut totalkostnad",
        "description": "Estimate the total cost in SEK (incl. VAT when known) for renting a venue on a date for a number of guests, with optional addons. Returns a range when something is uncertain, line items, what is included, mandatory addons, deposit, and lists of unknowns and warnings. Never present the estimate as a binding quote.",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "Venue slug",
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
            }
          },
          {
            "name": "date",
            "in": "query",
            "required": true,
            "description": "Event date YYYY-MM-DD",
            "schema": {
              "type": "string",
              "format": "date",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
            }
          },
          {
            "name": "guests",
            "in": "query",
            "required": true,
            "description": "Number of guests",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000
            }
          },
          {
            "name": "addons",
            "in": "query",
            "required": false,
            "description": "Kommaseparerade tillägg, med valfritt antal efter kolon: \"vard-pa-plats:6,porslin-glas\"",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Ogiltiga parametrar",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Ladan finns inte",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "code",
              "message"
            ],
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "issues": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    }
  }
}