Search hotels
Find hotels in a place, near a point or by name, with indicative prices.
MCP: search_hotels
Usage
fortrip hotels search [options]Options
| Flag | Field | Description |
|---|---|---|
--place-name <name> | destination.name | Search a place by its name, in any language (e.g. Tokyo or 东京), with its country in --country. |
--country <CC> | destination.countryCode | The country of --place-name, ISO 3166-1 alpha-2, e.g. JP. |
--place <plc_> | destination.placeId | Search a place by its placeId from an earlier answer. |
--locality <plc_> | destination.placeId | Search a locality by its placeId, as an earlier search listed it under localities. |
--point <lat,lng> | destination.location | Search around a point, as lat,lng (WGS84), e.g. 13.75,100.5. |
--country-only <CC> | destination.countryCode | Search a whole country, ISO 3166-1 alpha-2, e.g. JP. |
--radius-meters <n> | destination.radiusMeters | Search radius around the destination in meters, 1 to 80000. Left out, the service picks one. |
--text <text> | text | Hotel name, brand or area to match, 1 to 128 characters. A first page needs this or a destination. |
--check-in YYYY-MM-DD | stay.checkIn | Check-in date in the hotel's calendar, yyyy-MM-dd. |
--check-out YYYY-MM-DD | stay.checkOut | Check-out date in the hotel's calendar, yyyy-MM-dd. Stays are 1 to 15 nights; a longer one answers stay_unsupported (max_nights), and past 30 nights invalid_request: ask the user whether to split it into consecutive stays. |
--room <adults[:age,…]>... | stay.rooms | A room, as adults or adults:age,age with each child's age, e.g. 2 or 2:6,9. Repeat for each room, up to 8; rooms may differ. |
--pricing indicative|none | pricing | indicative adds an approximate price per hotel and needs a stay; none skips prices. Default: indicative with a stay, otherwise none. |
--stars-min <n> | filters.stars.min | Lowest star rating, 1 to 5 in steps of 0.5. |
--stars-max <n> | filters.stars.max | Highest star rating, 1 to 5 in steps of 0.5. |
--amenity parking|wifi|laundry|restaurant|room_service|bar|non_smoking|business_center|pool... | filters.amenities | An amenity every hotel must list; repeat for each, up to 9. |
--price-max-per-room-night <USD decimal> | filters.price.maxPerRoomNight | Highest indicative price per room per night, in USD, e.g. 150 or 149.50. Needs a stay. |
--sort distance|relevance|stars_desc|price_asc|price_desc | sort | Result order. distance needs a destination, relevance needs text, price_asc and price_desc need indicative pricing. Default: relevance with text, otherwise distance. |
--limit <n> | limit | Hotels per page, 1 to 50. Default 20. |
--cursor <cursor> | cursor | nextCursor from the previous page. A next page takes only --cursor and --limit. |
--locale en|zh | locale | Language for names and text in the response: en or zh. |
--display-currency USD|CNY | displayCurrency | Currency to show prices in, USD or CNY. It never changes what is charged: payment is in USD. |
--body <json|@file.json> | — | The raw request body as a JSON object, or @file.json to read it from a file. Flags override its fields. |
Output
Compact text on stdout: one line per hotel, offer or order, with its ids, and every note. With --json, the response as JSON on one line.
The JSON is the Search result object. Errors go to stderr with an exit code.