{
  "openapi": "3.0.1",
  "info": {
    "title": "Trip.com Scraper",
    "description": "Scrape Trip.com hotels, train routes, and attractions worldwide. Hotels: autocomplete a city, search by location / coordinates / Trip.com URL, get full hotel details by ID or URL. Trains: search routes between cities + per-train details. Attractions: search things-to-do by city + per-POI details.",
    "version": "1.0",
    "x-build-id": "DhU1LGFbEsvFxNbFm"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/one-api~trip-com-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-one-api-trip-com-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/one-api~trip-com-scraper/runs": {
      "post": {
        "operationId": "runs-sync-one-api-trip-com-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/one-api~trip-com-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-one-api-trip-com-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": {
          "property_inputs": {
            "title": "Hotel ID, URL, or address (one per line)",
            "type": "array",
            "description": "Auto-detects each entry and calls the right endpoint:\n• Digits only (e.g. `2985758`) → `/details/byid`\n• `https://www.trip.com/hotels/...` → `/details/byurl`\n• Anything else → treated as a hotel name / address (resolved via search).\n\nEach row in the dataset = one full hotel record (rooms, amenities, policies, reviews, location, full image list — JSON in `Raw`).",
            "items": {
              "type": "string"
            }
          },
          "search_inputs": {
            "title": "Hotel search query (one per line)",
            "type": "array",
            "description": "Auto-detects each entry and routes to the right `/search/*` endpoint:\n• `https://www.trip.com/hotels/...` → `/search/byurl`\n• `lat,lng` or `lat,lng,radius_km` (e.g. `13.7563,100.5018,5`) → `/search/bycoordinates`\n• Anything else (city / location name, e.g. `Bangkok`) → `/search/bylocation`\n\nFilters below (check-in/out, guests, price, star, sort) apply to every search call. Each hit returns one dataset row per hotel.",
            "items": {
              "type": "string"
            }
          },
          "autocomplete_inputs": {
            "title": "Autocomplete query (one per line)",
            "type": "array",
            "description": "Free-text city/destination lookup. Each query returns up to `Autocomplete results per query` rows with `cityId`, `slug`, and the Trip.com city URL — handy when you want the cityId before running a hotel search.",
            "items": {
              "type": "string"
            }
          },
          "autocomplete_result_count": {
            "title": "Autocomplete results per query",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "How many city suggestions to keep per autocomplete query.",
            "default": 10
          },
          "train_inputs": {
            "title": "Train route (one per line — `Origin → Destination [YYYY-MM-DD]`)",
            "type": "array",
            "description": "Search train routes between two cities/stations. Format examples:\n• `Paris → London`\n• `London > Amsterdam`\n• `Beijing -> Shanghai 2026-08-15`\n• `Paris,Lyon` (comma-separated also works)\n\nEach result row = one departure (depart/arrival time, duration, fare, carrier).",
            "items": {
              "type": "string"
            }
          },
          "train_detail_inputs": {
            "title": "Train detail (one per line — `Origin → Destination | trainNo`)",
            "type": "array",
            "description": "Look up a specific train by its trainNo on a known route. Format:\n• `Paris → London | 9024`\n• `Beijing → Shanghai | G1`\n\nReturns the enriched detail row for that single train.",
            "items": {
              "type": "string"
            }
          },
          "attraction_inputs": {
            "title": "Attraction search location (one per line)",
            "type": "array",
            "description": "Free-text city / region keyword (e.g. `London`, `Tokyo`). Leave a row blank to fetch the global SEO feed.\n\nEach hit returns one dataset row per POI (name, rating, price, image, ranking).",
            "items": {
              "type": "string"
            }
          },
          "attraction_result_count": {
            "title": "Attraction results per query",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "How many POIs per attraction-search query (Trip.com SSR caps at ~12 per page).",
            "default": 12
          },
          "attraction_detail_inputs": {
            "title": "Attraction poiId (one per line)",
            "type": "array",
            "description": "Look up a Trip.com attraction by `poiId` (e.g. `78693` = Westminster Abbey, `78696` = British Museum, `81747` = London Eye). One row per poiId.",
            "items": {
              "type": "string"
            }
          },
          "checkIn": {
            "title": "Check-in date",
            "type": "string",
            "description": "YYYY-MM-DD. Defaults to ~30 days out when blank.",
            "default": "2026-08-10"
          },
          "checkOut": {
            "title": "Check-out date",
            "type": "string",
            "description": "YYYY-MM-DD. Defaults to ~2 days after check-in when blank.",
            "default": "2026-08-12"
          },
          "adults": {
            "title": "Adults",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Adults per room.",
            "default": 2
          },
          "children": {
            "title": "Children",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "Children per room.",
            "default": 0
          },
          "rooms": {
            "title": "Rooms",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Number of rooms.",
            "default": 1
          },
          "sortOrder": {
            "title": "Sort",
            "enum": [
              "0",
              "1",
              "2",
              "3"
            ],
            "type": "string",
            "description": "Trip.com hotel sort order.",
            "default": "0"
          },
          "priceRange": {
            "title": "Price range (USD)",
            "type": "string",
            "description": "Format: `min:80,max:300` — or just `min:80` / `max:300`. Leave blank for no price filter.",
            "default": ""
          },
          "starRating": {
            "title": "Star rating filter",
            "type": "string",
            "description": "Pipe-separated star ratings, e.g. `4|5` (4★ + 5★). Leave blank for all.",
            "default": ""
          },
          "resultCount": {
            "title": "Hotel results per query",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "How many hotels per `/search/*` query (capped at 100 by Trip.com).",
            "default": 30
          },
          "page": {
            "title": "Page",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "1-based page index for hotel search (each page = `Hotel results per query` rows).",
            "default": 1
          },
          "train_result_count": {
            "title": "Train results per route",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "How many train departures per route query.",
            "default": 30
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}