Fortrip

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

FlagFieldDescription
--place-name <name>destination.nameSearch a place by its name, in any language (e.g. Tokyo or 东京), with its country in --country.
--country <CC>destination.countryCodeThe country of --place-name, ISO 3166-1 alpha-2, e.g. JP.
--place <plc_>destination.placeIdSearch a place by its placeId from an earlier answer.
--locality <plc_>destination.placeIdSearch a locality by its placeId, as an earlier search listed it under localities.
--point <lat,lng>destination.locationSearch around a point, as lat,lng (WGS84), e.g. 13.75,100.5.
--country-only <CC>destination.countryCodeSearch a whole country, ISO 3166-1 alpha-2, e.g. JP.
--radius-meters <n>destination.radiusMetersSearch radius around the destination in meters, 1 to 80000. Left out, the service picks one.
--text <text>textHotel name, brand or area to match, 1 to 128 characters. A first page needs this or a destination.
--check-in YYYY-MM-DDstay.checkInCheck-in date in the hotel's calendar, yyyy-MM-dd.
--check-out YYYY-MM-DDstay.checkOutCheck-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.roomsA 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|nonepricingindicative 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.minLowest star rating, 1 to 5 in steps of 0.5.
--stars-max <n>filters.stars.maxHighest star rating, 1 to 5 in steps of 0.5.
--amenity parking|wifi|laundry|restaurant|room_service|bar|non_smoking|business_center|pool...filters.amenitiesAn amenity every hotel must list; repeat for each, up to 9.
--price-max-per-room-night <USD decimal>filters.price.maxPerRoomNightHighest 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_descsortResult order. distance needs a destination, relevance needs text, price_asc and price_desc need indicative pricing. Default: relevance with text, otherwise distance.
--limit <n>limitHotels per page, 1 to 50. Default 20.
--cursor <cursor>cursornextCursor from the previous page. A next page takes only --cursor and --limit.
--locale en|zhlocaleLanguage for names and text in the response: en or zh.
--display-currency USD|CNYdisplayCurrencyCurrency 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.

On this page