# wifi-on-ice-portal-client

> Query information from the WifiOnICE portal in German ICE trains.

Latest version **1.2.0** (published 2021-10-26) · ISC license · 0 weekly downloads

## Install

```sh
npm install wifi-on-ice-portal-client
pnpm add wifi-on-ice-portal-client
yarn add wifi-on-ice-portal-client
bun add wifi-on-ice-portal-client
```

## 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.2.0 |
| Published | 2021-10-26 |
| First published | 2017-09-06 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8 |
| Dependencies | 6 |
| Unpacked size | 10.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 48 |
| Author | Jannis R |
| Maintainers | derhuerst |
| Keywords | ice, intercity express, deutsche bahn, db, train, wifionice |

## Links

- npm: https://www.npmjs.com/package/wifi-on-ice-portal-client
- Repository: https://github.com/derhuerst/wifi-on-ice-portal-client
- Issues: https://github.com/derhuerst/wifi-on-ice-portal-client/issues
- npm.io page: https://npm.io/package/wifi-on-ice-portal-client

## Dependencies (6)

- [slugg](https://npm.io/package/slugg.md) ^1.2.1
- [lodash.omit](https://npm.io/package/lodash.omit.md) ^4.5.0
- [fetch-ponyfill](https://npm.io/package/fetch-ponyfill.md) ^4.1.0
- [pinkie-promise](https://npm.io/package/pinkie-promise.md) ^2.0.1
- [moment-timezone](https://npm.io/package/moment-timezone.md) ^0.5.13
- [is-roughly-equal](https://npm.io/package/is-roughly-equal.md) ^0.1.0

## 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
- [btrz-health-check](https://npm.io/package/btrz-health-check.md) — 474 weekly downloads

## Recent versions

- 1.2.0 (latest) — 2021-10-26
- 1.1.0 — 2020-02-25
- 1.0.0 — 2019-09-29
- 0.2.1 — 2018-06-13
- 0.2.0 — 2018-01-17
- 0.1.2 — 2017-09-07
- 0.1.1 — 2017-09-06
- 0.1.0 — 2017-09-06

## README

# wifi-on-ice-portal-client

**Query information from the [WifiOnICE portal](https://www.bahn.com/en/view/trains/on-board-service/wifi.shtml) in [German ICE trains](https://en.wikipedia.org/wiki/Intercity-Express).**

A lot of the [features of the portal](https://gist.github.com/derhuerst/bdca32a50c7ca4a004cee90745a7f68c) are not covered yet.

[![npm version](https://img.shields.io/npm/v/wifi-on-ice-portal-client.svg)](https://www.npmjs.com/package/wifi-on-ice-portal-client)
![ISC-licensed](https://img.shields.io/github/license/derhuerst/wifi-on-ice-portal-client.svg)
[![support me via GitHub Sponsors](https://img.shields.io/badge/support%20me-donate-fa7664.svg)](https://github.com/sponsors/derhuerst)
[![chat with me on Twitter](https://img.shields.io/badge/chat%20with%20me-on%20Twitter-1da1f2.svg)](https://twitter.com/derhuerst)


## Installing

```shell
npm install wifi-on-ice-portal-client
```


## Usage

```js
const portal = require('wifi-on-ice-portal-client')

portal.status()
.then(console.log)
.catch(console.error)
```

```js
{
	serviceLevel: 'AVAILABLE_SERVICE',
	internet: 'HIGH',
	latitude: 51.2719795,
	longitude: 13.4613135,
	tileY: 141,
	tileX: 275,
	series: '411',
	serverTime: 1635252079700,
	speed: 0,
	trainType: 'ICE',
	tzn: 'Tz1178',
	wagonClass: 'FIRST',
	connectivity: {
		currentState: 'HIGH',
		nextState: 'UNSTABLE',
		remainingTimeSeconds: 3600
	},
	bapInstalled: true,
	ok: true,
	gpsOk: true
}
```


## API

## `portal.status()`

Returns a [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise).

## `portal.journey()`

Returns a [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) that resolves with a [*Friendly Public Transport Format* `1.2.1` `journey`](https://github.com/public-transport/friendly-public-transport-format/blob/1.2.1/spec/readme.md#journey) leg, similar to [`db-hafas`](https://github.com/public-transport/db-hafas#db-hafas). It looks like this:

```js
{
	public: true,
	mode: 'train',
	line: { type: 'line', id: 'ice-1556', name: 'ICE 1556' },
	traveledDistance: 44502,
	distanceToPreviousStop: 62523,
	totalDistance: 436961,
	next: {
		type: 'station',
		id: '8010205_00',
		name: 'Leipzig Hbf',
		location: { type: 'location', latitude: 51.345471, longitude: 12.382064 }
	},
	scheduledNext: {
		type: 'station',
		id: '8010205_00',
		name: 'Leipzig Hbf',
		location: { type: 'location', latitude: 51.345471, longitude: 12.382064 }
	},
	previous: {
		type: 'station',
		id: '8010297_00',
		name: 'Riesa',
		location: { type: 'location', latitude: 51.309654, longitude: 13.287734 }
	},
	last: {
		type: 'station',
		id: '8070003_00',
		name: 'Frankfurt (M) Flughafen Fernbf',
		location: { type: 'location', latitude: 50.053167, longitude: 8.570185 }
	},
	passed: [
		{
			station: {
				type: 'station',
				id: '8010085_00',
				name: 'Dresden Hbf',
				location: { type: 'location', latitude: 51.040563, longitude: 13.732035 }
			},
			arrival: null,
			arrivalDelay: null,
			arrivalPlatform: '3',
			departure: '2021-10-26T14:16:00+02:00',
			departureDelay: 300,
			departurePlatform: '3',
			passed: true,
			kmFromStart: 0,
			delayReasons: null
		},
		{
			station: {
				type: 'station',
				id: '8010089_00',
				name: 'Dresden-Neustadt',
				location: { type: 'location', latitude: 51.065899, longitude: 13.740701 }
			},
			arrival: '2021-10-26T14:20:00+02:00',
			arrivalDelay: 300,
			arrivalPlatform: '6',
			departure: '2021-10-26T14:22:00+02:00',
			departureDelay: 300,
			departurePlatform: '6',
			passed: true,
			kmFromStart: 2.882,
			delayReasons: [ { code: '36', text: 'Reparatur am Zug' } ]
		},
		// ...
		{
			station: {
				type: 'station',
				id: '8000105_00',
				name: 'Frankfurt (Main) Hbf',
				location: { type: 'location', latitude: 50.107145, longitude: 8.663789 }
			},
			arrival: '2021-10-26T18:38:00+02:00',
			arrivalDelay: 120,
			arrivalPlatform: '7',
			departure: '2021-10-26T18:44:00+02:00',
			departureDelay: 120,
			departurePlatform: '7',
			passed: false,
			kmFromStart: 427.979,
			delayReasons: [ { code: '36', text: 'Reparatur am Zug' } ]
		},
		{
			station: {
				type: 'station',
				id: '8070003_00',
				name: 'Frankfurt (M) Flughafen Fernbf',
				location: { type: 'location', latitude: 50.053167, longitude: 8.570185 }
			},
			arrival: '2021-10-26T18:57:00+02:00',
			arrivalDelay: 120,
			arrivalPlatform: 'Fern 7',
			departure: null,
			departureDelay: null,
			departurePlatform: 'Fern 7',
			passed: false,
			kmFromStart: 436.961,
			delayReasons: [ { code: '36', text: 'Reparatur am Zug' } ]
		}
	]
}
```


## Related

- [*Was das neue Bahn-Wifi über seine Nutzer ausplaudert*](https://hannover.ccc.de/~nexus/dbwifi/)
- [`wifi-on-ice-position-stream`](https://github.com/derhuerst/wifi-on-ice-position-stream) – A stream of ICE positions, taken from the on-board WiFi.
- [`record-ice-movement`](https://github.com/derhuerst/record-ice-movement) – Record the movement of any ICE using the on-board WiFi.
- [`sncf-wifi-portal-client`](https://github.com/derhuerst/sncf-wifi-portal-client) – Query information from the SNCF WiFi portal in French TGV trains.
- [`digital-im-regio-portal-client`](https://github.com/derhuerst/digital-im-regio-portal-client) – Query information from the Digital im Regio portal in German Regio trains.
- [`cd-wifi-client`](https://github.com/derhuerst/cd-wifi-client) – A client for the onboard WiFi portal of České dráhy (Czech Railways) trains.


## Contributing

If you have a question or have difficulties using `wifi-on-ice-portal-client`, please double-check your code and setup first. If you think you have found a bug or want to propose a feature, refer to [the issues page](https://github.com/derhuerst/wifi-on-ice-portal-client/issues).

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