Discover/trenitalia.com API
live

trenitalia.com APItrenitalia.com

Access real-time Trenitalia train status, delays, station departure/arrival boards, ticket search, and traffic alerts via 8 structured API endpoints.

Endpoints
8
Updated
10d ago
Try it
Station name prefix to search (e.g. 'Roma', 'Milano', 'Napoli')
api.parse.bot/scraper/0bea8d74-c4a1-467d-8b53-8e860a100320/<endpoint>
Ready to send
Fill in the parameters and hit sign in to send to see live response data here.
Use it in your codegrab a free API key at signup
curl -X GET 'https://api.parse.bot/scraper/0bea8d74-c4a1-467d-8b53-8e860a100320/get_station_autocomplete?query=Roma' \
  -H 'X-API-Key: $PARSE_API_KEY'
All endpoints · 8 totalclick to expand

Autocomplete station name search for real-time data (ViaggiaTreno). Returns stations matching the given prefix with their IDs for use in other endpoints.

Input
ParamTypeDescription
queryrequiredstringStation name prefix to search (e.g. 'Roma', 'Milano', 'Napoli')
Response
{
  "type": "object",
  "fields": {
    "data": "array of station objects with id, label, nomeBreve, nomeLungo",
    "status": "string, always 'success'"
  },
  "sample": {
    "data": [
      {
        "id": "S08409",
        "label": "Roma",
        "nomeBreve": "ROMA TERMINI",
        "nomeLungo": "ROMA TERMINI"
      },
      {
        "id": "S08217",
        "label": "Roma",
        "nomeBreve": "ROMA TIBURTINA",
        "nomeLungo": "ROMA TIBURTINA"
      }
    ],
    "status": "success"
  }
}

About the trenitalia.com API

The Trenitalia API exposes 8 endpoints covering live train status, station boards, ticket availability, and network alerts across Italy's rail network. Use get_train_status to retrieve a train's current delay in minutes, its full stop itinerary, and origin/destination data, or call search_trains to query fares and schedules between any two stations by their 9-digit location IDs.

Station and Train Lookup

Two autocomplete endpoints handle identifier resolution before you query live data. get_station_autocomplete accepts a station name prefix and returns objects with id, nomeBreve, and nomeLungo fields — the id values (e.g. S08409 for Roma Termini) feed get_station_departures and get_station_arrivals. For ticket searches you need a different ID format: get_location_search returns 9-digit numeric IDs such as 830008409, along with displayName, multistation, and centroidId, which are required by search_trains. get_train_autocomplete resolves a train number to an origin_id and timestamp in milliseconds, both needed for precise status lookups.

Real-Time Train and Station Data

get_train_status returns a full picture of a running train: ritardo (delay in minutes), origine, destinazione, numeroTreno, and a fermate array listing each stop with its own timing and status. If you omit origin_id and timestamp, the endpoint auto-resolves them using the train number. Station boards are split into two endpoints: get_station_departures returns compOrarioPartenza, destinazione, ritardo, and categoriaDescrizione per train; get_station_arrivals mirrors that structure with origine and compOrarioArrivo.

Ticket Search and Traffic Alerts

search_trains takes an origin_id, destination_id, optional departure_time in ISO format (YYYY-MM-DDTHH:MM:SS.mmm), and optional passenger counts for adults and children. The response includes a searchId, cartId, and a solutions array with pricing, duration, and available service classes per train. get_traffic_info requires no parameters and returns current network disruption alerts with title, date, and content fields in Italian, sourced from the Infotraffico service.

Common use cases
  • Display a live departure board for any Italian station using get_station_departures with real-time ritardo delay data.
  • Build a train delay tracker that polls get_train_status for ritardo and fermate stop-by-stop timing.
  • Integrate fare comparison into a travel app by querying search_trains with adult/child counts and a departure time.
  • Alert commuters to active service disruptions by surfacing get_traffic_info alerts filtered by title or date.
  • Resolve arbitrary station names to IDs programmatically using get_station_autocomplete before querying boards.
  • Look up whether a specific train number is currently running via get_train_autocomplete before fetching its status.
  • Power an arrival notification service by monitoring get_station_arrivals for a target origine and expected compOrarioArrivo.
Pricing & limitsSee full pricing →
TierPriceCredits/monthRate limit
Free$0/mo1005 req/min
Hobby$30/mo1,00020 req/min
Developer$100/mo5,000250 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.

Frequently asked questions
Does Trenitalia offer an official developer API?+
Trenitalia does not publish a documented public developer API or issue API keys for third-party access. The data surfaces used are the ViaggiaTreno real-time platform and the Lefrecce booking interface, both intended for end users.
What does `get_train_status` return, and do I always need to supply `origin_id` and `timestamp`?+
The endpoint returns ritardo (delay in minutes), origine, destinazione, numeroTreno, and a fermate array of stops with individual timing data. Both origin_id and timestamp are optional — if you omit them, the endpoint resolves them automatically from the train number using the autocomplete lookup. Supply them explicitly when you want to target a specific scheduled departure.
Does the API cover international trains or only domestic Italian routes?+
The endpoints reflect the Trenitalia network, which is primarily domestic Italian rail. Cross-border routes operated by or partnered with Trenitalia may appear in results, but full international coverage (e.g. Austrian or French legs) is not guaranteed. You can fork this API on Parse and revise it to add an endpoint targeting a different European rail data source.
Does the API support searching trains for a past date or historical schedule data?+
The station board endpoints (get_station_departures, get_station_arrivals) return departures and arrivals around the current time and do not accept a date parameter. search_trains accepts a future departure_time. Historical schedule data and past departure boards are not currently covered. You can fork this API on Parse and revise it to add the missing historical endpoint if that surface becomes accessible.
Are ticket prices returned in `search_trains` responses, and which passenger types are supported?+
Yes — the solutions array in the search_trains response includes pricing alongside duration and service class details per train. Passenger counts are configurable via the adults and children integer parameters. Senior, loyalty, or regional discount fares beyond the adult/child split are not exposed as separate parameters in the current endpoint.
Page content last updated . Spec covers 8 endpoints from trenitalia.com.
Related APIs in TravelSee all →
opentable.ca API
Search and discover restaurants on OpenTable, view detailed information like menus and reviews, and check real-time dining availability across metro areas. Find top-rated restaurants in your location and instantly see which tables are open for your preferred date and time.
fandango.com API
Search for movies and retrieve nearby theater listings with showtimes by ZIP code and date, plus showtimes for a specific movie at nearby theaters.
data.lime.bike API
Access real-time availability data for Lime bikes and scooters, including station locations, vehicle status, system alerts, and geofencing zones across multiple cities. Monitor micromobility inventory and service information to find nearby vehicles or plan your trips effectively.
turo.com API
Search for peer-to-peer car rentals across Turo by location and dates to browse available vehicles with pricing, specifications, and real-time availability. Get detailed information on specific cars to compare features and make rental decisions.
reservation.pc.gc.ca API
Access real-time campground availability and reservation data from the Parks Canada booking system. Search locations, retrieve available campsites and cabins, filter by equipment type, and review operating date schedules across the national park network. Includes detailed resource metadata and map-based availability overviews.
bahn.com API
Search German train schedules and stations, find connections between destinations, and compare ticket prices across Deutsche Bahn routes. Get real-time station information and transit association details to plan your train journey efficiently.
united.com API
Search United Airlines flights, check real-time flight status, and view detailed seat maps to plan your perfect trip. Compare fare options and use airport autocomplete to quickly find your departure and arrival cities.
thetrainline.com API
Search UK train stations and find the cheapest fares across date ranges, then generate direct booking links to complete your purchase on Trainline.com. Get real-time journey information to compare prices and book your tickets in seconds.
Trenitalia API – Train Status, Schedules & Tickets · Parse