Ir al contenido
GET /v1/connections

Plan a journey

Pruébalo en vivo

10 llamadas gratis al día — sin registro, sin clave API. Pasa por el gateway de oanor.

Encabezados personalizados (opcional)
api.oanor.com/swisstransit-api

Funciona. Consigue una clave API y úsala en tu proyecto.

Obtener una clave API

Fragmentos de código

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_..."}
)

Respuesta de ejemplo

Una respuesta real de este endpoint, capturada en la última comprobación de estado.

{
    "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
…