An airport map starts the moment you pick an airport. A city map can start a step earlier. What can I reach by train or plane without changing vehicles? We’ll use Paris to turn that question into a GeoJSON file you can open in a map viewer.
The diagram shows four links from the export. The lines represent direct service, not tracks, flight paths or airport access. The Paris to Lyon route preview shows what a link can tell you about a city pair.
Create the GeoJSON
Use Node.js 22 or later and the API URL and key from the quickstart. Run this script locally or on a server. Don’t put your API key in a browser bundle.
The API returns one row per reachable place, not per destination city. In this snapshot the Paris query starts from Gare de Lyon and Charles de Gaulle Airport. The example uses the city centre as the common start of each line, so the map doesn’t claim which platform or terminal the route leaves from. For a map starting at the actual station or airport, query its place ID instead.
Save this as route-map.mjs:
const { TRIP_TOPOLOGY_URL, TRIP_TOPOLOGY_KEY } = process.env;
const headers = { Authorization: `Bearer ${TRIP_TOPOLOGY_KEY}` };
async function get(path, params) {
const url = new URL(path, TRIP_TOPOLOGY_URL);
url.search = new URLSearchParams(params);
const response = await fetch(url, { headers });
if (!response.ok) throw new Error(`${url.pathname}: HTTP ${response.status}`);
return response.json();
}
const id = "geonames:2988507";
const origin = await get(`/v1/cities/${encodeURIComponent(id)}`);
const xy = (point) => [point.longitude, point.latitude];
const features = [];
let cursor;
do {
const page = await get("/v1/destinations", {
from: id,
limit: "100",
...(cursor ? { cursor } : {}),
});
if (page.meta.network !== origin.meta.network) {
throw new Error("Network changed. Rerun the export.");
}
for (const { place, modes } of page.data) {
for (const mode of modes.filter((m) => m === "air" || m === "rail")) {
features.push({
type: "Feature",
properties: { id: place.id, name: place.name, mode },
geometry: {
type: "LineString",
coordinates: [xy(origin.data), xy(place)],
},
});
}
}
cursor = page.meta.next_cursor;
} while (cursor);
console.log(JSON.stringify({ type: "FeatureCollection", features }));
node route-map.mjs > paris.geojson
Open the file in a GeoJSON viewer such as QGIS, or pass it to Leaflet’s GeoJSON layer. Style the lines by properties.mode. If a place is reachable by both modes, the two lines will have identical coordinates. Make each mode a toggleable layer so one doesn’t hide the other.
Check what your map actually says
Use the response row’s modes for the link. A station might have trains, buses and trams, but only one of those modes gets there from your origin. The nested place.modes describes the destination in general. Drawing that list would put links on the map that the API never returned.
On the 29 November 2026 snapshot, the script wrote 156 air lines and 99 rail lines. They’re links to destination places, not cities, and reflect all recurring patterns returned from Paris rather than a single day.
Snapshot ID:
c00a9a9c0d4605cda1232df2cce43eb8deb5da43c652c63b8ed75a0edb38d527
Coverage varies by region and operator. Ground data is selective. Some flights come from observations or carry forward beyond the last published dates. Holidays and one-off exceptions may be missing. An omitted line doesn’t prove a service is unavailable, and a line that appears doesn’t promise a departure on any given day.
For a map of a trip you could take on a particular date, use the guide to plotting a dated journey. Start with a free API key, or point your agent to llms.txt for the endpoint reference.