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.

Authentication

Include your API key in every request:

HTTP requests: Add api-key header

http
api-key: your-api-key-here
api-key: your-api-key-here

WebSocket connections: Include in connection parameters

javascript
connectionParams: {
  'api-key': 'your-api-key-here'
}
connectionParams: {
  'api-key': 'your-api-key-here'
}

Get your API key

Manage API keys and user access from the Dashboard.

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.

Required Headers

HTTP requests require:

  • Accept: application/graphql-response+json
  • api-key: your-api-key
  • session: unique-session-id (for debugging)

WebSocket connections require:

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