# Search hotels (v1)

Returns one page of 45 properties in a city for dates and guests, with star rating, guest score, area, nightly price with and without taxes, stay total and cancellation terms. Sold-out properties stay in the list without a price. An unknown `location` is rejected with a 400.

- Platform: Agoda
- Request: `GET https://api.toolzerhub.com/v1/agoda/search`
- Auth: `x-api-key` header
- Cost: 1 credit per successful request. Failed requests are not billed.
- Page: https://docs.toolzerhub.com/reference/agoda/hotel-search/get-agoda-hotel-search

| Parameter | In | Required | Type | Description |
| --- | --- | --- | --- | --- |
| `location` | query | yes | string | location_id from the Locations endpoint (an Agoda city ID such as 9395 for Bangkok), or an agoda.com search link such as https://www.agoda.com/search?city=9395. |
| `checkin` | query | yes | string | Arrival date, YYYY-MM-DD; today or later. |
| `checkout` | query | yes | string | Departure date, YYYY-MM-DD; after checkin and at most 30 nights later. |
| `adults` | query | no | integer | Adults across all rooms. Default: 2. |
| `rooms` | query | no | integer | Rooms to book. Default: 1. |
| `currency` | query | no | string | ISO 4217 currency for every price, such as USD, EUR or THB. Default: USD. |
| `children` | query | no | string | Each child's age (0-17), separated by commas. Omit for no children. Default: . |
| `sort` | query | no | enum: recommended, price, rating, stars | recommended (Agoda's own order), price (lowest first), rating (guest score) or stars (hotel class). Default: recommended. |
| `page` | query | no | integer | One-based page of 45 hotels. Prices are live, so a hotel can move between pages from one request to the next. Default: 1. |

## Example request

```bash
curl "https://api.toolzerhub.com/v1/agoda/search?location=<location>&checkin=<checkin>&checkout=<checkout>" \
  -H "x-api-key: $TOOLZERHUB_API_KEY"
```

Success responses are wrapped as `{ "data": ... }`. Errors return `{ "error": { "code", "status", "message", "retryable", "details" } }`. See https://docs.toolzerhub.com/docs/responses-and-errors.
