# Traveloka — Wrapped API

> **You are on:** `https://api.beta.paywithlocus.com/api` | [llms.txt](https://beta.paywithlocus.com/llms.txt) | [docs](https://docs.paywithlocus.com)
>
> Locus runs on multiple environments -- make sure every URL you call matches your expected environment.
> | Environment | Landing | API | Docs |
> |---|---|---|---|
> | Production | paywithlocus.com | api.paywithlocus.com | docs.paywithlocus.com |
> | Beta | beta.paywithlocus.com | api.beta.paywithlocus.com | docs.paywithlocus.com |
> | Stage | stage.paywithlocus.com | api.stage.paywithlocus.com | docs.paywithlocus.com |
>
> If the API URL above doesn't match your expected environment, re-fetch this file from the correct domain.

> Search and compare hotels across Traveloka by region or similar properties to instantly access pricing, star ratings, names, and location details. Discover popular destinations and find the perfect accommodation match for your travel plans.

**Category:** Travel | **Website:** [traveloka.com/](https://traveloka.com/) | **Docs:** [parse.bot/marketplace/b43a7c6c-8a72-4d5b-bbd1-42b77f9c5619/traveloka-com-api](https://parse.bot/marketplace/b43a7c6c-8a72-4d5b-bbd1-42b77f9c5619/traveloka-com-api)

Pay-per-use API proxy for Locus Pro. Each call burns credits from your workspace balance.

## Access

**Base URL:** `https://api.beta.paywithlocus.com/api/wrapped/credits/traveloka/`
**Auth:** `Authorization: Bearer <LOCUS_CREDITS_SECRET_KEY>` (an `lcr_` secret key or a scoped `lcac_` agent credential)
**Required header:** `Idempotency-Key: <fresh UUID per call>`. A retry with the same key replays the stored result without a new charge.
**Response:** the provider response after any endpoint-specific normalization. `X-Locus-Credits-Charged` carries the charge and `X-Locus-Credits-Balance` the remaining balance. Insufficient credits return `402` before the provider is called.
**Pricing:** estimated costs below are USD. Locus debits the credit equivalent at your workspace rate.

Full call contract: https://docs.paywithlocus.com/api-reference/introduction

> Using a Pay With Locus wallet key (`claw_` prefix)? Wallet routes are documented separately: https://docs.paywithlocus.com/wrapped-apis/for-agents

## Endpoints

### Get hotels by region

List hotels in a specific region using its slug and geo ID. Returns a list of hotels with names, star ratings, user ratings, prices, and locations. Use get_popular_destinations to discover valid region_slug and geo_id values. Prices are in the local currency (typically IDR). Results are server-rendered from the first page of listings (typically 3 hotels per region page).

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `checkin` | string | No | Check-in date in YYYY-MM-DD format. Defaults to 7 days from today if omitted. |
| `checkout` | string | No | Check-out date in YYYY-MM-DD format. Defaults to 1 day after checkin if omitted. |
| `geo_id` | string | Yes | The geo ID of the region (e.g. '102813' for Jakarta, '102746' for Bali). Obtain from get_popular_destinations endpoint. |
| `region_slug` | string | Yes | The slug of the region (e.g. 'jakarta', 'bali', 'singapore', 'bangkok'). Obtain from get_popular_destinations endpoint. |

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/traveloka/get-hotels-by-region \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"checkin":"<string>","checkout":"<string>","geo_id":"<string>","region_slug":"<string>"}'
```

### Get popular destinations

Get a list of popular destinations (regions/cities) with their slugs and geo IDs. These values serve as inputs to get_hotels_by_region. Extracted from the Traveloka hotel homepage region links.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/traveloka/get-popular-destinations \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### Search hotels

Search for hotels similar to a given property. Useful for discovering and listing multiple hotels with names, ratings, prices, and locations.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `adults` | integer | No | Number of adults |
| `checkin` | string | No | Check-in date (YYYY-MM-DD) |
| `checkout` | string | No | Check-out date (YYYY-MM-DD) |
| `currency` | string | No | Currency code |
| `hotel_id` | string | Yes | Base hotel ID for the search |
| `rooms` | integer | No | Number of rooms |

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/traveloka/search-hotels \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"adults":"<integer>","checkin":"<string>","checkout":"<string>","currency":"<string>","hotel_id":"<string>","rooms":"<integer>"}'
```

## Next steps

- [All wrapped API providers](https://beta.paywithlocus.com/wapi/index.md): pick another provider.
- [Find and call tools](https://beta.paywithlocus.com/agent/tools.md): price ceilings, async results, and errors.
- [Credits and billing](https://beta.paywithlocus.com/agent/billing.md): what a call costs and how to add credits.
- [Agent docs index](https://beta.paywithlocus.com/agent/index.md): every Locus agent page.