Overview

Transport for Finland's Digitransit API provides developers with access to public transportation data across Finland. Founded in 2016, the platform centralizes data from various regional transit authorities, offering a unified access point for building applications focused on urban mobility. The API is designed for applications requiring real-time updates on vehicle positions, public transport schedules, and comprehensive journey planning capabilities. This includes use cases such as consumer-facing public transport applications, internal logistics tools, and academic research on transit patterns and urban planning.

The core offering includes a GraphQL API for real-time and journey planning queries, alongside static General Transit Feed Specification (GTFS) data. GTFS is a common format for public transportation schedules and associated geographic information, utilized globally by transit agencies to publish their data, as documented by Google's GTFS specifications. This dual approach allows developers to choose between dynamic query capabilities and bulk data processing. The platform emphasizes a developer-friendly experience, providing extensive documentation and examples, particularly for its GraphQL API.

The Digitransit API is particularly suited for organizations and individuals developing mobility-as-a-service (MaaS) platforms, which integrate various forms of transportation into a single service. It also supports route planning services that combine public transit options with other modes of transport. For non-commercial applications, the platform offers a free tier, making it accessible for independent developers and academic projects. Commercial use requires specific licensing, ensuring sustainable operation and support for large-scale deployments. Compliance with GDPR underscores the platform's commitment to data privacy and regulatory standards, an important factor for applications handling user data.

Key features

  • Journey Planner API: A GraphQL API endpoint that enables complex route calculations, including real-time schedule adjustments, transfers, and multimodal options across Finland's public transport networks. Details are available in the HSL GraphQL API documentation.
  • Real-time Vehicle Data API: Provides current location data for public transport vehicles, allowing for live tracking and estimated arrival times in applications.
  • GTFS Data Access: Offers static General Transit Feed Specification (GTFS) data, which includes schedules, routes, stops, and geographical information for bulk processing and offline use. This aligns with Google's GTFS specifications.
  • Developer Portal & Documentation: A centralized portal with API references, tutorials, and code examples to assist developers in integrating the API effectively. Access the Digitransit developer documentation.
  • GraphQL Endpoint: Utilizes GraphQL for efficient data fetching, allowing clients to request only the data they need, thereby reducing payload size and improving application performance.
  • GDPR Compliance: Adheres to the General Data Protection Regulation, ensuring data privacy and security for users within the EU.

Pricing

Transport for Finland's Digitransit API offers a tiered pricing model, primarily distinguishing between non-commercial and commercial applications. As of Q2 2026, the details are as follows:

Plan Type Description Key Features Pricing (as of 2026-05-28) Citation
Non-Commercial Use Designed for personal projects, academic research, and non-profit initiatives. Access to Journey Planner & Real-time Vehicle Data APIs, GTFS data. Generous free usage limits. Digitransit Developer Portal
Commercial Use For businesses and applications generating revenue or requiring higher usage limits. Scalable API access, dedicated support, custom usage terms. Contact sales for specific terms and pricing. Digitransit Developer Portal

Common integrations

Developers frequently integrate the Transport for Finland API with various platforms and tools to enhance their applications:

  • Mobile Application Frameworks: Integrated into iOS (Swift/Objective-C) and Android (Kotlin/Java) applications for on-the-go journey planning and real-time alerts.
  • Web Mapping Libraries: Combined with mapping solutions like Google Maps Platform or OpenStreetMap-based libraries to visualize routes and vehicle positions.
  • Data Visualization Tools: Used with tools such as D3.js or Leaflet to create interactive maps and dashboards displaying transit data.
  • Backend Services: Integrated with cloud platforms like AWS, Google Cloud Platform, or Microsoft Azure for data processing, storage, and API management.
  • Mobility-as-a-Service (MaaS) Platforms: Feeds into broader MaaS platforms that consolidate various transport options, including ride-sharing and bike rentals.

Alternatives

For developers seeking public transit data and mapping solutions, several alternatives exist:

  • Moovit: Offers a comprehensive platform for urban mobility, providing public transit data, journey planning, and real-time updates globally.
  • Google Maps Platform: Provides a suite of APIs, including Directions, Roads, and Places, which can be used to build detailed route planning and mapping applications, though it often requires integrating public transit data separately or using their Transit layer.
  • Trafi: Specializes in mobility-as-a-service platforms, offering APIs for journey planning, real-time data, and various transport modes, with a focus on urban areas.

Getting started

To begin using the Digitransit API for journey planning, you can make a GraphQL query to their HSL GraphQL API endpoint. This JavaScript example demonstrates how to fetch basic route information.

async function getJourneyPlan(fromLat, fromLon, toLat, toLon) {
  const apiUrl = 'https://api.digitransit.fi/routing/v1/routers/hsl/index/graphql';
  const query = `
    {
      plan(from: {lat: ${fromLat}, lon: ${fromLon}}, to: {lat: ${toLat}, lon: ${toLon}}) {
        itineraries {
          startTime
          endTime
          duration
          walkDistance
          legs {
            mode
            startTime
            endTime
            duration
            from {
              name
              lat
              lon
            }
            to {
              name
              lat
              lon
            }
            distance
            steps {
              lat
              lon
              distance
              roadSafety
              streetName
            }
          }
        }
      }
    }
  `;

  try {
    const response = await fetch(apiUrl, {
      method: 'POST',
      headers: {
        'Content-Type': 'application/graphql',
        'Accept': 'application/json',
      },
      body: query,
    });

    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
    }

    const data = await response.json();
    console.log('Journey Plan:', data.data.plan.itineraries);
    return data.data.plan.itineraries;
  } catch (error) {
    console.error('Error fetching journey plan:', error);
    return null;
  }
}

// Example usage (Helsinki city center to a common landmark)
getJourneyPlan(60.1695, 24.9354, 60.1706, 24.9312);

This GraphQL example demonstrates querying the Digitransit API for a journey plan between two geographical coordinates. The query specifies the desired fields for an itinerary, including start and end times, duration, and details about each leg of the journey (e.g., mode of transport, stops, and distance). The fetch API is used to send a POST request to the GraphQL endpoint, with the query embedded in the request body. The response is then parsed as JSON, and the itineraries are logged to the console. For commercial applications or higher usage, an API key might be required, which would typically be included in the request headers.