GET
# Otelpuan URL to Hotel ID API

Turn a public Otelpuan hotel URL into a hotel ID.

## Overview

Resolve an Otelpuan URL to hotel ID, name, canonical URL, rating, and review count with StayAPI. Use hotel\_id for guest reviews through REST or MCP.

#### Scope

Resolve the URL once, then pass the returned hotel\_id to Hotel Reviews. Retain the name, URL, and aggregate rating for display; ID-based reviews return null for these fields. A known hotel ID works directly without a previous resolver call. Hotels with zero reviews can still be resolved.

#### 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/otelpuan/hotel/url-to-id 

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| url | string | Required | Public Otelpuan root-slug hotel URL, for example https://www.otelpuan.com/Turkler-Otel. HTTP(S) on otelpuan.com or www.otelpuan.com is accepted and normalized to HTTPS www. Maximum 2,048 characters. Tracking queries and fragments are removed. |

## Response schema

| Field | Type | Description |
| --- | --- | --- |
| success | boolean | True only for a successful response. |
| hotel\_id | string | Hotel identifier to pass to Hotel Reviews. |
| name | string | Hotel name from the public property page. |
| url | string | Canonical HTTPS www.otelpuan.com hotel URL. |
| rating / rating\_scale | number or null / integer | Hotel page aggregate rating on a 0–10 scale; rating\_scale is 10. |
| review\_count | integer | Hotel page review count, including zero for hotels without reviews. |

## Errors and limitations

Errors use RFC 7807 Problem Details with `provider: "otelpuan"`, an instance and correlation id.

- 400 INVALID\_URL: supply a valid Otelpuan hotel URL.
- 422: url is required and must be no longer than 2,048 characters.
- 404 NOT\_FOUND: the hotel is not found.
- 502 UPSTREAM\_ERROR or 504 UPSTREAM\_TIMEOUT: the source request could not complete.
- 503: service temporarily unavailable.
- 500 CONTENT\_EXTRACTION\_FAILED: the source response could not be interpreted.

## Related resources

[Check rooms and prices for a stay](/docs/endpoints/otelpuan/rooms)[Search for hotel IDs by name](/docs/endpoints/otelpuan/search)[Resolve a URL to a hotel ID](/docs/endpoints/otelpuan/url-to-id)[Read reviews by hotel ID](/docs/endpoints/otelpuan/hotel-reviews)[Otelpuan API overview](/apis/otelpuan)[Use Otelpuan tools through MCP](/docs/mcp)

Request

```curl
curl -X GET "https://api.stayapi.com/v1/otelpuan/hotel/url-to-id?url=https%3A%2F%2Fwww.otelpuan.com%2FTurkler-Otel" \
  -H "X-API-Key: YOUR_API_KEY"
```

Response

```json
{
  "success": true,
  "hotel_id": "25322",
  "name": "Türkler Otel",
  "url": "https://www.otelpuan.com/Turkler-Otel",
  "rating": 8.3,
  "rating_scale": 10,
  "review_count": 86
}
```
