Wild APIs

Trains APIs

Rail-specific feeds, mostly from national operators. NS covers Dutch train timetables and live disruptions, Renfe publishes Spanish stations and timetables through CKAN, and iRail returns Belgian departures and vehicle composition free with no key. For city rail, BART provides Bay Area arrival estimates and the MTA streams NYC subway and rail feeds in GTFS-Realtime format.
5 listings
APIPricingAuthFormatFree tierStatus
Bay Area Rapid TransitReal-time BART train arrival estimates, station info, routes and schedules for the Bay Area.
Transport & Travel › Transit
FreeAPI keyXMLUnlimitedLive
iRailReal-time Belgian train departures, connections, vehicle composition, and disruptions.
Transport & Travel › Transit
FreeNoneJSON10k+/dayLive
MTA Real-Time Data FeedsLive NYC subway, rail and service-alert feeds in GTFS-Realtime protobuf format from the MTA.
Transport & Travel › Transit
FreeNoneBinaryUnlimitedUntested
Transport for SpainQueries Renfe's open datasets — stations, timetables, incidents — through a generic CKAN REST API.
Transport & Travel › Transit
NoneJSONUnlimitedLive
Transport for The NetherlandsDutch national railway API for train timetables, live disruptions and station information.
Transport & Travel › Transit
API keyJSON—Untested

Choosing a Trains API

Is there a free Trains API?

Yes. MTA Real-Time Data Feeds, Bay Area Rapid Transit and iRail are free to use.

Which Trains APIs work without an API key?

MTA Real-Time Data Feeds, iRail and Transport for Spain need no key or sign-up, so you can try them with a plain request.

Can I call a Trains API from front-end JavaScript?

iRail allows cross-origin requests and needs no key, so it works straight from the browser. For the others, call them from your server so your key stays private.

Can I use Trains APIs in a commercial project?

Transport for Spain permits commercial use.

Broader: Transit APIs · Transport & Travel APIs