# Traveloka Flight Price Tracker (`fanndev/traveloka-flight-price-tracker`) Actor

Track Traveloka flight fares for any route: the cheapest fare per month for the next 12 months plus a departure-by-return date grid, with a price-alert threshold flag for webhooks. HTTP-only, no browser.

- **URL**: https://apify.com/fanndev/traveloka-flight-price-tracker.md
- **Developed by:** [Faisal Ahdan naufal](https://apify.com/fanndev) (community)
- **Stats:** 2 total users, 1 monthly users, 50.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.40 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Traveloka Flight Price Tracker

Tracks what a route actually costs on Traveloka across dates, so you can see
where the cheap days are and get told when a fare drops.

Two fare surfaces per route, both read straight from Traveloka's JSON API:

- **12-month cheapest curve** — the lowest fare in each of the next twelve
  months. One request per route, and the clearest read on seasonality.
- **Departure-by-return date grid** — the cheapest fare for every departure and
  return date pair in the windows you choose, up to ~100 quotes per request.

### Price alerts

Set `priceThreshold` and every route record carries
`summary.belowThreshold: true` when its lowest fare falls to or below your
number. Point an Apify webhook at the run and filter on that field to push into
Slack, Telegram or anything else. `summary` also gives you `lowestFare`,
`cheapestMonth`, and the exact `cheapestDepartDate` / `cheapestReturnDate`.

Schedule the actor daily and the dataset becomes a fare history you can diff.

### Input

Routes are `ORIGIN-DESTINATION`. IATA codes resolve fastest (`CGK-DPS`) but city
names work too (`Jakarta-Denpasar`) — anything unresolvable is reported as
`NOT_FOUND` rather than silently dropped. `-`, `->`, `>` and the word `to` are all
accepted as separators.

Set the departure and return windows, cabin class, passenger mix and currency.
Everything else has a sensible default.

### What this actor cannot do, and why

**It reports fares, not individual flights.** There is no airline name, departure
time, aircraft or transit duration in the output. Traveloka's itinerary search
(`/v2/flight/search/initial` and the streaming feed behind it) is protected by AWS
WAF with the `captcha` action — a visual challenge no headless client can answer.
This was verified from clean residential Indonesian IPs as well as datacenter
IPs, on the first request of a fresh session with a valid WAF challenge token.
Proxies do not change it, so the actor sticks to the price-discovery endpoints,
which are not gated.

If you need schedules and airlines rather than prices, this is not the tool.

### The 100-cell trap

`departWindowDays × returnWindowDays` is capped at 100 date pairs per request by
Traveloka. Past that the API does not error — it returns **zero fares**, which
reads exactly like "this route has no flights". The actor splits oversized grids
into compliant blocks automatically, so you can ask for a 30-day window without
thinking about it.

A related quirk: a return date cannot precede its departure date, so a grid whose
return window sits before the departure window legitimately comes back nearly
empty.

### Output record types

- `ROUTE` — fares collected.
- `NOT_FOUND` — origin or destination could not be resolved to an airport.
- `NO_FARES` — the route resolved but Traveloka quoted nothing in the window.
- `ERROR` — a request failed; see `error`.

Anything that partly failed still returns, with the reason in `warnings`.

### Cost

One request to resolve each endpoint of a route (skipped when you pass IATA
codes), one for the monthly curve, and one per grid block. A typical route with a
10×10 grid is four requests.

Traveloka's fare APIs answer datacenter IPs normally, so the default Apify proxy
is fine. Residential Indonesian proxies do not unlock anything extra.

### A note on robots.txt

Traveloka's `robots.txt` disallows `/api/`, which is where this actor reads from.
Decide for yourself whether that fits your use of the data, your jurisdiction and
your agreement with Traveloka. Keep request rates modest and scrape only what you
need.

# Actor input Schema

## `routes` (type: `array`):

One route per line as ORIGIN-DESTINATION. IATA codes are fastest (CGK-DPS), but city names work too (Jakarta-Denpasar). Accepted separators: -, ->, >, or the word 'to'.

## `origin` (type: `string`):

Single-route alternative to the Routes list: origin IATA code or city name.

## `destination` (type: `string`):

Single-route alternative to the Routes list: destination IATA code or city name.

## `roundTrip` (type: `boolean`):

Price a return journey. Turn off to price one way; note that the date grid is inherently a depart-by-return matrix and is most useful for round trips.

## `departDate` (type: `string`):

Start of the departure window in YYYY-MM-DD. Defaults to 30 days from today.

## `departWindowDays` (type: `integer`):

How many consecutive departure dates to price from the first departure date.

## `returnDate` (type: `string`):

Start of the return window in YYYY-MM-DD. Defaults to 37 days from today.

## `returnWindowDays` (type: `integer`):

How many consecutive return dates to price. Departure days multiplied by return days is capped at 100 per request; larger windows are split automatically.

## `includeMonthlyCurve` (type: `boolean`):

Pull the cheapest fare for each of the next 12 months on this route. One request per route, and the best signal for seasonality.

## `includeDateGrid` (type: `boolean`):

Pull the cheapest fare for each departure and return date pair in the chosen windows.

## `seatClass` (type: `string`):

Cabin class to price.

## `adults` (type: `integer`):

Adult passengers. Fares are per booking, so this changes the quoted totals.

## `children` (type: `integer`):

Child passengers aged 2 to 11.

## `infants` (type: `integer`):

Infant passengers under 2.

## `priceThreshold` (type: `string`):

Optional fare threshold in the selected currency. Any route whose lowest fare falls to or below this value is flagged with summary.belowThreshold, which is what you hook a Slack or Telegram webhook to.

## `locale` (type: `string`):

Traveloka locale, which affects labels in the response.

## `currency` (type: `string`):

Currency for all fares in the output.

## `requestDelaySeconds` (type: `string`):

Seconds to pause between API calls. Raise it if you see repeated 429 or 5xx responses.

## `proxyConfiguration` (type: `object`):

Proxy settings. Traveloka's fare APIs answer datacenter IPs normally, so the default is fine.

## Actor input object example

```json
{
  "routes": [
    "CGK-DPS"
  ],
  "roundTrip": true,
  "departWindowDays": 10,
  "returnWindowDays": 10,
  "includeMonthlyCurve": true,
  "includeDateGrid": true,
  "seatClass": "ECONOMY",
  "adults": 1,
  "children": 0,
  "infants": 0,
  "locale": "en-id",
  "currency": "IDR",
  "requestDelaySeconds": "0.4",
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `datasetOverview` (type: `string`):

No description

## `faresView` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "routes": [
        "CGK-DPS"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("fanndev/traveloka-flight-price-tracker").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "routes": ["CGK-DPS"] }

# Run the Actor and wait for it to finish
run = client.actor("fanndev/traveloka-flight-price-tracker").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "routes": [
    "CGK-DPS"
  ]
}' |
apify call fanndev/traveloka-flight-price-tracker --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,fanndev/traveloka-flight-price-tracker"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/eaTz0KrbA5ADgWfa9/builds/vQfew1sTdhECQtGPE/openapi.json
