Build a durable wego.com hotel search link
Changed onBuilds a shareable wego.com hotel-search URL from the caller's own city, dates and occupancy. A pure, stateless string build: no search created. It carries no search-scoped id, so it does not expire: whoever opens it runs the search live.
Request
- Base URLhttps://api.wego.com
- Auth
- OAuth 2Authorization codehttps://auth.wego.com/user-auth/v2/users/oauth/authorizeToken URLhttps://auth.wego.com/user-auth/v2/users/oauth/token
- or HTTP bearer
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Query parameters
City code the link searches, e.g. BKK. Take it from a places result's code or cityCode, never its numeric id. A lat/lng pair cannot be shared: wego.com serves no coordinate search URL. To link one hotel instead of a search, use the pageUrl that hotel carries.
Check-in date, YYYY-MM-DD. Not in the past.
Check-out date, YYYY-MM-DD. Must be after checkIn.
Adults across the link's rooms (1-9). Defaults to 2.
Children across the link's rooms (0-8). Defaults to 0. Sending more than 0 requires childrenAges.
Per-child ages as a comma-separated list of integers 0-17, e.g. 5,9. The count must equal children, and it is required whenever children is above 0: the create body prices a missing age at 8, and a durable link would show that guess to a recipient who cannot correct it.
Rooms the link asks for (1-4). Defaults to 1, and cannot be more than adults. Guests spread evenly and fill the earlier rooms first, so 3 adults in 2 rooms give 2 then 1, matching the way a search prices the same stay.
Optional pricing currency as a 3-letter ISO 4217 code. When omitted the page prices in whatever the recipient's own session uses.
Page language tag (e.g. en, ar). Defaults to en.
Wego market (point of sale) as a 2-letter code, e.g. AE; defaults to US. It selects the wego.com host the link points at.
Response
The durable wego.com hotel-search URL.
Changes
- info
endpoint added
- info