{
  "openapi": "3.0.1",
  "info": {
    "title": "Booking.com Rate & Availability Event Monitor",
    "description": "**Monitor hotel prices and availability on Booking.com — emit only acted-on events.** Detects price_drop, price_spike, sold_out, re_opened, rooms_left_low, new_listing, and Booking-vs-Kayak parity violations (≥5%). Stateful: remembers last-seen prices across runs via named KV store.",
    "version": "0.1",
    "x-build-id": "P5wAiPKR1fWRyyS38"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/bovi~booking-rate-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-bovi-booking-rate-monitor",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/bovi~booking-rate-monitor/runs": {
      "post": {
        "operationId": "runs-sync-bovi-booking-rate-monitor",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/bovi~booking-rate-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-bovi-booking-rate-monitor",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "propertyUrls": {
            "title": "Property URLs to Monitor",
            "type": "array",
            "description": "List of Booking.com hotel page URLs to monitor for price and availability changes. Example: ['https://www.booking.com/hotel/fr/paris-marriott.html']. Each URL must contain a valid Booking.com hotel ID. Monitored via AvailabilityCalendar GraphQL API — cheap (~6 requests per property per 365-day window).",
            "items": {
              "type": "string"
            }
          },
          "searches": {
            "title": "Destination Searches to Monitor",
            "type": "array",
            "description": "List of destination+date search configurations to monitor for inventory events. Each item must have 'destination' (city or region name), 'checkin' (YYYY-MM-DD), and 'checkout' (YYYY-MM-DD). Example: [{\"destination\": \"Paris\", \"checkin\": \"2026-07-01\", \"checkout\": \"2026-07-03\"}]. Uses Booking.com FullSearch GraphQL — up to 1,000 results per search.",
            "items": {
              "type": "object"
            }
          },
          "checkin": {
            "title": "Default Check-in Date",
            "type": "string",
            "description": "Default check-in date for property URL monitoring in YYYY-MM-DD format. Example: '2026-07-01'. Used as the start of the AvailabilityCalendar window. Individual searches in the 'searches' field can override this per search."
          },
          "checkout": {
            "title": "Default Check-out Date",
            "type": "string",
            "description": "Default check-out date for destination search monitoring in YYYY-MM-DD format. Example: '2026-07-03'. Must be after checkin. Individual searches in the 'searches' field can override this per search."
          },
          "amountOfDays": {
            "title": "Calendar Window (days)",
            "minimum": 1,
            "maximum": 365,
            "type": "integer",
            "description": "Number of days to scan in the AvailabilityCalendar for each property URL. Default 61 covers ~2 months in ~1 API call. Set up to 365 for a full year (splits into ~6 API calls per property). Higher values cost more compute but give wider price monitoring coverage.",
            "default": 61
          },
          "proxyConfiguration": {
            "title": "Proxy Configuration",
            "type": "object",
            "description": "Apify proxy configuration for reliable access. REQUIRED for production use — Booking.com is not reliable from datacenter IPs. Use Apify Residential proxy (useApifyProxy: true, groups: ['RESIDENTIAL']). The buyer pays proxy costs separately from PPE event charges. Without residential proxy, the actor will be rate-limited on every run."
          },
          "dropPctThreshold": {
            "title": "Price Drop Threshold (%)",
            "minimum": 0.1,
            "maximum": 100,
            "type": "number",
            "description": "Minimum percentage price decrease to trigger a 'price_drop' event. Default 5.0 means a 5% or larger drop emits an event. Smaller values (e.g. 2.0) are more sensitive and emit more events; larger values (e.g. 10.0) only catch significant drops. Revenue managers typically use 5–10%.",
            "default": 5
          },
          "spikePctThreshold": {
            "title": "Price Spike Threshold (%)",
            "minimum": 0.1,
            "maximum": 100,
            "type": "number",
            "description": "Minimum percentage price increase to trigger a 'price_spike' event. Default 5.0. Useful for monitoring competitors repricing upward, which can indicate demand increases or inventory scarcity. Setting this lower (e.g. 3.0) gives earlier warning of price trends.",
            "default": 5
          },
          "lowRoomsThreshold": {
            "title": "Low Rooms Threshold",
            "minimum": 0,
            "maximum": 20,
            "type": "integer",
            "description": "Emit a 'rooms_left_low' event when a property has this many rooms or fewer remaining. Default 3. Only emits once when rooms_left crosses below the threshold (not every run). Set to 0 to disable low-rooms alerts.",
            "default": 3
          },
          "parityThresholdPct": {
            "title": "Parity Gap Threshold (%)",
            "minimum": 0.1,
            "maximum": 100,
            "type": "number",
            "description": "Minimum Booking.com vs Kayak price gap percentage to trigger a 'parity_gap' event. Default 5.0 matches standard rate parity contract terms. Hotel chains and OTA compliance teams typically flag gaps of 5% or more as contract violations. Set higher to reduce noise on volatile markets.",
            "default": 5
          },
          "includeParityCheck": {
            "title": "Include Booking vs Kayak Parity Check",
            "type": "boolean",
            "description": "When true, fetches Kayak prices for each destination and emits 'parity_gap' events when Booking.com and Kayak prices differ by parityThresholdPct or more. Default true. Kayak is fetched without residential proxy (no extra protection). Disable if you only need Booking-internal price/availability events.",
            "default": true
          },
          "maxSearchResults": {
            "title": "Max Hotels Per Search",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum number of hotels to process per destination search. Default 100. Booking.com FullSearch returns up to 1,000 results total (25 per page); higher values increase compute cost and API calls. For narrow monitoring (a single hotel's destination), 25–50 is usually sufficient.",
            "default": 100
          },
          "runCanary": {
            "title": "Run Schema-Drift Canary",
            "type": "boolean",
            "description": "When true, runs a schema-drift canary check at startup that asserts the WAF gokuProps format, b_csrf_token regex, and GraphQL operationNames still resolve. Emits a maintenance warning if any check fails, but does NOT abort the run. Recommended: enable in scheduled daily runs to get early warning before the actor goes red.",
            "default": false
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}