/v1/connections
Plan a journey
Δοκιμάστε το ζωντανά
10 δωρεάν κλήσεις την ημέρα — χωρίς εγγραφή, χωρίς κλειδί API. Μέσω του gateway του oanor.
Δουλεύει. Πάρε ένα κλειδί API και χρησιμοποίησέ το στο έργο σου.
Λάβετε ένα κλειδί APIΑποσπάσματα κώδικα
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_..."}
)
Παράδειγμα απόκρισης
Πραγματική απόκριση αυτού του endpoint, από τον τελευταίο έλεγχο υγείας.
{
"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
…