SJ Train Tickets and Connections Scraper
Pricing
from $2.00 / 1,000 sj train connections
SJ Train Tickets and Connections Scraper
Scrape public SJ train connections, departure and arrival times, changes, live from-prices, travel classes, train services, numbers, and onboard amenities.
Pricing
from $2.00 / 1,000 sj train connections
Rating
0.0
(0)
Developer
Muhammad Afzal
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
4 days ago
Last modified
Categories
Share
Search public SJ journey pages and export train connections with departure and arrival times, durations, changes, live one-adult from-prices, travel classes, services, train numbers, and onboard amenities.
The Actor is read-only. It does not log in, reserve seats, hold fares, or buy tickets. Prices and availability can change after a run, so users should confirm them on SJ before travel or purchase.
What it extracts
| Field | Meaning |
|---|---|
connectionId | Stable hash for deduplicating the displayed connection |
origin, destination, travelDate | Requested route and Sweden-local travel date |
departureTime, arrivalTime | Local times displayed by SJ |
departureDateTime, arrivalDateTime | ISO 8601 timestamps with Sweden's current UTC offset |
durationMinutes, changes, direct | Journey duration and transfer count |
fromPriceSek, currency | Current one-adult from-price displayed by SJ, or null |
serviceSummary, services | Displayed train/operator summary and ordered segments |
trainNumbers | Train numbers visible in the journey card |
travelClasses | Classes shown as available, such as 2 class or 1 class |
amenities | Symbols such as bistro, wifi, level boarding, or wheelchair lift |
bookingUrl, sourceUrl, scrapedAt | Manual continuation link and provenance |
When to use it
Use this Actor for fare monitoring, route comparison, travel research, schedule analysis, and feeding current SJ options into an automation or AI agent. It works with public stations represented in SJ's journey planner, including routes that contain services run by partner operators.
Do not use it to automate checkout, reserve inventory, guarantee a fare, collect account data, or represent SJ's full retail ticket conditions. The result is a journey-card snapshot for one adult, not a purchased ticket or binding offer.
Input
| Field | Default | Notes |
|---|---|---|
origin | Stockholm Central | Full public SJ station name |
destination | Göteborg Central | Must differ from the origin |
travelDate | tomorrow | YYYY-MM-DD, interpreted in Europe/Stockholm |
travelTime | 08:00 | Earliest departure or latest arrival |
searchBy | departure | departure or arrival |
directOnly | false | Keep zero-change connections only |
requirePrice | false | Set true to exclude schedule cards whose price has not loaded |
maxResults | 5 | 1–20 dataset records and result charges |
proxyConfiguration | no proxy | Configure a Swedish residential proxy only if the direct route is blocked |
Evergreen input:
{"origin": "Stockholm Central","destination": "Göteborg Central","travelTime": "08:00","searchBy": "departure","directOnly": false,"requirePrice": false,"maxResults": 5}
Specific arrive-by search:
{"origin": "Malmö Central","destination": "Stockholm Central","travelDate": "2026-10-15","travelTime": "18:00","searchBy": "arrival","maxResults": 10}
Run through the Apify API:
curl -X POST "https://api.apify.com/v2/acts/USERNAME~sj-train-tickets-connections-scraper/runs?token=APIFY_TOKEN" \-H "Content-Type: application/json" \-d '{"origin":"Stockholm Central","destination":"Göteborg Central","maxResults":5}'
For production automation, send the token in an Authorization header rather than a URL.
Output example
{"connectionId": "da32fbb2e75481ec9c2a","origin": "Stockholm Central","destination": "Göteborg Central","travelDate": "2026-10-15","departureTime": "08:17","arrivalTime": "11:47","departureDateTime": "2026-10-15T08:17:00+02:00","arrivalDateTime": "2026-10-15T11:47:00+02:00","durationMinutes": 210,"changes": 0,"direct": true,"fromPriceSek": 445,"currency": "SEK","serviceSummary": "SJ High-speed train, X 2000, train 425","services": ["SJ High-speed train, X 2000, train 425"],"trainNumbers": ["425"],"travelClasses": ["2 class", "2 class Calm", "1 class"],"amenities": ["bistro", "wheelchair lift", "wifi"],"bookingUrl": "https://www.sj.se/en/search-journey/choose-journey/Stockholm%20Central/G%C3%B6teborg%20Central/2026-10-15","sourceUrl": "https://www.sj.se/en/search-journey/choose-journey/Stockholm%20Central/G%C3%B6teborg%20Central/2026-10-15","scrapedAt": "2026-09-10T03:30:00.000Z"}
The default dataset contains only connection records. OUTPUT in the default key-value store reports DATA, EMPTY, BLOCKED, REJECTED, or FAILED, along with delivered records, charged events, route, source URL, and warnings.
Pay per event
| Event | Price | When charged |
|---|---|---|
| Actor start | $0.005 | Once when a run starts |
| SJ train connection | $0.002 | After one validated connection is saved |
A five-result run costs at most $0.015 in configured events: $0.005 + 5 × $0.002. A one-result run costs $0.007. Platform limits can stop charging early; delivered and charged counts are recorded separately in OUTPUT.
Reliability and limitations
The Actor loads SJ's public journey-selection page in a real browser and reads its accessible journey cards. It uses one coherent browser session, bounded retries, a 60-second navigation timeout, and a maximum of one journey-page request per run. The default does not use a proxy because SJ currently serves the public journey page directly. If SJ returns 403 or 429 from Apify Cloud, configure an Apify residential proxy with Sweden as the country.
requirePrice: true waits briefly for prices and excludes cards that still show a loading or unavailable price. Set it to false when schedules are more important than prices. An empty filtered search returns zero dataset records plus a truthful OUTPUT summary; the Actor never fabricates fallback connections. Invalid route combinations and dates are rejected before billable result work.
Station names must match SJ's public URL routing. If a name is not recognized, use the exact suggestion shown by SJ's journey search, such as Stockholm Central, Göteborg Central, Malmö Central, Uppsala Central, or Oslo S.
Responsible use
Use the data in accordance with SJ's terms, applicable transport-data rules, and privacy law. Keep request volume modest, cache results when appropriate, and do not use the Actor to interfere with purchasing, access controls, or service availability. This independent Actor is not affiliated with or endorsed by SJ AB.
For a suspected parser or source-page change, include the run ID, redacted input, and expected route in a support report. Do not send account credentials or payment information.