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
1mo 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 →
rfi.it API
Check real-time train schedules and station information across Italy's railway network, search for stations, and get live alerts about delays and service disruptions. Monitor train circulation status and access detailed station mappings to plan your journeys efficiently.
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.
railyatri.in API
Search trains between stations and get real-time information including live train status, timetables, seat availability, and PNR confirmation details. Find the perfect journey by autocompleting station and train names while checking current availability and train schedules.
amtrak.com API
Search for Amtrak trains across stations, compare fares, and discover discounts to plan your rail journey with current pricing and availability. Get detailed train information, autocomplete station names, and find the cheapest routes for your travel dates.
trainline.eu API
Search for train stations and routes across the UK and Europe, then find and compare available journeys with schedules and pricing. Book your ideal train trip by accessing real-time travel options directly from Trainline.com.
nationalrail.co.uk API
Check live train departure and arrival times at UK stations, search for specific stations, and get real-time service disruption alerts. Stay informed about rail service delays and changes to plan your journeys efficiently.
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.
enquiry.indianrail.gov.in API
Search for trains between Indian stations, check schedules, and look up station details to plan your rail journeys. Get real-time train information with support for captcha-protected searches to ensure reliable access to Indian Railways data.
Trenitalia API – Train Status, Schedules & Tickets · Parse