hafas-client
profiles
This directory contains specific customisations for each endpoint, called profiles. They parse data from the API differently, add additional information, or add special methods specific to the endpoint (such as journeysFromTrip
).
built-in profiles
There are built-in profiles for these public transportation networks:
writing your own
If you want to write a profile for an endpoint, check out the writing a profile guide.
Your profile must be passed into createClient
and is expected to be in a certain structure:
const createClient = require('hafas-client')
const myCustomProfile = {
// …
}
// create a client with the profile
const client = createClient(myCustomProfile)
// use it to query data
await client.journeys('1234', '2345')