# bahn-kursbuch

> API for the DB Kursbuch

Latest version **1.0.6** (published 2018-04-22) · GPL-2.0 license · 0 weekly downloads

## Install

```sh
npm install bahn-kursbuch
pnpm add bahn-kursbuch
yarn add bahn-kursbuch
bun add bahn-kursbuch
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.6 |
| Published | 2018-04-22 |
| First published | 2018-04-16 |
| Weekly downloads | 0 |
| License | GPL-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 23.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Roman Karwacik |
| Maintainers | romkar |
| Keywords | kursbuch, db, railway, german, api, hafas |

## Links

- npm: https://www.npmjs.com/package/bahn-kursbuch
- Repository: https://github.com/RomanKarwacik/bahn-kursbuch
- Homepage: https://github.com/RomanKarwacik/bahn-kursbuch#readme
- Issues: https://github.com/RomanKarwacik/bahn-kursbuch/issues
- npm.io page: https://npm.io/package/bahn-kursbuch

## Dependencies (1)

- [html-entities](https://npm.io/package/html-entities.md) ^1.2.1

## Alternatives

- [angular-pipes](https://npm.io/package/angular-pipes.md) — 5.6K weekly downloads
- [@ng-web-apis/midi](https://npm.io/package/@ng-web-apis/midi.md) — 2.6K weekly downloads
- [happn-3](https://npm.io/package/happn-3.md) — 1.6K weekly downloads
- [@opensip-cli/lang-go](https://npm.io/package/@opensip-cli/lang-go.md) — 1.2K weekly downloads
- [@temporal-architect/claude-plugin](https://npm.io/package/@temporal-architect/claude-plugin.md) — 335 weekly downloads

## Recent versions

- 1.0.6 (latest) — 2018-04-22
- 1.0.5 — 2018-04-22
- 1.0.4 — 2018-04-22
- 1.0.3 — 2018-04-17
- 1.0.2 — 2018-04-16
- 1.0.1 — 2018-04-16
- 1.0.0 — 2018-04-16

## README

## bahn-kursbuch
This NodeJS module is an API for http://kursbuch.bahn.de/hafas/kbview.exe.

## Code Example

```javascript
const kursbuch = require('bahn-kursbuch');

//Lookup KBS 360 entry
kursbuch.tableLookup("360").then(function(res) {
  console.log(res);
});

//Lookup every Kursbuch entry at "Osnabrück HBF" over "Halen"
kursbuch.stationLookup("008000294","","Halen").then(function(res) {
  console.log(res);
});

//Lookup every Kursbuch entry for "NWB" trains at "Osnabrück HBF"
kursbuch.stationLookup("008000294","","","NWB").then(function(res) {
  console.log(res);
});

//Lookup every Kursbuch entry for line "NWB 18" at "Osnabrück HBF"
kursbuch.stationLookup("008000294","NWB 18").then(function(res) {
  console.log(res);
});

//Lookup Kursbuch entries for train "NWB82300"
kursbuch.trainLookup("NWB82300").then(function(res) {
  console.log(res);
});
```

"008000294" gives the same results as "Osnabrück HBF", the ID's can be obtained for example with [db-hafas](https://github.com/derhuerst/db-hafas) (Could also be implemented through Kursbuch, maybe later).

## Output format example
```javascript
kursbuch.trainLookup("NWB82300").then(function(res) {
  console.log(res);
});
```
Returns:
```
[ { doc: 'http://kursbuch.bahn.de/hafas/kbview.exe/dn/KB392_Mo_Fr_H_Mo_Fr_G24112017.pdf?filename=KB392_Mo_Fr_H_Mo_Fr_G24112017.pdf&orig=',
    kbs: '392',
    line: 'NWB 18',
    route: 'Wilhelmshaven - Oldenburg - Cloppenburg - Osnabrück',
    date: '24.11.2017' } ]
```
## Installation

```bash
npm install bahn-kursbuch
```

---
_Source: https://npm.io/package/bahn-kursbuch · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
