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

Tap Swiss public transport data from transport.opendata.ch. Query journeys between two stations, live departure boards, or search stations by name. Returns stations, coordinates, departure and arrival times, platform, duration, transfers, and line. Useful for travel and route planning.

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

6 days ago

Last modified

Share

ParseForge Banner

🚆 Swiss Transit OpenData Scraper

🚀 Export Swiss public transport data in seconds. Pull journeys, live departure boards, and station search results straight from transport.opendata.ch.

🕒 Last updated: 2026-06-08 · 📊 Up to 21 fields per record · 3 query modes · nationwide Swiss coverage

Turn Swiss public transport into clean, structured records you can drop into a travel app, a route planner, a timetable widget, or a data pipeline. Pick one of three modes (connections, stationboard, or locations) and get departure and arrival times, platforms, durations, transfers, coordinates, and line details in a consistent shape.

Coverage is the full public transport network served by transport.opendata.ch: trains, trams, buses, boats, and cable cars across Switzerland. Search any station by name, plan a journey between two stops, or read the live departure board for a single station. No account and no API key are required.

🎯 Target Audience💡 Primary Use Cases
Travel and route planning appsPlan journeys and show live departures
Mobility and logistics teamsFeed Swiss schedules into routing tools
Data analysts and researchersStudy connections, transfers, and delays
Hobbyists and bot buildersBuild a departure board or trip notifier

📋 What the Swiss Transit OpenData Scraper does

This Actor calls the public transport.opendata.ch API and returns one clean record per item for the mode you choose:

  • Connections — journeys between a from and a to station, with departure and arrival times, platforms, duration, transfer count, products, and the first leg's line and operator.
  • Stationboard — upcoming departures from a single station, with destination, departure time, delay, platform, category, and line.
  • Locations — station search by name, returning matched station names, IDs, coordinates, and icon type.

Every record carries a recordType so you can tell the modes apart, plus a scrapedAt timestamp.

🎬 Full Demo (🚧 Coming soon)

⚙️ Input

FieldTypeDescription
modeselectWhat to query. One of connections, stationboard, or locations. Defaults to connections.
fromstringConnections mode only. Departure station name, e.g. Zurich.
tostringConnections mode only. Destination station name, e.g. Bern.
stationstringStationboard mode only. Station whose departures you want, e.g. Zurich HB.
querystringLocations mode only. Partial or full station name to search, e.g. Luzern.
datestringOptional. Date in YYYY-MM-DD for connections or departures. Defaults to today.
timestringOptional. Time in 24-hour HH:MM for connections or departures. Defaults to now.
maxItemsintegerHow many records to return. Free plan is capped at 10.

Example 1 — journey from Zurich to Bern

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

Example 2 — live departures from Basel SBB

{
"mode": "stationboard",
"station": "Basel SBB",
"maxItems": 20
}

⚠️ Good to Know: Each mode uses a different set of inputs. Connections needs from and to, stationboard needs station, and locations needs query. The output fields also differ by mode, so use the recordType field to branch your logic.

📊 Output

Fields shared and mode-specific records are described below. Common fields appear in every record.

FieldDescription
🧭 recordTypeRecord kind: connection, departure, or location
🚉 fromStationOrigin (or matched/board) station name
🆔 fromStationIdOrigin station ID
📍 fromLatOrigin latitude
📍 fromLonOrigin longitude
🏁 toStationDestination station name
🆔 toStationIdDestination station ID (connections)
📍 toLatDestination latitude (connections)
📍 toLonDestination longitude (connections)
🕐 departureDeparture time (ISO)
departureTimestampDeparture UNIX timestamp
🕑 arrivalArrival time (connections)
arrivalTimestampArrival UNIX timestamp (connections)
🛤 platformDeparture platform
🛤 arrivalPlatformArrival platform (connections)
durationJourney duration (connections)
🔁 transfersNumber of transfers (connections)
🚆 productsLines used on the journey (connections)
delayDeparture delay in minutes (departures)
🏷 categoryTransport category, e.g. IC, S, B
#️⃣ lineNumberLine number
🏢 operatorOperating company
🎯 headsignDirection/headsign of the first leg (connections)
🪧 nameService name (departures)
🖼 iconStation icon type (locations)
🕒 scrapedAtCollection timestamp
errorNull on success

Real sample — connection

{
"recordType": "connection",
"fromStation": "Zürich HB",
"fromStationId": "8503000",
"fromLat": 47.377847,
"fromLon": 8.540502,
"toStation": "Bern",
"toStationId": "8507000",
"toLat": 46.948832,
"toLon": 7.439136,
"departure": "2026-06-08T18:02:00+0200",
"departureTimestamp": 1781280120,
"arrival": "2026-06-08T19:00:00+0200",
"arrivalTimestamp": 1781283600,
"platform": "31",
"arrivalPlatform": "6",
"duration": "00d00:58:00",
"transfers": 0,
"products": ["IC 1"],
"category": "IC",
"lineNumber": "1",
"operator": "SBB",
"headsign": "Genève-Aéroport",
"scrapedAt": "2026-06-08T16:00:00.000Z",
"error": null
}

Real sample — departure

{
"recordType": "departure",
"fromStation": "Basel SBB",
"fromStationId": "8500010",
"fromLat": 47.547412,
"fromLon": 7.589563,
"toStation": "Zürich HB",
"departure": "2026-06-08T18:04:00+0200",
"departureTimestamp": 1781280240,
"delay": 0,
"platform": "8",
"category": "IC",
"lineNumber": "3",
"operator": "SBB",
"name": "IC 3",
"scrapedAt": "2026-06-08T16:00:00.000Z",
"error": null
}

Real sample — location

{
"recordType": "location",
"fromStation": "Luzern",
"fromStationId": "8505000",
"fromLat": 47.050168,
"fromLon": 8.310015,
"icon": "train",
"scrapedAt": "2026-06-08T16:00:00.000Z",
"error": null
}

✨ Why choose this Actor

  • One clean record per item, with a recordType flag so all three modes share a consistent table.
  • Coordinates included on every station, ready for mapping.
  • Departure and arrival times come as both ISO strings and UNIX timestamps.
  • No transit account, no key, and no login required.
  • Stable field names that map cleanly onto a database schema.

📈 How it compares to alternatives

ApproachEffortStructured fieldsCoordinates includedMaintenance
This ActorOne runYesYesNone on your side
Copying from a timetable siteHoursInconsistentManualConstant
Writing your own API clientDaysDependsManualYou own the upkeep

🚀 How to use

  1. Create a free Apify account using this sign-up link.
  2. Open the Swiss Transit OpenData Scraper.
  3. Choose a mode (connections, stationboard, or locations).
  4. Fill the inputs for that mode and set maxItems.
  5. Click Start and grab your results when the run finishes.

💼 Business use cases

Travel and route planning

GoalHow this helps
Show journeys between two stationsUse connections mode with times and transfers
Display a live departure boardUse stationboard mode with delays and platforms

Mobility and logistics

GoalHow this helps
Feed Swiss schedules into routingPull connections with line and operator data
Map station locationsUse the coordinate fields on every record

Analytics and research

GoalHow this helps
Study transfer patternsGroup connections by transfer count and products
Track delays over timeSnapshot stationboard departures on a schedule

Apps and bots

GoalHow this helps
Build a trip notifierPoll connections for a route and alert on changes
Power a station lookupUse locations mode for autocomplete

🔌 Automating Swiss Transit OpenData Scraper

Connect runs to the tools you already use:

  • Make and Zapier to trigger runs and route records into sheets or databases.
  • Slack to post a departure summary when a run finishes.
  • Airbyte to load results into a warehouse.
  • GitHub Actions to schedule periodic snapshots.
  • Google Drive to archive each run's output.

🌟 Beyond business use cases

  • Research: study Swiss transit connectivity and transfer patterns.
  • Personal: build your own commuter departure board.
  • Non-profit: power a community mobility resource.
  • Experimentation: prototype a travel app without writing a scraper.

🤖 Ask an AI assistant

Paste your results into ChatGPT, Claude, Perplexity, or Microsoft Copilot and ask it to compare routes, summarize departures, or find the fastest connection.

❓ Frequently Asked Questions

Do I need a transport.opendata.ch account? No. The Actor reads the public API, which needs no login.

Do I need an API key? No key is required.

Which modes can I use? Connections, stationboard, and locations. Pick one per run with the mode input.

Which inputs does each mode need? Connections needs from and to, stationboard needs station, and locations needs query.

Can I query a specific date and time? Yes. Use the optional date (YYYY-MM-DD) and time (HH:MM) inputs for connections and stationboard.

Are coordinates included? Yes. Every station record carries latitude and longitude fields.

Why do output fields differ between records? Each mode returns a different set of fields. Use the recordType field to branch your logic.

What transport types are covered? Trains, trams, buses, boats, and cable cars across the Swiss network.

How fresh is the data? Each run pulls live from transport.opendata.ch, so departures and delays reflect run time.

Can I schedule this? Yes. Use Apify Schedules to snapshot routes or departures on any cadence.

🔌 Integrate with any app

Results are available through the Apify API, so you can pull them into any app, database, or workflow you already run.

💡 Pro Tip: browse the complete ParseForge collection.

🆘 Need Help? Open our contact form

⚠️ Disclaimer: independent tool, not affiliated with transport.opendata.ch or the Swiss transport operators. Only publicly available data is collected.