Getting Started with the API

Prerequisites

Before you start, you'll need:

API Endpoints

  • Live: https://api-gateway.allaboard.eu
  • Test: https://test.api-gateway.allaboard.eu

The API supports both HTTP POST and GET requests as well as WebSocket connections. For real-time updates, long-running operations and streaming results, WebSockets are recommended.

Required Headers

Every request must include the following headers:

HeaderDescription
api-keyYour API key from the Dashboard
sessionA unique identifier for the user session (see below)
Acceptapplication/graphql-response+json (HTTP only)

Authentication

Include your API key in the api-key header with every request.

Get your API key

Manage API keys and user access from the Dashboard.

Session Header

The session header is required for all requests. It should be a unique identifier that stays consistent throughout a user's booking flow. This helps us trace requests and resolve any issues you might encounter.

Use any unique string. Generate one per user session and reuse it for all related requests.

HTTP Example

http
POST /graphql HTTP/1.1
Host: api-gateway.allaboard.eu
Accept: application/graphql-response+json
api-key: your-api-key-here
session: 550e8400-e29b-41d4-a716-446655440000
Content-Type: application/json

{"query": "..."}
POST /graphql HTTP/1.1
Host: api-gateway.allaboard.eu
Accept: application/graphql-response+json
api-key: your-api-key-here
session: 550e8400-e29b-41d4-a716-446655440000
Content-Type: application/json

{"query": "..."}

WebSocket Example

For WebSocket connections in environments that do not support custom connection headers, use the connection parameters (see graphql-ws documentation):

javascript
connectionParams: {
  'api-key': 'your-api-key-here',
  'session': '550e8400-e29b-41d4-a716-446655440000'
}
connectionParams: {
  'api-key': 'your-api-key-here',
  'session': '550e8400-e29b-41d4-a716-446655440000'
}

Try It Out

The easiest way to explore the API is through our interactive GraphQL console:

The console lets you explore the schema, test queries, and see responses in real-time.

Technical Details

GraphQL API

The All Aboard API uses GraphQL, which means:

  • You request exactly the data you need
  • Strongly typed schema with excellent tooling
  • Single endpoint for all operations
  • Real-time subscriptions for streaming results

GraphQL concepts are straightforward. You write queries that describe the data you want, and the API returns exactly that.

WebSockets and Streaming

Some operations can take up to 30 seconds (train operators sometimes take a while to confirm bookings). Instead of waiting, the API streams results as they become available. This lets you show progress to users and display results incrementally.

Use WebSocket connections or GraphQL subscriptions for operations like:

  • Getting journey offers (prices stream in as they're calculated)
  • Creating bookings (avoid request timeouts)
  • Creating orders (avoid request timeouts)

Client Libraries

GraphQL has excellent library support in most languages, find an implementation for your environment on the official GraphQL website.

For WebSocket connections, use the graphql-ws protocol (JavaScript) or compatible libraries in other languages.

API Usage and Look-to-Book

The look-to-book ratio measures how many searches or queries you make compared to actual bookings. Many travel APIs enforce strict limits on this ratio, but All Aboard operates differently.

We don't impose hard limits on look-to-book ratios. Instead, we operate on a mutual agreement of fair use. This means:

  • Request offers for journeys users are likely to book: Only query pricing when users are actively considering a purchase
  • Avoid scraping: Don't systematically collect data across routes or dates
  • Avoid speculative queries: Don't query offers "just in case" or to populate databases
  • Avoid large-scale fare probing: Don't systematically check prices across many routes or dates to build price databases

This approach keeps the API fast and reliable for everyone while giving you the flexibility to build great user experiences. If you're unsure whether your usage pattern aligns with fair use, reach out at tech@allaboard.eu.

Next Steps

After setting up your API key, explore these topics:

  1. Key Concepts: Learn rail-specific terminology and concepts like journeys, offers, bookings, and orders
  2. Booking Flows: Understand the complete booking lifecycle from search to tickets
  3. Subscriptions & Streaming: Learn how to use WebSockets for real-time updates and avoid timeouts
  4. Finding Journeys: Start searching for train routes between locations
  5. Getting Offers: Learn how to get pricing options for journeys

API Reference Material