{
  "openapi": "3.0.1",
  "info": {
    "title": "Trip.com Hotel Search & Nightly Price Finder",
    "description": "Search Trip.com hotels by city and travel dates, or fetch one hotel by ID, with nightly price, star rating, guest score, amenities, and location.",
    "version": "1.1",
    "x-build-id": "YqKtYaAlxzHXQ8eZm"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/dataspryva~trip-com-hotel-search-and-nightly-price-finder/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-dataspryva-trip-com-hotel-search-and-nightly-price-finder",
        "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/dataspryva~trip-com-hotel-search-and-nightly-price-finder/runs": {
      "post": {
        "operationId": "runs-sync-dataspryva-trip-com-hotel-search-and-nightly-price-finder",
        "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/dataspryva~trip-com-hotel-search-and-nightly-price-finder/run-sync": {
      "post": {
        "operationId": "run-sync-dataspryva-trip-com-hotel-search-and-nightly-price-finder",
        "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": {
          "mode": {
            "title": "Mode",
            "enum": [
              "searchHotels",
              "hotelDetail"
            ],
            "type": "string",
            "description": "Choose 'Search hotels' to browse a city, or 'Hotel details by ID' to fetch specific properties.",
            "default": "searchHotels"
          },
          "cityName": {
            "title": "City",
            "type": "string",
            "description": "City to search, e.g. London, Paris, Tokyo, Bangkok, Dubai. Country names also work: 'Paris, France'.",
            "default": "London"
          },
          "cityId": {
            "title": "Trip.com City ID (optional)",
            "minimum": 1,
            "maximum": 99999999,
            "type": "integer",
            "description": "Exact Trip.com geo code, if you already know it (London = 338). Overrides the city name."
          },
          "checkIn": {
            "title": "Check-in Date",
            "type": "string",
            "description": "YYYY-MM-DD. Leave blank for tomorrow."
          },
          "checkOut": {
            "title": "Check-out Date",
            "type": "string",
            "description": "YYYY-MM-DD. Leave blank for the night after check-in."
          },
          "adults": {
            "title": "Adults",
            "minimum": 1,
            "maximum": 8,
            "type": "integer",
            "description": "Number of adults per room (1-8).",
            "default": 2
          },
          "rooms": {
            "title": "Rooms",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "Number of rooms (1-5).",
            "default": 1
          },
          "minStars": {
            "title": "Minimum Star Rating",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "Lowest official star class to include (1-5)."
          },
          "maxStars": {
            "title": "Maximum Star Rating",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "Highest official star class to include (1-5)."
          },
          "minRating": {
            "title": "Minimum Guest Score",
            "minimum": 0,
            "maximum": 10,
            "type": "number",
            "description": "Trip.com guest score on a 0-10 scale, e.g. 8 for 'Very good'."
          },
          "maxPrice": {
            "title": "Maximum Nightly Price",
            "minimum": 0,
            "maximum": 100000,
            "type": "number",
            "description": "Highest nightly room price in the selected currency, before taxes."
          },
          "breakfastIncluded": {
            "title": "Breakfast Included Only",
            "type": "boolean",
            "description": "Only return rooms whose rate includes breakfast.",
            "default": false
          },
          "freeCancellation": {
            "title": "Free Cancellation Only",
            "type": "boolean",
            "description": "Only return rooms with a free-cancellation policy.",
            "default": false
          },
          "payAtHotel": {
            "title": "Pay at Hotel Only",
            "type": "boolean",
            "description": "Only return rooms that can be paid for at the property.",
            "default": false
          },
          "sortBy": {
            "title": "Sort Results By",
            "enum": [
              "recommended",
              "priceLow",
              "priceHigh",
              "rating",
              "stars"
            ],
            "type": "string",
            "description": "Order of the returned hotels. Price and rating sorts scan extra result slices before trimming.",
            "default": "recommended"
          },
          "currency": {
            "title": "Currency",
            "enum": [
              "USD",
              "EUR",
              "GBP",
              "JPY",
              "AUD",
              "CAD",
              "CNY",
              "HKD",
              "SGD",
              "THB",
              "KRW",
              "INR",
              "AED",
              "CHF",
              "MYR",
              "TWD"
            ],
            "type": "string",
            "description": "Currency for all price fields.",
            "default": "USD"
          },
          "includeDetails": {
            "title": "Enrich Search Results with Hotel Details",
            "type": "boolean",
            "description": "Fetch each hotel's detail page for its full address, facilities, description, phone and check-in times. Adds one request per hotel.",
            "default": false
          },
          "maxItems": {
            "title": "Maximum Hotels",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Maximum records to return (1-200).",
            "default": 20
          },
          "hotelId": {
            "title": "Hotel ID or URL (detail mode)",
            "type": "string",
            "description": "One Trip.com hotel ID or detail URL, e.g. 731904. Used when mode is 'Hotel details by ID'."
          },
          "hotelIds": {
            "title": "Hotel IDs or URLs (batch detail mode)",
            "type": "array",
            "description": "Multiple Trip.com hotel IDs or detail URLs. Combined with 'hotelId' when both are provided.",
            "items": {
              "type": "string"
            }
          },
          "proxyConfiguration": {
            "title": "Proxy Configuration",
            "type": "object",
            "description": "Optional. Leave unchanged for a direct connection; the actor uses Apify Proxy automatically if Trip.com blocks the datacenter IP.",
            "default": {
              "useApifyProxy": 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}