Swiss Transit OpenData Scraper avatar

Swiss Transit OpenData Scraper

Pricing

from $5.88 / 1,000 results

Go to Apify Store
Swiss Transit OpenData Scraper

Swiss Transit OpenData Scraper

Scrapes Swiss public transport connections, stationboard departures, and station locations from the official transport.opendata.ch API and returns each result as a flat row.

Pricing

from $5.88 / 1,000 results

Rating

0.0

(0)

Developer

ParseForge

ParseForge

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

4 days ago

Last modified

Share

ParseForge

Swiss Transit OpenData Scraper

Scrape Swiss public transport connections, station departures, and location data from the official OpenData API. Get journey details, departure boards, and station coordinates in a flat, structured dataset. Export to CSV, JSON, Excel, or XML.

Swiss public transport data is spread across apps and websites, making it hard to collect in bulk for analysis or archiving. This actor queries the official transport.opendata.ch API directly, so you can pull timetables, connections, and station information without writing a single line of code. It handles the API calls and returns every result in a consistent, flat schema ready for your spreadsheet or database.

Who uses itWhat they scrape Swiss Transit OpenData for
Mobility analystsMonitor connection times and service frequency between Swiss cities over time.
Travel app developersSeed a local database with station names, IDs, and coordinates for autocomplete features.
Data journalistsCollect departure boards to analyze punctuality or service gaps at specific stations.
Transport researchersGather structured journey data to model travel patterns across the Swiss rail network.

What it does

This Actor collects Swiss public transport data for connections, stationboard departures, or location searches and returns each result as a flat row.

  • πŸš† Connections mode: Query journeys between any two Swiss stations, with departure and arrival times, duration, and transfers.
  • πŸ•’ Stationboard mode: Fetch upcoming departures from a single station, including platform, delay information, and final destination.
  • πŸ“ Locations mode: Search for stations by name and get back coordinates, IDs, and full station names for mapping or lookup tables.
  • πŸ“… Date and time targeting: Set a specific date and time for connections or departures, or leave blank to use the current moment.
  • πŸ“Š Structured flat output: Every result, whether a connection, departure, or location, is returned as a clean row with the same predictable schema.

Results export to CSV, JSON, Excel, or XML, or straight from the API.

What you can do with Swiss Transit OpenData data

πŸš† Monitor intercity connection times.

A mobility analyst runs the Actor daily for the Zurich to Bern connection to track how scheduled journey durations change with each timetable update.

πŸ•’ Build a departure monitor for a specific stop.

A developer fetches the stationboard for Lausanne every five minutes and feeds the results into a dashboard showing real-time platform assignments and delays.

πŸ“ Create a Swiss station lookup table.

A data engineer searches for partial station names like 'Genf' and 'Luzern' to collect all matching station IDs, names, and coordinates for a mapping application.

πŸ“ˆ Analyze service frequency by time of day.

A researcher collects departures from Basel SBB across morning and evening peaks over a week to quantify how service headways vary.

Why choose this scraper

What you get
No API codingThe Actor calls transport.opendata.ch for you and parses the JSON into rows.
Bulk collectionPaid users can pull up to a million records in a single run for large-scale analysis.
Three query typesOne actor covers journey planning, departure boards, and station geocoding.
Consistent schemaAll results share a flat structure, so you can merge connection, departure, and location data.

How it compares

No other Store actor targets Swiss Transit OpenData the same way, so the honest comparison is with the alternatives teams actually weigh.

Swiss Transit OpenData ScraperBuild it in-houseBy hand
SetupRun it now, zero configDays of engineeringNone, but hours per pull
When Swiss Transit OpenData changesMaintained for youYou fix itYou re-learn the page
Proxies, retries, anti-botBuilt inYour problemBrowser only
OutputFixed JSON schema, CSV/Excel exportWhatever you buildCopy-paste
CostPay per resultEngineering timeAnalyst hours

Configure the run

Drive the Actor by picking a mode (Connections, Stationboard, or Locations) and filling the matching station names or search query. Optional date and time inputs let you target a specific travel moment. The Input tab lists every parameter.

A first run with the defaults:

{
"from": "Zurich",
"to": "Bern",
"maxItems": 10
}

A larger pull:

{
"from": "Zurich",
"to": "Bern",
"maxItems": 200
}

Pricing

Pay-per-result: $0.013 per result collected. You pay only for the results written to your dataset.

Results collectedApproximate cost
100 results$1.30
1,000 results$13.00
10,000 results$130.00

New Apify accounts start with $5 in free credit.

Free users

Free-plan runs return up to 10 results as a preview. Upgrade your Apify plan to collect up to 1,000,000 results per run.

Run it

  1. Create a free Apify account with $5 in credit.
  2. Open the Swiss Transit OpenData Scraper.
  3. Set your inputs and any filters, then click Start.
  4. Export the results as CSV, Excel, JSON, or XML from the Dataset tab.

Run it programmatically through the Apify API (run-sync-get-dataset-items) or the ApifyClient for JavaScript and Python.

Use with AI agents (MCP)

Give an AI agent live access to Swiss Transit OpenData through the Model Context Protocol. Add the Actor to Claude, Cursor, or any MCP client:

$claude mcp add --transport http apify "https://mcp.apify.com?tools=parseforge/swiss-transit-opendata-scraper"

Then prompt it in plain language to run the scraper and read back the results.

Troubleshooting

Why am I getting no results for my station name?

Station names must match what the API expects. Try the Locations mode first to search for the correct station name, then copy the exact name into your Connections or Stationboard query.

The Actor returns an error about missing fields.

Each mode requires specific inputs. Connections needs both From and To stations. Stationboard needs a Station name. Locations needs a Query. Check that you filled the fields matching your selected mode.

I set a future date but got no connections.

The API may not have timetable data far into the future. Try a date within the next 30 days. Swiss timetables are typically published several weeks ahead.

Why are delays missing from my departure data?

Delay information is only available when the upstream API provides it, typically for near-term departures. Historical or far-future queries usually do not include real-time delay data.

I hit the 10-item limit but need more data.

The 10-item limit applies to free Apify accounts. Upgrade to a paid plan to increase the maximum records up to 1,000,000 per run.

FAQ

QuestionAnswer
What data source does this actor use?It queries the official Swiss public transport OpenData API at transport.opendata.ch, which aggregates timetable information from Swiss Federal Railways (SBB) and other operators.
Can I get real-time delay information?The Stationboard mode returns delay estimates when the upstream API provides them. The data reflects what transport.opendata.ch publishes at the time of the request.
How do I search for a station if I do not know the exact name?Use the Locations mode with a partial name like 'Bern' or 'Zurich'. The API returns all matching stations with their full names and coordinates.
What is the difference between Connections and Stationboard?Connections returns a full journey from station A to station B with transfers. Stationboard returns all upcoming departures from a single station, similar to a departure board on the platform.
Can I set a future date for a journey?Yes, use the optional Date and Time fields in YYYY-MM-DD and HH:MM format. If left empty, the Actor defaults to the current date and time.
Does this cover buses and trams, or only trains?The transport.opendata.ch API covers trains, buses, trams, and some cable cars across Switzerland. The Actor returns whatever mode the API includes for your query.
How many records can I get in one run?Free users are limited to 10 items as a preview. Paid Apify users can set the maximum up to 1,000,000 records per run.
What format is the output data?The Actor returns a flat dataset you can export to CSV, JSON, Excel, or XML from the Apify platform.
Do I need an API key for transport.opendata.ch?No, the transport.opendata.ch API is open and does not require authentication. The Actor handles all requests directly.
Can I run multiple queries in one Actor run?Each run executes one mode with one set of inputs. To collect data for multiple routes or stations, run the Actor multiple times or use Apify's scheduling features.

Browse the full ParseForge collection for more scrapers.

πŸ†˜ Need help? Email parseforge@protonmail.com with your run ID, your input, and what you expected.

⚠️ Disclaimer. This Actor is unofficial and is not affiliated with, endorsed by, or sponsored by transport.opendata.ch. It collects only publicly available data. You are responsible for using the collected data in compliance with the source's terms of service and applicable data-protection laws, including GDPR, CCPA, and PIPL. Do not use it to collect personal data unlawfully.