European real-time transit departures via REST sensor | looking for testers

Hey,
I built a transit api that covers 200+ cities across Europe, serving realtime departure times for all common transportation types (bus, subway, metro etc.). So far it works as a HA REST sensor and I am considering to build a proper HACS integration, if it is well received.
It started first as an app for my Pebble smartwatch, but then I started to wonder if others might find this service useful for other devices and solutions, until a colleague asked my if he could use the service for his HA setup at home.
Being a frontend dev in my professional life, I was wanting to make the call as simple as possible, with an easy to read response format. You give lon and lat GPS values, and get back the departures from your surrounding. There are plently of parameters you can give on top, e.g. for specifying the radius, transportation types, etc.

Quick setup

**1. Get a free API key by sending me a DM (750 requests/day. Should be enough for 1-min polling)

2. Add to configuration.yaml:

sensor:
  - platform: rest
    name: Transit Departures
    unique_id: abfahrt_departures
    resource: "https://api.abfahrt.now/departures?lat=YOUR_LAT&lon=YOUR_LON&radius=500&key=YOUR_API_KEY"
    scan_interval: 60
    json_attributes:
      - departures
      - stations
      - city
      - region
    value_template: "{{ value_json.departures | length }}"

3. Add a Lovelace card or Markdown card:

type: markdown
title: Departures
content: >
  {% set deps = state_attr('sensor.transit_departures', 'departures') %}
  {% set icons = {'subway':'🚇','suburban':'🚈','tram':'🚊','bus':'🚌','ferry':'⛴️','regional':'🚆','express':'🚄'} %}
  {% for d in deps[:12] %}
  {{ icons.get(d.mode, '🚏') }} **{{ d.line }}** → {{ d.direction | truncate(25, True) }} · *{{ d.time }}*{% if d.delay and d.delay > 0 %} +{{ d.delay }}min{% endif %}

  {% endfor %}

This gives you something like:

🚇 U5  → Hönow                  · 2 min
🚈 S5  → Westkreuz              · 4 min
🚌 100 → Zoologischer Garten    · 6 min  +3min
🚊 M4  → Sulzfelder Str.        · 8 min

Useful API parameters

Parameter Example Description
radius 500 Search area in meters (default 500, max 5000)
mode bus or -bus Include or exclude transport modes
from 10 Skip departures in the next N minutes
to 45 Only show departures within N minutes
limit 20 Max number of departures (default 15, max 60)

Full API Docs are here: API Documentation — Abfahrt! API

So if you only want buses departing in 10–30 minutes:

https://api.abfahrt.now/departures?lat=...&lon=...&radius=500&mode=bus&from=10&to=30&key=...

What’s in the response

Each departure includes:

  • line: line name (e.g. “U2”, “75”, “S5”)
  • direction: destination / headsign
  • time: human-readable (“3 min”, “14:32”, “Now”)
  • timestamp: Unix timestamp for automations
  • delay: eal-time delay in minutes
  • mode: subway, suburban, tramm, bus, ferry, regional, express
  • stop: which nearby stop this departs from
  • cancelled: boolean

The response also includes a city field (e.g. “Berlin”, “London”, “Barcelona”) and a stations list with all nearby stops and their distances.

Looking for testers

I’d love to hear feedback from you! Again, it all started as a side project, but I am excited what you do out of it, when tinkerers and devs don’t have to worry anymore about different data formats for different cities and transit operators. Especially interested in:

  • How would your HA setup benefit from this information or what automations are you running with it?
  • Are all your local stops showing up?
  • What would make this more useful for your dashboard?

Bear with me when I am not responding quick enough. Will do my best to answer asap. :slight_smile:

So this is a commercial offering? Sounds a bit odd to need a DM, are you also offering IPTV services ?
EDIT; no need to answer, I will block this as I find it questionable, maybe others see this differently … good luck :slight_smile:

Yes, there is a commercial tier and I want to be transparent about why: I’m an indie dev and the real-time data sources I aggregate have quota limits that cost money to maintain. The API covers 25+ European countries with 80+ individual integrations, and keeping those running isn’t free. That said, I’m offering free API keys here specifically to get feedback from the HA community and make the integration as useful as possible.