db-vendo-client/p/bvg
2024-09-25 21:48:23 +02:00
..
base.json BVG: update HAFAS client details again 🐛 2024-09-25 21:48:23 +02:00
example.js profiles' examples: fixes, minor tweaks 🐛📝 2023-07-28 21:35:59 +02:00
index.js apply linting rules 2024-02-10 16:50:12 +01:00
products.js apply linting rules 2024-02-10 16:50:12 +01:00
readme.md docs: make user agent instructions more specific & actionable 📝 2023-03-14 20:58:17 +01:00

BVG profile for hafas-client

Verkehrsverbund Berlin-Brandenburg (BVG) is the major local transport provider in Berlin. This profile adds BVG-specific customizations to hafas-client.

Usage

import {createClient} from 'hafas-client'
import {profile as bvgProfile} from 'hafas-client/p/bvg/index.js'

const userAgent = 'link-to-your-project-or-email' // adapt this to your project!

// create a client with BVG profile
const client = createClient(bvgProfile, userAgent)

Customisations

  • parses BVG-specific products (such as X-Bus)
  • supports BerlKönig journey legs
  • strips parts from station names that are unnecessary in the Berlin context
  • parses line names to give more information (e.g. "Is it an express bus?")
  • renames Ringbahn line names to contain and

BerlKönig

BVG has recently announced a ride-sharing service called BerlKönig. Pass berlkoenig: true into journeys() to get special legs:

{
	mode: 'walking',
	departure: // …
	arrival: // …
	origin: // …
	destination: // …
	line: {
		type: 'line',
		name: 'BerlKönig',
		public: true,
		mode: 'taxi',
		product: 'berlkoenig'
	}
}