Discover/KVB API
live

KVB APIkvb.koeln

Get real-time departure schedules and stop data for Cologne's KVB transit network. Search stops by name, resolve IDs, and fetch live delays and platform info.

Endpoint health
verified 5d ago
search_stops
get_departures
2/2 passing latest checkself-healing
Endpoints
2
Updated
26d ago

What is the KVB API?

The KVB Cologne API provides 2 endpoints for querying real-time transit data from the Kölner Verkehrs-Betriebe network, covering trams (Stadtbahn), buses, and regional rail. Use search_stops to find any stop in the network by name and retrieve its ID, coordinates, and served lines. Use get_departures to pull live departure or arrival boards with scheduled times, real-time times, delay in minutes, and platform details.

Try it
Stop name to search for (e.g. 'Neumarkt', 'Dom/Hbf', 'Rudolfplatz')
Maximum number of results to return
api.parse.bot/scraper/ebd18bf3-f469-4e15-9143-226dfe76fec5/<endpoint>
Ready to send
Fill in the parameters and hit sign in to send to see live response data here.
Call it over HTTPgrab a free API key at signup
curl -X GET 'https://api.parse.bot/scraper/ebd18bf3-f469-4e15-9143-226dfe76fec5/search_stops?query=Neumarkt&max_results=5' \
  -H 'X-API-Key: $PARSE_API_KEY'
Python SDK · recommended

Typed, relational, agent-ready

A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.

  • Fully typed · autocompletes
  • Objects link to objects
  • Typed errors & pagination

Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:

uv add parse-sdk
uv run parse init
uv run parse add --marketplace kvb-koeln-api

uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.

from parse_apis.kvb_cologne_transit_api import KVB, Stop, Departure, BoardType

kvb = KVB()

# Search for stops matching "Neumarkt"
for stop in kvb.stops.search(query="Neumarkt", max_results=3):
    print(stop.name, stop.ext_id, stop.coordinates.latitude, stop.coordinates.longitude)
    for line in stop.lines:
        print(line.name, line.category)

# Get departures for a specific stop
stop = next(iter(kvb.stops.search(query="Dom/Hbf", max_results=1)))
for dep in stop.departures(board_type=BoardType.DEPARTURES, max_journeys=5):
    print(dep.line, dep.direction, dep.scheduled_time, dep.realtime_time, dep.delay_minutes, dep.platform, dep.is_reachable)
All endpoints · 2 totalmissing one? ·

Search for transit stops/stations by name. Returns matching stops with their IDs, coordinates, and available transit lines. Useful for resolving a human-readable name to a stop ID required by get_departures. Results may span the entire NRW transit network, not just Cologne city limits.

Input
ParamTypeDescription
queryrequiredstringStop name to search for (e.g. 'Neumarkt', 'Dom/Hbf', 'Rudolfplatz')
max_resultsintegerMaximum number of results to return
Response
{
  "type": "object",
  "fields": {
    "query": "string - the search query used",
    "stops": "array of Stop objects with name, ext_id, lid, type, coordinates, and lines",
    "total": "integer - number of stops returned"
  },
  "sample": {
    "data": {
      "query": "Neumarkt",
      "stops": [
        {
          "lid": "A=1@O=Köln Neumarkt@X=6948329@Y=50935667@U=1@L=900000002@B=1@p=1780990549@",
          "name": "Köln Neumarkt",
          "type": "S",
          "lines": [
            {
              "name": "1",
              "category": "Stadtbahn"
            },
            {
              "name": "3",
              "category": "Str"
            }
          ],
          "ext_id": "900000002",
          "coordinates": {
            "latitude": 50.935667,
            "longitude": 6.948329
          }
        }
      ],
      "total": 10
    },
    "status": "success"
  }
}

About the KVB API

Stop Search

The search_stops endpoint accepts a query string (e.g. 'Neumarkt', 'Dom/Hbf', 'Rudolfplatz') and returns an array of matching stop objects. Each stop includes a human-readable name, an ext_id for use in subsequent calls, a lid (location identifier), a type field indicating the stop category, lat/lon coordinates, and a list of lines serving that stop. The total field tells you how many stops matched. Use max_results to cap the response when you only need the top match.

Real-Time Departure and Arrival Boards

The get_departures endpoint resolves a stop either by stop_name or by stop_id (the ext_id from search_stops) — one of the two is required. Set type to 'DEP' for departures or 'ARR' for arrivals; it defaults to departures when omitted. Each item in the departures array carries line, category, direction, scheduled_time, realtime_time, delay_minutes, platform, date, and stop_name. The delay_minutes field is especially useful for detecting disruptions or catching connections programmatically.

Network Coverage

The API covers the full KVB network in Cologne, including numbered Stadtbahn tram lines (e.g. lines 1, 3, 7, 18), city bus routes, and regional rail services that stop at KVB-tracked stations. Stop IDs are stable identifiers suitable for persistent configuration in apps and dashboards. The lines array on each stop result lets you quickly filter stops by which specific routes serve them.

Reliability & maintenanceVerified

The KVB API is a managed, monitored endpoint for kvb.koeln — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when kvb.koeln changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.

This isn't an official kvb.koeln API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.

Last verified
5d ago
Latest check
2/2 endpoints passing
Maintenance
Monitored & self-healing
Will this API break when the source site changes?+
It's built not to. Every endpoint is health-checked on a schedule with automated test probes. When the source site changes and a check fails, the API is automatically queued for repair and re-verified — that's the self-healing layer. Each API page shows when its endpoints were last verified. And because marketplace APIs are shared, any fix reaches everyone using it.
Is this an official API from the source site?+
No — Parse APIs are independent, managed REST wrappers over publicly available data. That is the point: where a site has no official API (or only a limited one), Parse gives you a maintained, monitored endpoint for that data and keeps it working as the site changes — so you get a stable contract over a source that never promised one.
Can I fix or extend this API myself if I need a new endpoint or field?+
Yes — and you don't have to wait on us. This API was generated by the Parse agent, which stays attached. Describe the change in plain English ("add an endpoint that returns reviews", "fix the price field") in the revise box on the API page or via the revise_api MCP tool, and the agent rebuilds it against the live site in minutes. Contributing the change back to the public API is free.
What happens if I call an endpoint that has an issue?+
Errors are machine-readable: a bad call returns a clean status with the list of available endpoints and a repair hint, so an agent (or you) can recover or trigger a fix instead of failing silently. Confirmed failures feed the automatic repair queue.
Common use cases
  • Display a live departure board for a specific KVB stop in a transit app, showing line, direction, and real-time delay.
  • Alert commuters when delay_minutes exceeds a threshold on their regular tram or bus line.
  • Resolve a user-typed stop name to a canonical ext_id via search_stops, then persist it for repeated get_departures calls.
  • Build a multi-stop arrival monitor for a Cologne venue, aggregating inbound services across several nearby stops.
  • Filter stops by the lines array to find all KVB stations served by a particular Stadtbahn line.
  • Power a kiosk display showing platform numbers and scheduled vs. real-time departure times for passengers.
Pricing & limitsSee full pricing →
TierPriceCredits/monthRate limit
Free$0/mo1005 req/min
Hobby$30/mo1,00020 req/min
Developer$100/mo5,000100 req/min

One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.

Frequently asked questions
Does KVB provide an official developer API?+
KVB (Kölner Verkehrs-Betriebe) does not publish a documented public developer API for third-party use. Transit data for the Cologne network is accessible through this Parse API.
What exactly does `get_departures` return, and how do scheduled vs. real-time times differ?+
Each departure object includes both scheduled_time (the timetabled time) and realtime_time (the live predicted time). The delay_minutes field is the numeric difference between them, making it straightforward to detect late services without computing the diff yourself. Platform and stop name are also included per departure.
Does the API cover trip planning or route calculation between two stops?+
Not currently. The API covers stop search and real-time departure/arrival boards for individual stops. It does not calculate routes or connections between an origin and a destination. You can fork it on Parse and revise to add a trip-planning endpoint.
Can I retrieve historical departure data or only live schedules?+
The API returns current real-time and scheduled data for upcoming departures and arrivals. Historical departure records are not exposed by the endpoints. You can fork it on Parse and revise to add a historical or archival data endpoint if the underlying source supports it.
How do I look up a stop when I only know part of its name?+
Pass a partial name string in the query parameter of search_stops. It returns all matching stops with their ext_id, coordinates, and served lines. You can then use the ext_id directly in get_departures via the stop_id parameter to avoid ambiguity from name-based lookups.
Page content last updated . Spec covers 2 endpoints from kvb.koeln.
Related APIs in TravelSee all →
reise.ruter.no API
Access real-time bus arrivals and departures for Oslo's public transit network (Ruter). Search for stops by name and retrieve live schedules with up-to-the-minute tracking across buses, trams, and metro lines.
bahn.de API
Access data from bahn.de.
bahn.com API
Search German train schedules and stations, find connections between destinations, and compare ticket prices across Deutsche Bahn routes. Get real-time station information and transit association details to plan your train journey efficiently.
mavplusz.hu API
Get real-time and scheduled departure information for Hungarian public transit stops, including destinations, line numbers, platforms, and route details from the MÁV+ system. Plan your journey across Hungary with up-to-date transit data at your fingertips.
citymapper.com API
Get real-time transit information including live stop arrivals, service status, and line details across major cities worldwide. Search for nearby transit options and stay informed with service alerts to plan your commute efficiently.
gtt.to.it API
Access GTT (Turin) public transport data including available service basins, line routes and stop lists, full-day timetables by route and date, stop search, and real-time arrivals with accessibility details.
nationalrail.co.uk API
Check live train departure and arrival times at UK stations, search for specific stations, and get real-time service disruption alerts. Stay informed about rail service delays and changes to plan your journeys efficiently.
mbta.com API
Track real-time subway, bus, and commuter rail departures across Greater Boston, check schedules and service alerts, and find detailed information about routes and stops. Plan your commute with up-to-the-minute MBTA transit data and never miss your connection.