Zum Inhalt springen
GET /v1/connections

Plan a journey

Live testen

10 freie Calls pro Tag — keine Anmeldung, kein API-Key. Geht durchs oanor-Gateway.

Eigene Header (optional)
api.oanor.com/swisstransit-api

Funktioniert. Hol dir einen API-Key und nutze sie in deinem Projekt.

API-Key holen

Code-Snippets

curl "https://api.oanor.com/swisstransit-api/v1/connections" \
  -H "x-oanor-key: oanor_test_..."
await fetch("https://api.oanor.com/swisstransit-api/v1/connections", {
  headers: { "x-oanor-key": "oanor_test_..." }
});
$ch = curl_init("https://api.oanor.com/swisstransit-api/v1/connections");
curl_setopt($ch, CURLOPT_HTTPHEADER, ["x-oanor-key: oanor_test_..."]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$out = curl_exec($ch);
import requests
requests.get(
    "https://api.oanor.com/swisstransit-api/v1/connections",
    headers={"x-oanor-key": "oanor_test_..."}
)

Beispiel-Response

Echte Antwort dieses Endpoints, erfasst beim letzten Health-Check.

{
    "data": {
        "to": "Zurich",
        "from": "Bern",
        "count": 4,
        "connections": [
            {
                "legs": [
                    {
                        "to": "St. Gallen",
                        "from": "Bern",
                        "line": "IC 1",
                        "type": "transit",
                        "arrival": "2026-06-01T19:28:00+0200",
                        "departure": "2026-06-01T18:31:00+0200",
                        "departure_platform": "8"
                    }
                ],
                "arrival": "2026-06-01T19:28:00+0200",
                "products": [
                    "IC 1"
                ],
                "departure": "2026-06-01T18:31:00+0200",
                "transfers": 0,
                "arrival_platform": "33",
                "duration_minutes": 61,
                "departure_platform": "8"
            },
            {
                "legs": [
                    {
                        "to": "Zürich HB",
                        "from": "Bern",
                        "line": "IR 16",
                        "type": "transit",
                        "arrival": "2026-06-01T19:54:00+0200",
                        "departure": "2026-06-01T18:36:00+0200",
                        "departure_platform": "12"
                    }
                ],
                "arrival": "2026-06-01T19:54:00+0200",
                "products": [
                    "IR 16"
                ],
                "departure": "2026-06-01T18:36:00+0200",
                "transfers": 0,
                "arrival_platform": "15",
                "duration_minutes": 77,
                "departure_platform": "12"
            },
            {
                "legs": [
                    {
                        "to": "Romanshorn",
                        "from": "Bern",
                        "line": "IC 8",
                        "type": "transit",
                        "arrival": "2026-06-01T19:58:00+0200",
                        "departure": "2026-06-01T19:02:00+0200",
                        "departure_platform": "2"
                    }
                ],
                "arrival": "2026-06-01T19:58:00+0200",
                "products": [
                    "IC 8"
                ],
                "departure": "2026-06-01T19:02:00+0200",
                "transfers": 0,
                "arrival_platform": "34",
                "duration_minutes": 65,
                "departure_platform": "2"
            },
            {
                "legs": [
                    {
                        "to": "St. Gallen",
                        "from": "Bern",
                        "line": "IC 1",
                        "type": "transit",
                        "arrival": "2026-06-01T20:28:00+0200",
                        "departure": "2026-06-01T19:31:00+0200",
                        "departure_platform": "8"
                    }
                ],
                "ar
…