# Thailand Transit Scraper — SRT, BTS Skytrain & ARL Red Line (`jungle_synthesizer/thailand-transit-scraper`) Actor

Extract Thailand transit data from three sources: SRT station catalog (~750 stations, bilingual Thai/English), BTS Skytrain stations with first/last train times (~119 stations), and ARL Red Line departure timetables. Outputs line assignments and service direction data.

- **URL**: https://apify.com/jungle_synthesizer/thailand-transit-scraper.md
- **Developed by:** [BowTiedRaccoon](https://apify.com/jungle_synthesizer) (community)
- **Categories:** Travel, Business
- **Features:** Limited permissions
- **Stats:** 3 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 record scrapeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## Thailand Transit Scraper — SRT, BTS Skytrain & ARL Red Line Station Data

Scrapes Bangkok train station data and Thailand rail timetables from three Thai public transport networks: the [State Railway of Thailand (SRT)](https://dticket.railway.co.th/), [BTS Skytrain](https://www.bts.co.th/), and the [SRT Red Line](https://www.srtet.co.th/). Returns bilingual station catalogs (Thai + English), an SRT station list, BTS Skytrain stations with first/last service times, and ARL Red Line departure timetables — around 870 records per full run.

***

### What Thailand Transit Scraper Extracts

- **SRT stations** — ~750 stations across four lines (North, Northeast, East, South), with bilingual Thai and English names, station codes, and line assignments
- **BTS Skytrain stations** — ~119 stations on the Sukhumvit, Silom, and Gold lines, with first and last train times per station, latitude/longitude, and line colors
- **ARL Red Line timetables** — hourly departure schedules for the two Red Line routes (Bangkok Aphiwat to Rangsit and Bangkok Aphiwat to Taling Chan), stored as structured JSON
- **Operator filter** — run all three sources together or target a single operator (SRT, BTS, or ARL)
- **Bilingual output** — every station record includes both Thai script (`station_name_th`) and English romanization (`station_name_en`), which is more than you'll get from a Google search

***

### Who Uses This Bangkok Metro & Thailand Rail Data?

- **Travel app developers** — build station selectors, route planners, and schedule widgets for Bangkok tourism apps
- **SE Asia trip-planning platforms** — populate stop data, and transit options for multi-modal itinerary builders
- **Thailand MaaS startups** — seed the station database for mobility-as-a-service products integrating SRT, BTS, and urban rail
- **Data journalists and researchers** — map transit access, coverage gaps, and service hours for urban mobility analyses
- **Expat and digital-nomad tools** — help newcomers navigate Bangkok's overlapping rail networks with accurate bilingual data

***

### How It Works

1. **Select your operator.** Set `operator` to `any`, `srt`, `bts`, or `arl`. The default pulls all three sources in sequence.
2. **SRT station catalog.** Posts to the D-Ticket API, receives all ~750 stations in one response, filters active entries, and emits `srt_station` records.
3. **BTS station list and service times.** Posts to the EBM route-map API for all stations, then fetches first/last train times per station with bounded concurrency.
4. **ARL timetable.** Fetches the SRTET fare-timetable page, parses the HTML departure tables, and returns structured hourly schedules as JSON strings.

***

### Thailand Transit Scraper Input Fields

```json
{
  "operator": "any",
  "includeFares": false,
  "maxItems": 15,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": ["RESIDENTIAL"],
    "apifyProxyCountry": "TH"
  },
  "sp_intended_usage": "Transit data for Bangkok travel app",
  "sp_improvement_suggestions": "none"
}
```

| Field                        | Type    | Default | Description                                                   |
|------------------------------|---------|---------|---------------------------------------------------------------|
| `operator`                   | string  | `"any"` | Which network to scrape: `any`, `srt`, `bts`, or `arl`        |
| `includeFares`               | boolean | `false` | Reserved for future BTS fare-per-pair calculations            |
| `maxItems`                   | integer | `15`    | Maximum total records to return; set higher for full datasets |
| `sp_intended_usage`          | string  | —       | Required: describe your intended use of this data             |
| `sp_improvement_suggestions` | string  | —       | Required: feedback or "none"                                  |

***

### Thailand Transit Scraper Output Fields

Records come in three types, set by `record_type`. Each type populates a different subset of fields.

#### SRT Station (`srt_station`)

```json
{
  "record_type": "srt_station",
  "operator": "SRT",
  "service_id": "1001",
  "station_name_en": "Hua Lamphong",
  "station_name_th": "หัวลำโพง",
  "station_code_en": "HLP",
  "station_code_th": "หลป",
  "line": "SRT South",
  "line_id": "4",
  "scraped_at": "2025-11-01T08:30:00.000Z"
}
```

| Field             | Type   | Description                                                 |
|-------------------|--------|-------------------------------------------------------------|
| `record_type`     | string | `srt_station`                                               |
| `operator`        | string | `SRT`                                                       |
| `service_id`      | string | Internal station ID                                         |
| `station_name_en` | string | Station name in English                                     |
| `station_name_th` | string | Station name in Thai script                                 |
| `station_code_en` | string | English station code (e.g. HLP)                             |
| `station_code_th` | string | Thai station code                                           |
| `line`            | string | Line name: SRT North, SRT Northeast, SRT East, or SRT South |
| `line_id`         | string | Numeric line identifier as string                           |
| `scraped_at`      | string | ISO 8601 timestamp                                          |

#### BTS Station (`bts_station`)

```json
{
  "record_type": "bts_station",
  "operator": "BTS",
  "service_id": "42",
  "station_name_en": "Asok",
  "station_name_th": "อโศก",
  "line": "Sukhumvit Line",
  "line_color": "#009C3B",
  "station_key": "E4",
  "station_order": "4",
  "latitude": 13.7363,
  "longitude": 100.5606,
  "first_train_to_end": "05:56",
  "first_train_to_start": "06:10",
  "last_train_to_end": "24:00",
  "last_train_to_start": "23:48",
  "scraped_at": "2025-11-01T08:30:00.000Z"
}
```

| Field                  | Type   | Description                              |
|------------------------|--------|------------------------------------------|
| `record_type`          | string | `bts_station`                            |
| `operator`             | string | `BTS`                                    |
| `service_id`           | string | BTS internal station ID                  |
| `station_name_en`      | string | Station name in English                  |
| `station_name_th`      | string | Station name in Thai script              |
| `line`                 | string | Sukhumvit Line, Silom Line, or Gold Line |
| `line_color`           | string | Hex color code for the line              |
| `station_key`          | string | BTS line key (e.g. N8, S6, G1)           |
| `station_order`        | string | Sequence number on the line              |
| `latitude`             | number | Station latitude                         |
| `longitude`            | number | Station longitude                        |
| `first_train_to_end`   | string | First train toward end of line (HH:MM)   |
| `first_train_to_start` | string | First train toward start of line (HH:MM) |
| `last_train_to_end`    | string | Last train toward end of line (HH:MM)    |
| `last_train_to_start`  | string | Last train toward start of line (HH:MM)  |
| `scraped_at`           | string | ISO 8601 timestamp                       |

#### ARL Schedule (`arl_schedule`)

```json
{
  "record_type": "arl_schedule",
  "operator": "ARL",
  "service_id": "arl_Bangkok_Aphiwat_Rangsit",
  "station_name_en": "Bangkok Aphiwat",
  "line": "ARL Red Line",
  "line_color": "#FF0000",
  "direction_from": "Bangkok Aphiwat",
  "direction_to": "Rangsit",
  "first_train_to_end": "05:43",
  "last_train_to_end": "23:30",
  "schedule_json": "[{\"hour\":5,\"minutes\":[43]},{\"hour\":6,\"minutes\":[0,15,30,45]},...]",
  "scraped_at": "2025-11-01T08:30:00.000Z"
}
```

| Field                | Type   | Description                         |
|----------------------|--------|-------------------------------------|
| `record_type`        | string | `arl_schedule`                      |
| `operator`           | string | `ARL`                               |
| `service_id`         | string | Route identifier string             |
| `direction_from`     | string | Departure origin station            |
| `direction_to`       | string | Departure destination station       |
| `first_train_to_end` | string | First departure time (HH:MM)        |
| `last_train_to_end`  | string | Last departure time (HH:MM)         |
| `schedule_json`      | string | Full hourly schedule as JSON string |
| `scraped_at`         | string | ISO 8601 timestamp                  |

***

### 🔍 FAQ

#### How do I scrape Thailand transit station data?

Thailand Transit Scraper handles it in one run. Set `operator` to `any` to pull all three networks simultaneously, or target a single one (`srt`, `bts`, or `arl`) if you only need a subset. Full datasets return in under 2 minutes.

#### Where can I get a Bangkok metro station list with GPS coordinates?

Thailand Transit Scraper returns a full Bangkok rail station list spanning BTS Skytrain, the SRT Red Line, and the wider SRT network. BTS records carry latitude and longitude, line colors, and station keys, so you get mappable Bangkok metro station data without stitching together separate sources.

#### What data can I get from the BTS Skytrain API?

Thailand Transit Scraper returns all ~119 BTS stations across the Sukhumvit, Silom, and Gold lines, with bilingual names, GPS coordinates, line colors, station keys (e.g. N8, S6), and first/last service times per direction. That covers everything you need to build a station selector or schedule widget.

#### How much does Thailand Transit Scraper cost to run?

At the default pay-per-event rate, a full run costs roughly $0.001 per record — around $0.87 for all ~870 records. Test runs with `maxItems: 15` are negligible.

#### Why is MRT Bangkok not included?

The MRT Bangkok site (metro.bemplc.co.th) is behind a WAF that requires full browser rendering to bypass. It's out of scope for this actor.

***

### Need More Features?

Need MRT Bangkok or a different operator? [File an issue on the actor page](https://console.apify.com/actors/ujAVNwPmHdLyDgzpE) or contact us through the Apify console.

### Why Use Thailand Transit Scraper?

- **Bilingual by default** — every SRT and BTS record includes both Thai script and English romanization, saving the translation step that other sources skip
- **Three networks, one run** — SRT station catalog, BTS schedule data, and ARL timetables in a single actor with a single operator filter, which is more efficient than maintaining three separate scrapers
- **Structured schedule output** — ARL departures come as parseable JSON arrays, not raw strings scraped from a timetable page

# Actor input Schema

## `sp_intended_usage` (type: `string`):

What will this data feed? E.g. lead lists, KYB checks, price tracking.

## `sp_improvement_suggestions` (type: `string`):

Provide any feedback or suggestions for improvements.

## `sp_contact` (type: `string`):

We'll personally help with your use case. No spam.

## `operator` (type: `string`):

No description

## `includeFares` (type: `boolean`):

Reserved for future BTS fare-per-pair calculations. Currently has no effect.

## `maxItems` (type: `integer`):

Maximum total records to return. Default 15 for fast test runs; set higher for full datasets (SRT ~750 stations, BTS ~130 stations).

## Actor input object example

```json
{
  "sp_intended_usage": "Describe your intended use...",
  "sp_improvement_suggestions": "Share your suggestions here...",
  "sp_contact": "Share your email here...",
  "operator": "any",
  "includeFares": false,
  "maxItems": 15
}
```

# Actor output Schema

## `results` (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 = {
    "sp_intended_usage": "Describe your intended use...",
    "sp_improvement_suggestions": "Share your suggestions here...",
    "sp_contact": "Share your email here...",
    "operator": "any",
    "includeFares": false,
    "maxItems": 15
};

// Run the Actor and wait for it to finish
const run = await client.actor("jungle_synthesizer/thailand-transit-scraper").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 = {
    "sp_intended_usage": "Describe your intended use...",
    "sp_improvement_suggestions": "Share your suggestions here...",
    "sp_contact": "Share your email here...",
    "operator": "any",
    "includeFares": False,
    "maxItems": 15,
}

# Run the Actor and wait for it to finish
run = client.actor("jungle_synthesizer/thailand-transit-scraper").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 '{
  "sp_intended_usage": "Describe your intended use...",
  "sp_improvement_suggestions": "Share your suggestions here...",
  "sp_contact": "Share your email here...",
  "operator": "any",
  "includeFares": false,
  "maxItems": 15
}' |
apify call jungle_synthesizer/thailand-transit-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,jungle_synthesizer/thailand-transit-scraper"
        }
    }
}
```

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/ujAVNwPmHdLyDgzpE/builds/hpUaZgTvBjWmwivFG/openapi.json
