Hilton URL to Hotel ID API - Extract Hotel Codes
Extract the seven-character Hilton hotel_code from a public URL.
Overview
Extract a Hilton hotel code from a canonical HTTPS hotel or reservation rooms URL with StayAPI. Get the seven-character ctyhocn and normalized URL as JSON.
Scope
Local extraction does not check whether a hotel exists. Accepts hilton.com or www.hilton.com over HTTPS: /en/hotels/{code}-{slug}/ or /en/book/reservation/rooms/?ctyhocn={code}, including supported locale prefixes. Tracking parameters and fragments are removed; conflicting or repeated ctyhocn values are rejected. Pass hotel_code to Rooms for dated starting cash offers.
Authentication
Send your StayAPI key in the X-API-Key header. Successful requests return JSON; failures use RFC 7807 Problem Details.
Endpoint URL
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| url | string | Required | Canonical HTTPS Hilton hotel or reservation rooms URL, at most 2,048 characters; no credentials, whitespace, or nonstandard port. Reservation URLs require exactly one valid ctyhocn. |
Response schema
| Field | Type | Description |
|---|---|---|
| success | boolean | True on successful extraction. |
| hotel_code | string | Uppercase seven-character ctyhocn identifier; existence is not validated. |
| url | string | Normalized HTTPS www.hilton.com URL, with tracking parameters and fragment removed. |
Errors and limitations
Errors use RFC 7807 Problem Details with provider: "hilton" and a correlation id.
- 400 INVALID_INPUT: invalid search form, hotel code, dates, occupancy, or currency.
- 400 INVALID_URL: supply a canonical HTTPS Hilton hotel or reservation rooms URL.
- 422: a required parameter is missing or a typed parameter is outside its declared contract.
- 502 UPSTREAM_ERROR: Hilton data could not be retrieved or verified. An unverified sold-out rooms result also returns an error.
- 504: the request timed out.
- 503: service temporarily unavailable; honor Retry-After when supplied.