Swiftpack.co - Package - kiliankoe/DVB


Travis Version Platform Docs

This is an unofficial Swift package giving you a few options to query Dresden's public transport system for current bus- and tramstop data.

Want something like this for another language, look no further 🙂


Have a look at the example iOS app.


DVB is available through Cocoapods, Carthage/Punic and Swift Package Manager, whatever floats your boat.

// Cocoapods
pod 'DVB'

// Carthage
github "kiliankoe/DVB"

// Swift Package Manager
.package(url: "https://github.com/kiliankoe/DVB", from: "latest_version")

Quick Start

Be sure to check the docs for more detailed information on how to use this library, but here are some quick examples for getting started right away.

Caveat: Stops are always represented by their ID. You can get a stop's ID via Stop.find(). Some of the methods listed below offer convenience overloads, which are listed here since they look nicer. The downside to these is that they have to send of a find request for every stop first resulting in a significant overhead. Should you already have a stop's ID at hand I strongly suggest you use that instead.

Monitor a single stop

Monitor a single stop to see every bus, tram or whatever leaving this stop. The necessary stop id can be found by using the find() function.

// See caveat above
Departure.monitor(stopWithName: "Postplatz") { result in
    guard let response = result.success else { return }

Find a specific stop

Say you're looking for "Helmholtzstraße". You can use the following to find a list of matches.

Stop.find("Helmholtzstraße") { result in
    guard let response = result.success else { return }

You can also get a list of stops around a given coordinate.

let coordinate = CLLocationCoordinate2D(latitude: 51.063080, longitude: 13.736835)
Stop.findNear(coordinate) { result in
    guard let response = result.success else { return }

Find a route from A to B

Want to go somewhere?

// See caveat above
Trip.find(from: "Albertplatz", to: "Hauptbahnhof") { result in
    guard let response = result.success else { return }

Look up current route changes

Want to see if your favorite lines are currently being re-routed due to construction or some other reason? Check the published list of route changes.

RouteChange.get { result in
    guard let response = result.success else { return }

Lines running at a specific stop

Looking to find which lines service a specific stop? There's a func for that.

// See caveat above
Line.get(forStopName: "Postplatz") { result in
    guard let response = result.success else { return }


Kilian Koeltzsch, @kiliankoe

Max Kattner, @maxkattner


DVB is available under the MIT license. See the LICENSE file for more info.

Terms of Service

Please refer to the VVO Terms of Service regarding their widget. Take particular care not to use this library to hammer their servers through too many requests to their graciously-provided API.


Stars: 18


Used By

Total: 0


- 2017-05-30 13:42:57


  • Route.find(from:to:)
  • .localizedETA() on Departure
  • Stop.monitor()


  • A few Route properties are now optional


  • Renamed Trip to Route
  • some coordinate handling, should now work better
  • Departure's actualETA is now just ETA and no longer optional

- 2017-03-20 01:17:29


  • Trip Requests 🛤


  • Depature.platform is optional, as it should be


  • now dependent on Marshal, Carthage users will have to pull this in as well

- 2017-02-27 12:44:15


  • Route change lookups
  • Serviced lines lookup
  • convenience Departure.monitor(stopWithName:)


  • Coordinates are back :clap:


  • Some argument labels were made more explicit


  • Stop.findNear() since the previous implementation was broken. Will hopefully find its way back soon.

- 2017-02-19 12:02:22


  • Compatibility with SPM.


  • Migrated to use WebAPI instead of old Widgets endpoint.
  • Basic API, no more DVB class to interact with.


  • Example app from repo. That will live somewhere else.
  • Local stop list, since there's now a good endpoint for this.
  • Monitor filters, please implement this yourself if you need this functionality.


  • Everything regarding coordinates, will fix soon (hopefully)!

Swift 3 Support - 2016-09-28 20:55:35

nearestStops() finds nearest stops! - 2016-05-27 12:24:35

This release introduces a new method called DVB.nearestStops() to find stops around a given location. You will receive the stop's information as well as its distance to the coordinate you provided.

DVB.find, just different - 2016-05-22 15:35:46

DVB.find now uses a local list of all stops in the VVO region to return results. This has the added benefit of a coordinate for every stop and some other stuff in the future :)

DVB.find - 2016-05-09 22:13:59

DVB.find can now be used to find specific stops using a portion of their title.

Initial Release - 2016-05-06 19:17:50

Nothing but DVB.monitor, but it feels good having published my first Cocoapod 🎉