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

kiedyprzyjedzie-pl

v1.0.0

Published

Unofficial JavaScript client for KiedyPrzyjedzie.pl public transport system.

Readme

KiedyPrzyjedzie.pl

Unofficial JavaScript client for KiedyPrzyjedzie.pl public transport system.
This library provides programmatic access to real-time public transport data (buses, trams, and other services) available through the KiedyPrzyjedzie.pl platform. It allows developers to retrieve information about stops, departures, timetables, and trip details for various cities in Poland.

Important Notice:
This library is unofficial and uses endpoints provided by KiedyPrzyjedzie.pl. It is intended for educational and personal use only. If you plan to use this library in a production environment or for commercial purposes, you must obtain explicit permission from the operator of KiedyPrzyjedzie.pl. Unauthorized use may violate their terms of service.


Features

  • Retrieve a list of supported cities and operators.
  • Fetch real-time departures for any stop.
  • Access detailed timetables for specific lines.
  • Get trip details, including stops and schedules.
  • Easy-to-use, promise-based API.
  • Lightweight and dependency-free (except for axios).

Installation

npm install kiedyprzyjedzie

Quick Start

const KiedyPrzyjedzie = require('kiedyprzyjedzie');
const api = new KiedyPrzyjedzie();

async function example() {
  try {
    // Initialize and select city
    await api.init();
    api.selectCity('pksszczecin'); // e.g., 'abx2bus', 'augustow'
    
    // Fetch stops and departures
    const stops = await api.getStops();
    const departures = await api.getDepartures('1141917:1195824');
    
    console.log('Available cities:', await api.init());
    console.log('First stop:', stops[0]);
    console.log('Next departures:', departures.rows);
    
  } catch (error) {
    console.error('Error:', error.message);
  }
}

example();

Documentation

init()

Initializes the module and fetches available cities/operators

Returns:
Promise<Array> - List of city objects:

{
  name: String,    // Full operator name
  prefix: String,  // Unique city identifier
  domain: String   // System domain
}

selectCity(prefix)

Select city for subsequent queries

Parameters:

  • prefix (String) - Unique city identifier (e.g., 'pksszczecin')

getStops()

Retrieves all stops in selected city

Returns:
Promise<Array> - List of stops:

[{
  id: String,      // Stop ID (e.g., "1141917:1195824")
  code: Number,    // Stop number
  name: String,    // Stop name
  lat: Number,     // Latitude
  lon: Number      // Longitude
}]

getDepartures(stopId)

Gets real-time departures from a stop

Parameters:

  • stopId (String) - Stop ID in "1141917:1195824" format

Returns:
Promise<Object> - Departure data:

{
  rows: [{
    time: String,           // Scheduled departure time
    direction: String,      // Trip direction
    line: String,           // Line number
    platform: String        // Platform/stop number
  }],
  directions: Object        // Direction mappings
}

getTimetable(stopId, line, date)

Retrieves full timetable for a line

Parameters:

  • stopId (String) - Stop ID
  • line (String) - Line number
  • date (String) - Date in YYYY-MM-DD format

getTripDetails(encodedTripId, index)

Gets detailed trip information

Parameters:

  • encodedTripId (String) - Base64-encoded trip ID
  • index (Number) - Stop index in route

⚠️ Important: This module uses an unofficial API. Use for educational/personal purposes only. Contact KiedyPrzyjedzie.pl operator before commercial use.