⚡ LIBTRAIN DEVELOPERS & AI AGENTS

LibTrain Railway Open Data & Telemetry API

Unified REST JSON gateway aggregating ADIF, Renfe GTFS-RT, FGC, Euskotren, Metro and Light Rail telemetry across Spain with sub-second edge caching.

2. Quick Start

Fetch normalized live trains across Spain with a single HTTP GET request:

curl -s https://www.libtrain.com/api/v1/radar/vehicles | jq '.vehicles[:3]'

3. When to Use This API

  • Live departure/arrival boards on web, kiosks, or mobile apps.
  • Delay analytics, corridor punctuality monitoring, and passenger alerts.
  • AI Railway Copilots & MCP agents needing grounded live RFIG/ADIF telemetry.

4. Endpoints & Live Explorer

Click any endpoint above to inspect live JSON response...

5. Authentication & Agent Registration

Public read endpoints work without tokens under standard rate limits. Authenticated partners & AI agents send a Bearer Sanctum token:

Authorization: Bearer lt_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxx

6. Real-Time with LibTrain Server

TrainIngestionService fuses Renfe GTFS-RT (LD & Cercanías), FGC OpenData, Euskotren, and LibTrain verified cab telemetry every 15–20 seconds with automatic deduplication.

7. Errors

HTTPCodeMeaning
401UNAUTHENTICATEDMissing or invalid Bearer token.
404NOT_FOUNDStation code or train number not found.
429RATE_LIMITEDRate limit exceeded; respect Retry-After.
503UPSTREAM_DEGRADEDUpstream agency feed temporarily unavailable.

8. Rate Limits & Cache

Public radar endpoints allow 120 req/min per IP with shared server-side caching (15s live vehicles, 600s news/RSS) so upstream public agencies are never overloaded.

9. Agent Usage Files

AI Agents and LLM toolchains can consume structured discovery manifests directly:

GET /api/v1/radar/vehicles   # Normalized telemetry schema
GET /api/v1/radar/stats      # Windowed fleet KPIs (live, 1d, 7d, 30d, all_time)
GET /api/v1/radar/algorithms # Delay propagation & eco-cruising indices

10. Embed Station Board

Embed any ADIF station departure/arrival board on your website using our public radar tab parameter:

<iframe src="https://www.libtrain.com/radar-en-vivo?tab=board" width="100%" height="620" style="border:0;border-radius:14px;"></iframe>

11. Data, Attribution & Limits

Cartography © OpenStreetMap contributors & OpenRailwayMap. Official Spanish railway open data sourced from ADIF, Renfe Datos Abiertos, FGC Dades Obertes, and Open Data Euskadi.

12. Plans, Pricing & Terms of Use

Compare Free, Pro, Driver Cab and Enterprise plans with SLA and commercial API quotas on our official plans page.

View Plans & Pricing →

13. AI Tokens & Models Adapted per Plan

PlanAI Model TierMonthly Token Quota
Free / ExploradorGemini Flash-Lite50.000 tokens
Pro / PasajeroGemini Flash500.000 tokens
Maquinista / EmpresaGemini Pro + RFIG Grounding2.500.000+ tokens

14. Versions, Deprecation, Support & Help

API v1 is stable. Any breaking field deprecation is announced 90 days in advance via HTTP Deprecation headers and release notes.

15. Multiplatform Apps: Android, iOS, Windows, Linux, macOS

Available right now on Android and Web. Desktop (Windows, Linux, macOS) and iOS builds are in active rollout.

✓ Android (Disponible) ✓ Web / PWA (Disponible) ⏳ iOS · Windows · Linux · macOS
LibTrain

Access LibTrain Portal

Secure environment with Two-Factor Authentication (2FA) for drivers, operators, and passengers.

Multi-Role Architecture & Unified Access Upon authentication, the backend will automatically detect your role (Driver, Operator, Auditor, Passenger, or Admin) and route you to your dedicated dashboard.
Enter Portal Register
Looking to explore without credentials? Demo Access

2FA Mobile Verification (SMS)

Enter your mobile number to receive a 6-digit security code via SMS.

🇪🇸 +34
Include country calling code (e.g. +34 for Spain).