To APIgtt.to.it ↗
Access GTT Turin public transport data: service basins, line routes, stop lists, full-day timetables, real-time arrivals, and stop accessibility via 9 endpoints.
What is the To API?
The GTT Turin Transit API exposes 9 endpoints covering the full depth of Turin's GTT public transport network — from enumerating service basins and lines to fetching full-day departure schedules at every stop on a route. The get_percorso_schedule endpoint returns ordered stop lists with all timed departures for any route code and service date, while get_stop_realtime delivers live arrival predictions keyed to a stop code.
No input parameters required.
curl -X GET 'https://api.parse.bot/scraper/559cc6d3-d8a1-4547-9bea-ee0e78b2dcae/list_bacini' \ -H 'X-API-Key: $PARSE_API_KEY'
Typed, relational, agent-ready
A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.
- Fully typed · autocompletes
- Objects link to objects
- Typed errors & pagination
Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:
uv add parse-sdk uv run parse init uv run parse add --marketplace gtt-to-it-api
uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.
"""
GTT (Torino) Bus/Tram Schedules API — SDK usage example.
Discover transit lines, look up routes and schedules, and check real-time arrivals.
"""
from parse_apis.gtt__torino__bus_tram_schedules_api import GTT, ServiceBasin
gtt = GTT()
# Search for a stop by name fragment
results = gtt.stopsearchresults.search(term="SANSOVINO")
for stop in results:
print(stop.value, stop.data, stop.bacino)
# Pick the first matching stop and get real-time arrivals
first_stop = results[0]
realtime = gtt.stoprealtimes.get(palina=first_stop.value, bacino=ServiceBasin.URBAN)
print(realtime.codice, realtime.nome, realtime.ubicazione)
for transit in realtime.transiti:
print(transit.linea, transit.direzione, transit.passaggi_list)
# List all urban lines
lines = gtt.lines.list(bacino=ServiceBasin.URBAN)
for line in lines:
print(line.linea, line.description)
# Get line detail with all routes (percorsi)
details = gtt.linedetails.list(linea="3", bacino=ServiceBasin.URBAN)
for detail in details:
print(detail.linea, detail.tipo_mezzo, detail.nomesteso)
for route in detail.percorsi:
print(route.codice, route.verso, route.descrizione)
# Get full route geometry and stops
route_detail = gtt.routedetails.get(linea="3", codice="03A1", verso="As", bacino=ServiceBasin.URBAN)
print(route_detail.linea, route_detail.descrizione)
for fermata in route_detail.fermate:
print(fermata.codice, fermata.nome, fermata.lat, fermata.lon)
# Get schedule for a specific route on a given day
schedule = gtt.routeschedules.get(linea="3", codice="03A1", verso="As", giorno="20260610")
print(schedule.linea, schedule.percorso_codice, schedule.giorno)
for sched_stop in schedule.stops:
print(sched_stop.stop_code, sched_stop.stop_name, sched_stop.departures)
# Get accessibility info, nearby resellers and parking
accessibility = gtt.stopaccessibilities.get(palina="171", bacino=ServiceBasin.URBAN, nminuti=30)
print(accessibility.codice, accessibility.nome)
for reseller in accessibility.rivendite:
print(reseller.tipo, reseller.ubicazione, reseller.distanza)
for stallo in accessibility.stalli:
print(stallo.ubicazione, stallo.distanza)
List service basins (bacini) available in the GTT schedule system. Each basin represents a transport service category: U (urban/suburban), E (extraurban), T (tourist), F (railway). No parameters required.
No input parameters required.
{
"type": "object",
"fields": {
"bacini": "array of basin objects with codice and descrizione"
},
"sample": {
"data": {
"bacini": [
{
"codice": "U",
"descrizione": "GTT Servizio Urbano"
},
{
"codice": "T",
"descrizione": "GTT Servizi Turistici"
},
{
"codice": "F",
"descrizione": "GTT Servizio Ferroviario"
},
{
"codice": "E",
"descrizione": "GTT Servizio Extraurbano"
}
]
},
"status": "success"
}
}About the To API
Line and Route Enumeration
Start with list_bacini to retrieve the four service basin codes (U for urban/suburban, E for extraurban, T for tourist, F for railway), then pass a bacino value to list_lines to get every line in that basin. Each line object includes linea, label, description, regol, and a percorsi_url. From there, get_line_percorsi accepts a linea code and returns the full percorsi array — each entry carries codice, verso, descrizione, fermate, polyline, and supplydays. The codice/verso pairs from this response are required inputs for downstream schedule and geometry endpoints. Note that upstream response times for some lines can reach 60 seconds.
Schedules and Route Geometry
get_percorso_schedule is the core timetable endpoint. Supply linea, codice, verso, and an optional giorno in YYYYMMDD format (defaults to today) to receive a stops array where each entry contains stop_code, stop_name, accessible, location, and a full departures list for the day. For route geometry only, get_percorso returns fermate (ordered stops with lat, lon, disabili, and lineeInters) plus a polyline array of coordinate objects. To pull schedules for multiple lines in one call, get_all_schedules pages through a basin's lines using start and limit parameters; keep limit between 1 and 3 to stay within upstream latency constraints. An optional include_types parameter (e.g. Bus,Tram) filters results by vehicle type.
Stop Search and Real-Time Arrivals
search_stops accepts a name fragment or stop code as term and returns matching stops with value (stop code), data (stop name), bacino, and localita. Use the returned stop code as the palina parameter in get_stop_realtime, which returns transiti — an array of upcoming line arrivals with linea, direzione, passaggi (semicolon-separated times string), and passaggi_list (parsed array). Setting realtime=false switches to scheduled-only mode but may noticeably increase response time.
Accessibility and Nearby Services
get_stop_accessibility extends the arrivals view with accessibility-specific fields. In addition to transiti (which include per-vehicle accessibility and tap-and-go status), it can return stalli (nearby accessible parking with ubicazione, distanza, and punto) and rivendite (nearby ticket resellers with tipo, orario, distanza, and punto). Control which data blocks are returned via the stalli and rivendite boolean parameters; nminuti sets the look-ahead window in minutes.
The To API is a managed, monitored endpoint for gtt.to.it — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when gtt.to.it changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.
This isn't an official gtt.to.it API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.
Will this API break when the source site changes?+
Is this an official API from the source site?+
Can I fix or extend this API myself if I need a new endpoint or field?+
What happens if I call an endpoint that has an issue?+
- Build a trip planner that maps all stops on a GTT route using fermate lat/lon coordinates from get_percorso.
- Generate a full-day timetable display for any bus or tram line by stop using get_percorso_schedule with a specific giorno.
- Create a departure board app for a Turin stop showing live arrival predictions via get_stop_realtime.
- Audit GTT service coverage by bulk-extracting all urban basin schedules with get_all_schedules paginated across lines.
- Find ticket resellers and accessible parking near any stop using get_stop_accessibility with rivendite and stalli flags.
- Power a stop autocomplete search field using the term parameter of search_stops.
- Compare scheduled versus real-time arrivals at a stop by toggling the realtime parameter in get_stop_realtime.
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 100 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 100 req/min |
One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does GTT publish an official developer API?+
What does get_percorso_schedule return, and how do I target a specific day?+
stops array for the given route, where each stop object contains stop_code, stop_name, accessible, location, and a departures list covering the full service day. Pass giorno in YYYYMMDD format to target a specific date; omitting it defaults to today. The codice and verso inputs must be a matched pair from get_line_percorsi.Why are some requests slow, and what can I do about it?+
limit parameter between 1 and 3 lines per call reduces the chance of timeouts. For get_stop_realtime, setting realtime=false switches to scheduled-only mode but may also increase latency compared to the real-time mode.Does the API cover historical schedule data or multi-day range queries?+
giorno parameter — there is no endpoint for historical archives or date-range batch queries. It covers today's schedule by default, or any single date you supply. You can fork this API on Parse and revise it to add a date-range looping endpoint that aggregates results across multiple days.Are extraurban, tourist, and railway lines included, or only urban bus and tram routes?+
bacino code to list_lines or get_all_schedules to target a specific basin. Not all basins may have equivalent real-time arrival data; the real-time feed depth varies by service type.