Find direct routes between cities

Find direct scheduled flights and trains between city pairs, and know when to search for a journey with changes.

Use the city-to-city route API to check which direct services run between two cities. Find each ID with city search, then query /v1/connections in the direction you want to travel. Set the quickstart environment variables before running this query.

curl -fsS --get "$TRIP_TOPOLOGY_URL/v1/connections" \
  -H "Authorization: Bearer $TRIP_TOPOLOGY_KEY" \
  --data-urlencode 'from=geonames:2988507' \
  --data-urlencode 'to=geonames:2996944' \
  --data-urlencode 'limit=1' |
  jq '.data[] | {mode, label, departure_time, arrival_time, schedule: .schedule.summary}'

The first Paris to Lyon pattern in the snapshot:

{
  "mode": "air",
  "label": "AF7360",
  "departure_time": "07:50",
  "arrival_time": "08:55",
  "schedule": "Runs Sat"
}

Reverse the IDs to check the other direction. For a specific station or airport pair, use the place IDs instead of city IDs. Check meta.from and meta.to to confirm which endpoints resolved. Inspect the pattern’s own from and to to find where to board and alight. Follow the cursor to read the remaining patterns.

A direct service can make intermediate stops. If there are no direct patterns, or you need an option on a particular date, search for a dated journey. Don’t infer a timed transfer by joining two date-free patterns.