GET
# Hyatt URL to Hotel ID API

Extract a hotel code for a Hyatt room request.

## Overview

Extracts the code from a supported URL without verifying that the hotel exists. Authenticate with `X-API-Key`; normal StayAPI quota applies. Also available through MCP as `hyatt_hotel_url_to_id(url)`.

### Endpoint URL
`GET https://api.stayapi.com/v1/hyatt/hotel/url-to-id`

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| url | string | Required | Canonical HTTPS hyatt.com or www.hyatt.com URL, 1–2048 characters; optional port 443. No other parameters are supported. |

Supported paths: branded `/brand/ll-CC/code-slug`, legacy `/ll-CC/hotel/location/name/code`, `/shop/rooms/code` with an optional locale prefix, and `/mr-and-mrs-smith/code-slug`. Branded and legacy paths may end in `/rooms`, `/gallery`, or `/policies`. The code is exactly five ASCII letters or digits.

Query strings, fragments, and a trailing slash are removed. The returned host is www.hyatt.com; path case is preserved. Percent encoding, whitespace, control characters, non-ASCII characters, backslashes, and repeated query names (case-insensitive) are rejected. Any spiritCode, hotelCode, or hotel\_code query value must match the path code. Unsupported URL paths return 400.

## Response

| Field | Type | Meaning |
| --- | --- | --- |
| success | boolean | true on success |
| hotel\_code | string | Five lowercase ASCII letters or digits |
| url | string | Normalized HTTPS www.hyatt.com URL without query or fragment |
| existence\_verified | boolean | Always false; extraction does not establish hotel existence |

No pagination, date, locale, currency, or filtering parameters apply. Use hotel\_code with the rooms endpoint; URL resolution does not establish room availability.

## Errors and limitations

Invalid URL semantics return 400; missing or invalid parameter types return 422. Authentication and quota errors use the normal StayAPI status codes. Errors follow RFC 7807 Problem Details; a failed resolution never returns a successful response.

## Related resources

[Hyatt rooms](/docs/endpoints/hyatt/rooms) · [Hyatt API](/apis/hyatt) · [MCP tools](/docs/mcp)

Request

```curl
curl 'https://api.stayapi.com/v1/hyatt/hotel/url-to-id?url=https%3A%2F%2Fwww.hyatt.com%2Fhyatt-centric%2Fen-US%2Fmiact-hyatt-centric-brickell-miami' -H 'X-API-Key: YOUR_API_KEY'
```

Response

```json
{
  "success": true,
  "hotel_code": "miact",
  "url": "https://www.hyatt.com/hyatt-centric/en-US/miact-hyatt-centric-brickell-miami",
  "existence_verified": false
}
```

```json
{
  "type": "about:blank",
  "title": "Bad Request",
  "status": 400,
  "detail": "Invalid request parameters",
  "instance": "/v1/hyatt/hotel/url-to-id",
  "provider": "hyatt"
}
```
