Overview

Digitransit is Finland's national open public transport platform, offering a GraphQL API for routing, stop information, and real-time data across Finnish cities. No API key is required, and the GraphQL interface lets you request exactly the data you need. It is a great modern API for learning GraphQL while working with real transit data.

Beginner Tip

This API uses GraphQL instead of REST — you send POST requests with a query body to the endpoint. Use the GraphQL playground at api.digitransit.fi/graphiql to explore and test queries interactively before writing code.

Available Data

The kind of data this API exposes, based on its documentation. We could not call the endpoint to confirm the exact field names.

match scores and results
team standings
player statistics
schedule and fixtures
Use case: Integrate finnish transport api data into web and mobile applications

Example Response

Illustrative shape only — we were not able to call this endpoint (it requires credentials or exposes no public sample URL), so the fields below show the kind of data this API returns rather than a recorded response.

JSON Response · Illustrative
{
  "route": "Line 1",
  "origin": "Station A",
  "destination": "Station B",
  "departure": "08:30",
  "arrival": "09:15",
  "status": "On Time",
  "delays_min": 0
}

Field Reference

data.stops List of transit stops matching your query
gtfsId GTFS-format unique identifier for the stop
name Human-readable name of the stop
lat Latitude coordinate of the stop
lon Longitude coordinate of the stop

Implementation Example

Calls a real endpoint of this API. Replace any placeholder credentials with your own key.

Request
const url = "https://api.digitransit.fi/routing/v1/routers/finland/index/graphql";
const response = await fetch(url);
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data);

What Can You Build?

Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.

Common Errors & Troubleshooting

Generated guidance based on this API's documentation, not observed by us. Treat it as a starting point and check against the provider's own error reference.

GraphQL errors array in response Invalid or malformed GraphQL query syntax
Use the GraphiQL playground at api.digitransit.fi to validate your query before sending it programmatically
Empty stops array The stop name searched does not match any stops in the dataset
Try a broader search term or a major city name like "Helsinki" or "Tampere" to confirm the API is working
CORS error in browser Calling the API directly from a browser without the correct headers
Include the digitransit-subscription-key header even for free tier usage, or proxy the request through your server

Metadata Score Breakdown

Estimated from metadata — endpoint not independently tested

This score is estimated from observable metadata — HTTPS support, authentication model, declared CORS, and documentation reachability — because the API requires authentication or exposes no publicly testable endpoint. The five-signal breakdown is only shown for live-tested APIs.

Metadata estimate · endpoint not independently tested

Technical Specifications

Auth No Auth
HTTPS REQUIRED
CORS UNKNOWN
Category Transportation
Difficulty Beginner
Listing details not endpoint-verified

Related Tags

Similar APIs

View All →