GET /v1/hotels/search-link
Builds 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.
Operation ID: getHotelSearchLink
Parameters
| Name | In | Type | Required | Constraints | Description |
|---|---|---|---|---|---|
cityCode |
query | string | yes | pattern ^[A-Z]{3}$ |
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. |
checkIn |
query | string | yes | pattern ^\d{4}-\d{2}-\d{2}$ |
Check-in date, YYYY-MM-DD. Not in the past. |
checkOut |
query | string | yes | pattern ^\d{4}-\d{2}-\d{2}$ |
Check-out date, YYYY-MM-DD. Must be after checkIn. |
adults |
query | integer | no | 1..9; default 2 |
Adults across the link’s rooms (1-9). Defaults to 2. |
children |
query | integer | no | 0..8; default 0 |
Children across the link’s rooms (0-8). Defaults to 0. Sending more than 0 requires childrenAges. |
childrenAges |
query | string | no | pattern ^\d{1,2}(,\d{1,2})*$ |
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 |
query | integer | no | 1..4; default 1 |
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. |
currency |
query | string | no | pattern ^[A-Z]{3}$ |
Optional pricing currency as a 3-letter ISO 4217 code. When omitted the page prices in whatever the recipient’s own session uses. |
locale |
query | string | no | length 1..35; default "en" |
Page language tag (e.g. en, ar). Defaults to en. |
siteCode |
query | string | no | pattern ^[A-Z]{2}$ |
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. |
Responses
| Status | Description |
|---|---|
200 |
The durable wego.com hotel-search URL. |
400 |
Invalid query parameters. checkIn must be a real calendar date and not in the past; checkOut must be after it; rooms is 1-4 and cannot be more than adults; childrenAges is required when children is above 0 and must have exactly that many entries. |
401 |
Missing or invalid bearer token. |
429 |
Rate limit exceeded; retry after the Retry-After seconds. |
200 body
| Field | Type | Always present | Description |
|---|---|---|---|
searchUrl |
string | yes | A wego.com hotel-search URL for this city, dates and occupancy. Opening it runs the search live. |
expires |
boolean | yes | Always false: the URL carries no search-scoped id, so it keeps working. The prices behind it are whatever a live search returns when it is opened. |
Example
CHECK_IN=$(date -u -v+60d +%F 2>/dev/null || date -u -d '+60 days' +%F)
CHECK_OUT=$(date -u -v+67d +%F 2>/dev/null || date -u -d '+67 days' +%F)
curl -s -H "Authorization: Bearer $TOKEN" \
"https://api.wego.com/v1/hotels/search-link?cityCode=BKK&checkIn=$CHECK_IN&checkOut=$CHECK_OUT"