[External integration] SNCF: your trains in real-time in Gladys 🚆

Hello everyone,

I’m introducing a new external integration: SNCF. It tracks your upcoming trains (home → work, return trip, etc.) in real-time, including delays, cancellations, and their reason.

What it offers

  • Up to 3 trips, with optional time slots and days (e.g., 07:00-09:30, Monday to Friday). In the evening, it already tracks the next morning’s trains.
  • One device per trip: next train (« 07:42 · TER 858311 · +5 min »), delay of the next train in minutes, number of disrupted trains. Ideal for history and scene values.
  • 3 scene triggers:
    • Train delayed (filter by level: less than 15 min, 15-29, 30 and more)
    • Train cancelled (or no longer serving your station)
    • Imminent departure: 5 to 60 min before departure, calculated based on real time (including delays). Perfect for a « leave now » on the speaker!
  • 1 scene action « Next trains », with a ready-made sentence: « Rennes → Nantes: TER 858311 at 07:42 has a 5-minute delay, departure at 07:47. Next: 08:12 on time. »
  • 2 widgets: the trains of a trip (badges on time / +N min / cancelled, reason on touch) and the departure board of a station.

What you need

A free SNCF API key: a form on Demandez votre clé d'accès gratuite - SNCF NUMÉRIQUE, the key arrives by email. It provides 5,000 requests per day. The integration counts them itself and slows down before the limit (approximately 250 requests per day for a trip with a time slot).

Good to know

  • Only direct trains are tracked.
  • Transilien: theoretical schedules only (SNCF API limitation).
  • The track is not provided by the official API.
  • A cancelled train disappears from SNCF’s real-time data. The integration detects it by comparing with theoretical schedules, then confirms it on the departure board, to never announce a cancellation incorrectly.

Installation

From the Gladys integrations store (Gladys 5.1.1 minimum), then:

  1. paste your API key;
  2. enter your stations (name, UIC code, or « Search for a station » button);
  3. click on « Test connection »;
  4. add devices from the Discovery tab.

Documentation: gladys-sncf/docs/fr.md at main · William-De71/gladys-sncf · GitHub
Source code: GitHub - William-De71/gladys-sncf: External Gladys Assistant integration for SNCF trains: next departures of your trips in real time, delays, cancellations, scenes and dashboard widgets. · GitHub

This is a community integration, with no connection to SNCF. Your feedback is welcome.

I can’t retrieve the API key from the website numerique.sncf.com. I’ve been trying for several days and the site won’t open.

I’ll look into it on my end, but it’s completely independent of the integration.

I tested it: the website numerique.sncf.com disconnects as soon as it opens, from several different networks.
The outage is therefore with SNCF.
The API itself (api.sncf.com) is still working, only the key request form is inaccessible.
There is no other way to get a key, you have to wait for the site to come back. I will check regularly and I will notify you here when it is restored.

Okay, thanks for watching. I’ll try again too.

Hello @Will_71, I received this email that I am forwarding for information

Hello,

In the past, you requested an access token (token) to use the SNCF passenger information API.

On Tuesday, November 24, 2026, we will proceed with a change in the information sources used to feed the SNCF API. We will now use the NeTEx format for theoretical schedules and the SIRI format for real-time schedules.

This modification will not change the API access points (endpoint) or the query syntax. However, the identifiers of the objects in the reference will change (codes of stop_area, stop_point, etc.). You may therefore need to review some parameters to properly take into account these new identifiers.

For the 24 hours following the launch of this new version, on Tuesday, November 24, 2026, real-time information will be unavailable. We apologize for any inconvenience caused.

For any questions, you can contact us at the following address: contact.api@sncf.fr

The SNCF API team

Ok thanks for the feedback, I’ll make the change to take it into account