GET
# Agoda Hotel Name Lookup API

Find hotel suggestions by name and select an Agoda hotel ID.

## Overview

Send your API key in `X-API-Key`. This endpoint returns hotel suggestions, without prices or availability.

### Endpoint URL

GET https://api.stayapi.com/v1/agoda/hotel/lookup 

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| query | string | Required | 2–200 characters after trimming; control characters are rejected. Include the city to distinguish similarly named hotels. |

There are no date, limit, or page parameters.

## Response

`success` is true; `query` is the trimmed input. `hotels` contains hotel suggestions in provider order, with duplicate hotel IDs removed. `count` matches the returned array length and `retrieved_at` is a UTC ISO timestamp.

Each hotel has a positive integer `hotel_id` and a `name`. The fields `city_id` (integer), `city`, `country_code`, `location`, `search_url`, and `image_url` are nullable. A successful lookup with no suggestions returns `hotels: []` and `count: 0`.

## Limits and next steps

Suggestions are not an exhaustive hotel catalog and have no pagination. Check the name and location before choosing a hotel. Pass its `hotel_id` to [hotel details](/docs/endpoints/agoda/hotel-details) for a date-free property profile, to [hotel prices](/docs/endpoints/agoda/hotel-prices) with stay dates, or to [hotel reviews](/docs/endpoints/agoda/hotel-reviews). If you already have an Agoda hotel URL, use [URL to hotel ID](/docs/endpoints/agoda/hotel-url-to-id).

## Errors

Errors use RFC 7807 Problem Details: 400 for invalid input, 502 for an upstream failure, and 503 when the service is temporarily unavailable. Missing or incorrectly typed required parameters return 422. Authentication and account limits can return 401, 402, or 429 and apply as for other StayAPI endpoints. A failure is never represented as a successful empty list.

Request

```curl
curl "https://api.stayapi.com/v1/agoda/hotel/lookup?query=Banyan%20Tree%20Phuket" -H "X-API-Key: YOUR_API_KEY"
```

Response

```json
{
  "success": true,
  "query": "Banyan Tree Phuket",
  "hotels": [
    {
      "hotel_id": 10884,
      "name": "Banyan Tree Phuket",
      "city_id": 16056,
      "city": "Phuket",
      "country_code": "TH",
      "location": "Phuket, Thailand",
      "search_url": "https://www.agoda.com/search?hotel=10884&selectedproperty=10884",
      "image_url": null
    }
  ],
  "count": 1,
  "retrieved_at": "2026-10-14T12:00:00Z"
}
```

```json
{"type":"about:blank","title":"Bad Request","status":400,"detail":"Invalid query","provider":"agoda"}
```
