GET
Best We URL to Hotel ID API
Turn a Best We hotel URL into the property_id used by Details and Rooms.
Overview
Extract the stable Best We property identifier from a canonical hotel.bestwehotel.com property URL without making an upstream request.
Scope
The resolver is local-only. It accepts the canonical /HotelDetail?hotelId=... form, removes tracking parameters and fragments, and returns a normalized HTTPS URL.
Authentication
Send your StayAPI key in the X-API-Key header. Successful requests return JSON; failures use RFC 7807 Problem Details.
Endpoint URL
GET https://api.stayapi.com/v1/bestwe/hotel/url-to-id
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| url | string | Required | Canonical http(s) hotel.bestwehotel.com/HotelDetail URL containing exactly one valid hotelId. |
Response schema
| Field | Type | Description |
|---|---|---|
| url | string | Normalized HTTPS property URL with tracking data removed. |
| property_id | string | Stable Best We identifier used by Details and Rooms. |
Errors and limitations
Errors use RFC 7807 Problem Details with provider: "bestwe", a product name, and a correlation id.
- 400 INVALID_URL: the URL is not a canonical Best We property page.
- 400 PROPERTY_ID_NOT_FOUND: the URL does not contain exactly one valid
hotelId. - 422: the URL parameter is missing or longer than 2,048 characters.