Discover/RFI API
live

RFI APIrfi.it

Access live Italian train departures/arrivals, station search with region filters, circulation alerts, and station service details via the RFI.it API.

Endpoint health
verified 4d ago
get_station_mappings
get_infomobilita_alerts
get_live_monitor
get_station_details
search_stations
5/5 passing latest checkself-healing
Endpoints
5
Updated
21d ago

What is the RFI API?

The RFI.it API covers Italy's national railway network across 5 endpoints, returning live departure and arrival boards, station metadata, and real-time circulation alerts. The get_live_monitor endpoint streams current train status — including delay, platform, and carrier — for any Italian station identified by name or numeric place ID. Companion endpoints handle station search with geographic filters, detailed service listings, and the full station-to-placeId mapping table.

Try it

No input parameters required.

api.parse.bot/scraper/776b2149-49fb-4540-acd6-822e63ec0345/<endpoint>
Ready to send
Fill in the parameters and hit sign in to send to see live response data here.
Call it over HTTPgrab a free API key at signup
curl -X GET 'https://api.parse.bot/scraper/776b2149-49fb-4540-acd6-822e63ec0345/get_station_mappings' \
  -H 'X-API-Key: $PARSE_API_KEY'
Python SDK · recommended

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 rfi-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.

"""Walkthrough: RFI Italian Railway API — bounded, re-runnable; every call capped."""
from parse_apis.rfi_italian_railway_api import RFI, Station, StationDetail, LiveBoard, StationMapping, Alert, BoardType, StationNotFound

rfi = RFI()

# Fetch full station-name-to-placeId mapping
mapping = rfi.stationmappings.fetch()
print(mapping.total, list(mapping.mappings.items())[:3])

# Search for stations in the Lazio region containing "Roma"
for station in rfi.stations.search(region="Lazio", query="Roma", limit=5):
    print(station.name, station.province, station.passenger_service)

# Get detailed station info by slug
detail = rfi.stationdetails.get(slug="roma-termini")
print(detail.name, detail.slug, detail.services, detail.accessibility)

# Fetch live departure board using the BoardType enum
board = rfi.liveboards.fetch(station_name="ROMA TERMINI", type=BoardType.DEPARTURES)
print(board.station, board.type)
for train in board.trains[:3]:
    print(train.train_number, train.category, train.destination, train.scheduled_time, train.delay)

# Retrieve current circulation alerts
current_alerts = rfi.alerts.list()
for msg in current_alerts.alerts[:3]:
    print(msg)

# Typed error handling: catch StationNotFound for an invalid slug
try:
    rfi.stationdetails.get(slug="nonexistent-station-xyz")
except StationNotFound as exc:
    print(f"Station not found: {exc.station_slug}")

print("exercised: stationmappings.fetch / stations.search / stationdetails.get / liveboards.fetch / alerts.list / StationNotFound")
All endpoints · 5 totalmissing one? ·

Retrieve the complete station name to placeId mapping used by the live monitor. Returns all Italian railway station names mapped to their numeric place IDs.

Input

No input parameters required.

Response
{
  "type": "object",
  "fields": {
    "total": "integer count of stations",
    "mappings": "object mapping uppercase station names to string place IDs"
  },
  "sample": {
    "data": {
      "total": 2426,
      "mappings": {
        "ABANO TERME": "364",
        "ROMA TERMINI": "2218",
        "MILANO CENTRALE": "1700"
      }
    },
    "status": "success"
  }
}

About the RFI API

Live Train Boards

The get_live_monitor endpoint returns the real-time departures or arrivals board for a given station. Pass either a place_id (numeric string from get_station_mappings) or a full uppercase station_name such as ROMA TERMINI. The response includes an array of train objects, each carrying carrier, category, train_number, destination (or origin for arrivals), scheduled_time, delay, and platform. The type field in the response confirms whether you received a departures or arrivals board.

Station Search and Details

search_stations queries the RFI GIS service and supports filtering by region (e.g. Lombardia), province, municipality, and a partial-match query string. Each result includes name, region, province, municipality, type, passenger_service, and manager. The limit parameter caps the result count. For richer per-station data, get_station_details accepts a station_slug (e.g. roma-termini) and returns arrays of services (such as Bar, caffetteria, ristorazione or Bici) and accessibility features.

Station Mappings and Alerts

get_station_mappings returns the complete lookup table that maps uppercase station names to their numeric place_id strings — useful for building autocomplete or validating station names before calling get_live_monitor. The get_infomobilita_alerts endpoint pulls the current Infomobilità ticker from the RFI homepage and returns an alerts array of plain-text strings describing active line disruptions, speed restrictions, and service updates across the network.

Reliability & maintenanceVerified

The RFI API is a managed, monitored endpoint for rfi.it — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when rfi.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 rfi.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.

Last verified
4d ago
Latest check
5/5 endpoints passing
Maintenance
Monitored & self-healing
Will this API break when the source site changes?+
It's built not to. Every endpoint is health-checked on a schedule with automated test probes. When the source site changes and a check fails, the API is automatically queued for repair and re-verified — that's the self-healing layer. Each API page shows when its endpoints were last verified. And because marketplace APIs are shared, any fix reaches everyone using it.
Is this an official API from the source site?+
No — Parse APIs are independent, managed REST wrappers over publicly available data. That is the point: where a site has no official API (or only a limited one), Parse gives you a maintained, monitored endpoint for that data and keeps it working as the site changes — so you get a stable contract over a source that never promised one.
Can I fix or extend this API myself if I need a new endpoint or field?+
Yes — and you don't have to wait on us. This API was generated by the Parse agent, which stays attached. Describe the change in plain English ("add an endpoint that returns reviews", "fix the price field") in the revise box on the API page or via the revise_api MCP tool, and the agent rebuilds it against the live site in minutes. Contributing the change back to the public API is free.
What happens if I call an endpoint that has an issue?+
Errors are machine-readable: a bad call returns a clean status with the list of available endpoints and a repair hint, so an agent (or you) can recover or trigger a fix instead of failing silently. Confirmed failures feed the automatic repair queue.
Common use cases
  • Build a departure board widget for Italian stations using get_live_monitor with real-time delay and platform data.
  • Filter stations by region or province via search_stations to populate a geographic station picker.
  • Display current service disruptions in a travel app by polling get_infomobilita_alerts for active circulation messages.
  • Map station names to place IDs at startup using get_station_mappings to avoid manual lookup tables.
  • Show accessible station options to mobility-impaired travellers using the accessibility array from get_station_details.
  • Aggregate delay statistics across multiple stations by periodically calling get_live_monitor and recording the delay field per train.
Pricing & limitsSee full pricing →
TierPriceCredits/monthRate limit
Free$0/mo1005 req/min
Hobby$30/mo1,00020 req/min
Developer$100/mo5,000100 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 RFI have an official public developer API?+
RFI does not publish a documented public developer API for live train data or station information. The data accessed through this API comes from rfi.it directly.
What does `get_live_monitor` return, and how do I identify the station?+
It returns a trains array where each object contains carrier, category, train_number, destination (or origin for arrivals), scheduled_time, delay, and platform, plus a top-level station name and type field. You identify the station with either a place_id string (from get_station_mappings) or a full uppercase station_name such as MILANO CENTRALE.
Does the API cover historical train schedules or only the current live board?+
get_live_monitor reflects the current real-time board only; no historical departure or arrival records are returned. The API covers live status, station metadata, and current alerts. You can fork it on Parse and revise it to add an endpoint targeting historical timetable data if that surface becomes available.
Can I filter `get_infomobilita_alerts` by specific line or region?+
The endpoint returns all current alerts as a flat array of text strings with no built-in filter parameters. Filtering by line or region would need to be done client-side on the alerts array. You can fork the API on Parse and revise it to add server-side filtering logic.
Are international trains (e.g. routes to France or Switzerland) included in the live monitor?+
The live monitor covers stations in the Italian national railway network as managed by RFI. International segments operated outside Italy are not exposed as separate station entries. Trains with cross-border routes may appear on a departure board at their Italian origin station. You can fork the API on Parse and revise it to integrate timetable data from partner networks for international coverage.
Page content last updated . Spec covers 5 endpoints from rfi.it.
Related APIs in TravelSee all →
trenitalia.com API
Search for trains across Italy, check real-time train status and delays, view station departure and arrival boards, and find available tickets all in one place. Get live traffic information and detailed train itineraries to plan your journey with complete visibility into schedules and service disruptions.
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.
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.
ratp.fr API
Monitor real-time traffic conditions and service disruptions across Paris's RATP and RER networks to plan your commute efficiently. Get instant updates on line statuses, delays, and service alerts for all metro and regional rail lines.
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.
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.
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.