{
 "openapi": "3.1.0",
 "info": {
  "title": "Sunny Orange Stays rentals API",
  "version": "1.0.0",
  "description": "Public, read-only API for AI agents and bots. List Sunny Orange Stays vacation rentals (Clearwater Beach and the Florida Gulf Coast), read each rental's details and per-night calendar, and get an all-in quote for exact dates with a checkout_url to give the guest. No authentication. Every endpoint also answers in Markdown with ?format=md. Same-day check-in cannot be booked online: call or text (727) 449-2700.",
  "contact": {
   "name": "Sunny Orange Stays",
   "url": "https://sunnyorangestays.com/contact/",
   "email": "hello@sunnyorangestays.com"
  }
 },
 "servers": [
  {
   "url": "https://sunnyorangestays.com"
  }
 ],
 "paths": {
  "/api/rentals": {
   "get": {
    "operationId": "listRentals",
    "summary": "Every rental with bedrooms, bathrooms, sleeps, pets, base nightly from-rate, minimum stay now, next available night and links.",
    "parameters": [
     {
      "$ref": "#/components/parameters/format"
     }
    ],
    "responses": {
     "200": {
      "description": "Rentals",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/RentalList"
        }
       },
       "text/markdown": {}
      }
     }
    }
   }
  },
  "/api/rentals/{slug}": {
   "get": {
    "operationId": "getRental",
    "summary": "Full details of one rental: description, highlights, amenities, rooms, policies, photos and a per-night calendar (available or booked, base nightly rate, minimum nights if arriving that day).",
    "parameters": [
     {
      "name": "slug",
      "in": "path",
      "required": true,
      "description": "Rental slug (from listRentals) or numeric id.",
      "schema": {
       "type": "string"
      },
      "example": "1018-bay-esplanade"
     },
     {
      "$ref": "#/components/parameters/format"
     }
    ],
    "responses": {
     "200": {
      "description": "Rental",
      "content": {
       "application/json": {},
       "text/markdown": {}
      }
     },
     "404": {
      "description": "Unknown rental"
     }
    }
   }
  },
  "/api/quote": {
   "get": {
    "operationId": "getQuote",
    "summary": "All-in price for exact dates (accommodation + mandatory fees + taxes) and the checkout_url to send the guest to. If the stay is not possible, available=false with reasons (booked nights, minimum stay, too many guests) and the next available night.",
    "parameters": [
     {
      "name": "rental",
      "in": "query",
      "required": true,
      "description": "Rental slug or id.",
      "schema": {
       "type": "string"
      },
      "example": "sunset-corner"
     },
     {
      "name": "checkin",
      "in": "query",
      "required": true,
      "description": "Check-in date, YYYY-MM-DD.",
      "schema": {
       "type": "string",
       "format": "date"
      }
     },
     {
      "name": "checkout",
      "in": "query",
      "required": true,
      "description": "Check-out date, YYYY-MM-DD.",
      "schema": {
       "type": "string",
       "format": "date"
      }
     },
     {
      "name": "guests",
      "in": "query",
      "required": false,
      "description": "Number of guests (default 2).",
      "schema": {
       "type": "integer",
       "minimum": 1
      }
     },
     {
      "$ref": "#/components/parameters/format"
     }
    ],
    "responses": {
     "200": {
      "description": "Quote",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Quote"
        }
       },
       "text/markdown": {}
      }
     }
    }
   }
  },
  "/availability/": {
   "get": {
    "operationId": "searchByDates",
    "summary": "Every rental available for the dates and party size, cheapest first, with all-in totals and booking links.",
    "parameters": [
     {
      "name": "checkin",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "format": "date"
      }
     },
     {
      "name": "checkout",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "format": "date"
      }
     },
     {
      "name": "guests",
      "in": "query",
      "schema": {
       "type": "integer",
       "minimum": 1
      }
     },
     {
      "name": "area",
      "in": "query",
      "description": "Town slug, e.g. clearwater-beach, treasure-island, indian-rocks-beach.",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "format",
      "in": "query",
      "schema": {
       "type": "string",
       "enum": [
        "json",
        "txt"
       ]
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Available rentals"
     }
    }
   }
  }
 },
 "components": {
  "parameters": {
   "format": {
    "name": "format",
    "in": "query",
    "required": false,
    "description": "md for Markdown instead of JSON.",
    "schema": {
     "type": "string",
     "enum": [
      "md"
     ]
    }
   }
  },
  "schemas": {
   "RentalSummary": {
    "type": "object",
    "properties": {
     "id": {
      "type": "integer"
     },
     "slug": {
      "type": "string"
     },
     "name": {
      "type": "string"
     },
     "area": {
      "type": "string"
     },
     "bedrooms": {
      "type": "integer"
     },
     "bathrooms": {
      "type": "number"
     },
     "sleeps": {
      "type": "integer"
     },
     "pets_allowed": {
      "type": "boolean"
     },
     "from_nightly_base_usd": {
      "type": [
       "number",
       "null"
      ]
     },
     "min_nights_now": {
      "type": "integer"
     },
     "next_available": {
      "type": [
       "string",
       "null"
      ],
      "format": "date"
     },
     "listing_url": {
      "type": "string",
      "format": "uri"
     },
     "details_url": {
      "type": "string",
      "format": "uri"
     },
     "quote_url_template": {
      "type": "string"
     }
    }
   },
   "RentalList": {
    "type": "object",
    "properties": {
     "ok": {
      "type": "boolean"
     },
     "count": {
      "type": "integer"
     },
     "rentals": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/RentalSummary"
      }
     }
    }
   },
   "Quote": {
    "type": "object",
    "properties": {
     "ok": {
      "type": "boolean"
     },
     "available": {
      "type": "boolean"
     },
     "reasons": {
      "type": "array",
      "items": {
       "type": "string"
      }
     },
     "stay": {
      "type": "object",
      "properties": {
       "checkin": {
        "type": "string",
        "format": "date"
       },
       "checkout": {
        "type": "string",
        "format": "date"
       },
       "nights": {
        "type": "integer"
       },
       "guests": {
        "type": "integer"
       }
      }
     },
     "price": {
      "type": "object",
      "properties": {
       "accommodation": {
        "type": "number"
       },
       "fees": {
        "type": "number"
       },
       "taxes": {
        "type": "number"
       },
       "total": {
        "type": "number"
       },
       "average_per_night_all_in": {
        "type": "number"
       },
       "accommodation_estimate": {
        "type": "number"
       },
       "note": {
        "type": "string"
       }
      }
     },
     "checkout_url": {
      "type": "string",
      "format": "uri",
      "description": "Give this link to the guest: it opens checkout with the rental, dates and guests filled in."
     }
    }
   }
  }
 }
}