Aller au contenu
GET /v1/connections

Plan a journey

Essayez-le en direct

10 appels gratuits par jour — sans inscription, sans clé API. Passe par la passerelle oanor.

En-têtes personnalisés (facultatif)
api.oanor.com/swisstransit-api

Ça marche. Récupérez une clé API et utilisez-la dans votre projet.

Obtenez une clé API

Extraits de code

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

Exemple de réponse

Une réponse réelle de ce endpoint, capturée lors du dernier contrôle de santé.

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