# Traveloka — Wrapped API

> **You are on:** `https://api.paywithlocus.com/api` | [llms.txt](https://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. Each call is automatically billed to your wallet in USDC.

## Access

**Base URL:** `https://api.paywithlocus.com/api/wrapped/parse-traveloka-com-api-b43a7c6c/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## 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.paywithlocus.com/api/wrapped/parse-traveloka-com-api-b43a7c6c/get_hotels_by_region \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -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.paywithlocus.com/api/wrapped/parse-traveloka-com-api-b43a7c6c/get_popular_destinations \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -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.paywithlocus.com/api/wrapped/parse-traveloka-com-api-b43a7c6c/search_hotels \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"adults":"<integer>","checkin":"<string>","checkout":"<string>","currency":"<string>","hotel_id":"<string>","rooms":"<integer>"}'
```
