{
  "openapi": "3.0.1",
  "info": {
    "title": "Agoda Hotel Prices Scraper: Stays by Date",
    "description": "Agoda scraper for hotel prices over a grid of stays. Give destinations, check-in dates and stay lengths, get one row per property and stay: price of the whole booking and of one night, with and without taxes, struck-through price, free cancellation, rooms left, review score, search rank.",
    "version": "0.1",
    "x-build-id": "TdI4MjTeZ7Z6npoZP"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/mrbridge~agoda-hotel-prices-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-mrbridge-agoda-hotel-prices-scraper",
        "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/mrbridge~agoda-hotel-prices-scraper/runs": {
      "post": {
        "operationId": "runs-sync-mrbridge-agoda-hotel-prices-scraper",
        "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/mrbridge~agoda-hotel-prices-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-mrbridge-agoda-hotel-prices-scraper",
        "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": {
          "destinations": {
            "title": "Destinations",
            "maxItems": 10,
            "type": "array",
            "description": "City names as typed in the Agoda search box, 1 to 10. Each one is resolved to the first city Agoda suggests, then searched at every check-in date and length of stay below. When a name matches cities in several countries, the run log names the other countries: add the country to the name to choose another one. Check destinationResolved in the rows.",
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "Search URLs",
            "maxItems": 20,
            "type": "array",
            "description": "Agoda search pages (https://www.agoda.com/search), 1 to 20, with city, checkIn and los (or checkOut) in the URL. Each URL is one stay: its own dates and occupancy. The check-in dates and lengths of stay below do not apply to them, and the currency below replaces the one of the URL.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "checkInDates": {
            "title": "Check-in dates",
            "maxItems": 30,
            "type": "array",
            "description": "Required with destinations, 1 to 30 dates. Each date is YYYY-MM-DD or +N for N days after the day of the run (UTC), for example +30. A date in the past, or more than 500 days after the day of the run (+0 to +500), stops the run with an input error.",
            "items": {
              "type": "string"
            }
          },
          "nights": {
            "title": "Lengths of stay (nights)",
            "minItems": 1,
            "maxItems": 3,
            "type": "array",
            "description": "1 to 3 lengths of stay, each from 1 to 30 nights. Every check-in date is searched with every length.",
            "default": [
              1
            ]
          },
          "adults": {
            "title": "Adults",
            "minimum": 1,
            "maximum": 30,
            "type": "integer",
            "description": "Adults of the stay, from 1 to 30.",
            "default": 2
          },
          "childrenAges": {
            "title": "Children ages",
            "maxItems": 10,
            "type": "array",
            "description": "The age of each child on the check-in day, 0 to 17, at most 10 children. Empty for no child.",
            "default": []
          },
          "rooms": {
            "title": "Rooms",
            "minimum": 1,
            "maximum": 30,
            "type": "integer",
            "description": "Rooms of the stay, from 1 to 30, at most one per adult.",
            "default": 1
          },
          "currency": {
            "title": "Currency",
            "enum": [
              "USD",
              "EUR"
            ],
            "type": "string",
            "description": "Currency of the prices. If Agoda renders another one, the rows keep the currency it rendered and the run log says so.",
            "default": "USD"
          },
          "sortOrders": {
            "title": "Sort orders",
            "minItems": 1,
            "maxItems": 2,
            "type": "array",
            "description": "1 to 2 orders, each read as its own search of each stay: popularity (Agoda's default order) and price (nightly price before taxes, lowest first). More orders give more distinct properties per stay. A property found by several orders is returned once, with the rank of the first order.",
            "items": {
              "type": "string",
              "enum": [
                "popularity",
                "price"
              ],
              "enumTitles": [
                "Popularity",
                "Price, lowest first"
              ]
            },
            "default": [
              "popularity"
            ]
          },
          "includeSoldOut": {
            "title": "Include sold-out properties",
            "type": "boolean",
            "description": "Also return the properties shown as sold out for the stay, without a price. Off by default.",
            "default": false
          },
          "maxPropertiesPerStay": {
            "title": "Maximum properties per search",
            "minimum": 1,
            "maximum": 450,
            "type": "integer",
            "description": "Properties read at most for each search (one stay and one sort order), from 1 to 450. Agoda serves 45 properties per page, so 100 reads 3 pages at most.",
            "default": 100
          },
          "maxItems": {
            "title": "Maximum rows",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Hard cap on the rows returned and billed, from 1 to 10000. The run stops once that many rows are delivered. A run makes at most 60 searches: (destinations x check-in dates x lengths of stay + search URLs) x sort orders.",
            "default": 1000
          },
          "capturePlan": {
            "title": "Capture plan",
            "type": "string",
            "description": "Maintainer only. Name of a closed diagnostic capture campaign. Requires Internal capture mode. The allowlist lives in the code: any other value is rejected without issuing a request."
          },
          "internalCaptureMode": {
            "title": "Internal capture mode",
            "type": "boolean",
            "description": "Maintainer only. When true, captures raw responses to the default key-value store of the run for building test fixtures. Not for normal use.",
            "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}