npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@motis-project/motis-fptf-client

v6.4.0

Published

Exposing the MOTIS API as a Friendly Public Transport Format API.

Readme

motis-fptf-client

A client for MOTIS that is a drop-in replacement for hafas-client and/or db-vendo-client, in short, everything that is more or less compatible with the Friendly Public Transport Format (FPTF).

npm version ISC-licensed

This project exists to ease transitioning from HAFAS-based APIs to open APIs run with open schedule/RT data. It uses motis-client to access the MOTIS API, use that if you want to access the full capabilities and features of MOTIS, use motis-fptf-client only when you want to replace/run in parallel with hafas-client and/or db-vendo-client.

This is an early version. The following FPTF/hafas-client endpoints are supported:

  • journeys()
  • locations(),
  • departures(), arrivals() boards
  • reachableFrom()
  • stop()

What doesn't work (yet):

  • refreshJourney()
  • nearby()
  • trip()
  • all other endpoints (tripsByName(), radar(), journeysFromTrip(), remarks(), lines(), station())

By default, a transitous profile is included, but you can use it with any other MOTIS instance by setting the MOTIS_BASE_URL environment variable or modifying the profile. There is also a compat profile which will try to merge stops (which are often platforms in GTFS) to stations similar to the stations known from db-vendo-client/hafas-client, by replacing their ID with that of their parent station. In addition, just as the transitous profile, when enrichStations is enabled (default), the station attribute of stops will contain the matching station data from db-hafas-stations including the EVA number as id, if available. This enables matching to other DB data.

Usage

Use it as a dependency, e.g. just replacing hafas-client:

npm i motis-fptf-client

See an example in api.js. It shows how you can use motis-fptf-client together with hafas-rest-api and some hacks in order to run a FPTF API server:

docker run \
    -e USER_AGENT=my-awesome-program \
    -e MOTIS_PROFILE=transitous \
    -e MOTIS_BASE_URL=https://api.transitous.org \
    -p 3000:3000 \
    ghcr.io/public-transport/motis-fptf-client

There are community-maintained TypeScript typings available as @types/hafas-client.

Browser usage

motis-fptf-client should be mostly browser compatible. Limitations: Does not work with enrichStations option enabled.

Related Projects

Contributing

If you have a question, found a bug or want to propose a feature, please open an Issue.

This project needs help! Check the list of "help wanted" Issues.

If you're contributing code, please read the contribution guidelines.