What it does
Digitraffic from Fintraffic gives live traffic data for Finland's roads, railways and waters, for example to show the next trains from Helsinki or follow ships at sea. It has REST APIs with JSON answers, and a GraphQL API for rail data. Free, no key needed; the data is under CC BY 4.0, so credit Fintraffic / digitraffic.fi. Ask for gzip compression on requests, and send a Digitraffic-User header naming your app to get a higher rate limit.
At a glance
- API key
- Not needed · More APIs with no key
- Pricing
- Free, no key needed; the data is under CC BY 4.0, so credit Fintraffic / digitraffic.fi.
- Commercial use
- Allowed on the free plan
- From the browser
- Yes (CORS)
- Formats
- JSON
- Interface
- REST, HTTP-GET, GraphQL
- Provider
- digitraffic.fi
More information: https://www.digitraffic.fi/en/
Is this your service? Show that it is listed
Put this badge on your website or in your README; it links to this page. About the badge
Example request
curl
curl 'https://rata.digitraffic.fi/api/v1/live-trains/station/HKI?arriving_trains=0&departing_trains=5&arrived_trains=0&departed_trains=0' \
-H 'Accept-Encoding: gzip' \
-H 'Digitraffic-User: ExampleUser/ExampleApp' \
--compressed
JavaScript
const response = await fetch("https://rata.digitraffic.fi/api/v1/live-trains/station/HKI?arriving_trains=0&departing_trains=5&arrived_trains=0&departed_trains=0", {
headers: {
"Accept-Encoding": "gzip",
"Digitraffic-User": "ExampleUser/ExampleApp",
},
});
const data = await response.json();
console.log(data);
Python
import requests
response = requests.get(
"https://rata.digitraffic.fi/api/v1/live-trains/station/HKI?arriving_trains=0&departing_trains=5&arrived_trains=0&departed_trains=0",
headers={
"Accept-Encoding": "gzip",
"Digitraffic-User": "ExampleUser/ExampleApp",
},
timeout=30,
)
print(response.json())
The JavaScript works in a web page as well as in Node.js 18 or newer.