Train Travel API
1.2.1

Base URL
https://try.microcks.io/rest/Train+Travel+API/1.0.0

API for finding and booking train trips across Europe.

Run in Postman

Experiment with this API in Postman, using our Postman Collection.

Run In Postman

This is version 1.2.1 of this API documentation. Last update on Sep 10, 2025.

This API is provided under license Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International.

Servers

Base URL Description
https://try.microcks.io/rest/Train+Travel+API/1.0.0 Mock Server
https://api.example.com Production

Authentication

O auth2 (oauth2)

OAuth 2.0 authorization code following RFC8725 best practices.

Flow type authorizationCode
Authorization URL https://example.com/oauth/authorize
Token URL https://example.com/oauth/token
Scopes
  • read:

    Read access

  • write:

    Write access

Getting started

Travelling by train across Europe usually requires a train ticket.

With this API you will be able to search, book and pay for a train ticket and enjoy watching the landscapes by the window.

Below is the set of API calls you will need to do to get your ticket.

Description API Repeat?
Search for train stations GET /stations Call this operation as many times as needed to find your origin and destination train stations
Lookup train schedules and ticket availability GET /trips As many calls as necessary, you will provide both the origin and destination station IDs and a traveling date
Make your booking POST /bookings Usually one booking is enough. But if you want to organize your next holidays you may book as many tickets as you like
Issue your ticket by paying POST /bookings/{bookingId}/payment One payment per booking is enough to receive your ticket

Happy traveling!


You can optionally subscribe to a webhook to receive updates about your bookings.

Stations

Find and filter train stations across Europe, including their location and local timezone.