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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@datafire/deutschebahn_stada

v6.0.0

Published

DataFire integration for Stationsdatenbereitstellung

Downloads

16

Readme

@datafire/deutschebahn_stada

Client library for Stationsdatenbereitstellung

Installation and Usage

npm install --save @datafire/deutschebahn_stada
let deutschebahn_stada = require('@datafire/deutschebahn_stada').create();

.then(data => {
  console.log(data);
});

Description

An API providing master data for German railway stations by DB Station&Service AG.

Actions

stations.get

Get a QueryResult object containing station objects from the database applying to the parameters described below.

QueryResult is a container providing the following information about the query result.

  1. the total number of hits

  2. the maximum number of hits to be returned in that QueryResult object

  3. the offset of the first hit returned in that QueryResult object with respect to all hits returned by the query

  4. the result objects

The parameters described below work as filters to reduce the number of hits returned. Some of these parameters must be used only once, others are allowed to be used multiple times. Valid parameters that are allowed to be used only once are offset, limit and logicaloperator.

All other parameters described below may be used multiple times.

If a parameter is given more than once, the result will contain all hits that match all given parameter values.

E.g. federalstate=berlin&federalstate=saarland returns all stations in Berlin and Saarland.

If more than one filter criterion is used at the same time, the different filter criteria are interpreted as if they are combined by a logical AND operator, unless the parameter logicaloperator is set to or.

E.g. category=1-2&federalstate=hamburg returns all stations in Hamburg having category 1 or 2.

category=1-2&federalstate=hamburg&federalsate=hessen returns all stations in Hamburg and Hessen having category 1 or 2, while

searchstring=berlin*&federalstate=hamburg&federalsate=hessen&logicaloperator=or will return all stations with a name starting with 'berlin' as well as all stations in Hamburg and Hessen.

If no 'limit' parameter is given, the number of hits (stations) is set to its maximum value of 10000.

To specify parameter values containing German umlauts, the following encoding has to be used

  • ä => %C3%A4
  • ö => %C3%B6
  • ü => %C3%BC
  • Ä => %C3%84
  • Ö => %C3%96
  • Ü => %C3%9C
  • ß => %C3%9F
deutschebahn_stada.stations.get({}, context)

Input

  • input object
    • offset integer: Offset of the first hit returned in the QueryResult object with respect to all hits returned by the query. If this parameter is omitted, it will be set to 0 internally.
    • limit integer: The maximum number of hits to be returned by that query. If 'limit' is set greater than 10000, it will be reset to 10000 internally and only 10000 hits will be returned.
    • searchstring string: String to search for a station name. The wildcards * (indicating an arbitrary number of characters) and ? (indicating one single character) can be used in the search pattern. A comma separated list of station names is also supported (e.g. searchstring=hamburg*,berlin*).
    • category string: Filter by station category. Category ranges are supported as well as lists of categories (e.g. category=2-4 or category=1,3-5). The category must be between 1 and 7 otherwise a parameter exception is returned.
    • federalstate string: Filter by German federal state. Lists of federal states are also supported (e.g. federalstate=bayern,hamburg). Wildcards are not allowed here.
    • eva integer: Filter by EVA number. Wildcards are not allowed here.
    • ril string: Filter by Ril100-identifier. Wildcards are not allowed here.
    • logicaloperator string: Logical operator to combine query parameters (default=AND). See above for further details. Allowed values: or, and

Output

stations.id.get

Get a QueryResult object containing one station object specified by its id.

deutschebahn_stada.stations.id.get({
  "id": 0
}, context)

Input

  • input object
    • id required integer: Station ID (Bahnhofsnummer)

Output

szentralen.get

Get a QueryResult object containing SZentralen objects from the database applying to the parameters described below. QueryResult is a container providing the following information about the query result.

  1. the total number of hits
  2. the maximum number of hits to be returned in that QueryResult object
  3. the offset of the first hit returned in that QueryResult object with respect to all hits returned by the query
  4. the result objects
deutschebahn_stada.szentralen.get({}, context)

Input

  • input object
    • offset integer: Offset of the first hit returned in the QueryResult object with respect to all hits returned by the query. If this parameter is omitted, it will be set to 0 internally.
    • limit integer: The maximum number of hits to be returned by that query. If 'limit' is set greater than 10000, it will be reset to 10000 internally and only 100 hits will be returned.

Output

szentralen.id.get

Get a QueryResult object containing one SZentralen object specified by its id.

deutschebahn_stada.szentralen.id.get({
  "id": 0
}, context)

Input

  • input object
    • id required integer: id of the 3-S-Zentrale.

Output

Definitions

Address

  • Address object
    • city string
    • houseNumber string
    • street string
    • zipcode integer

Aufgabentraeger

  • Aufgabentraeger object: local public sector entity, responsible for short distance public transport in a specific area
    • name string: full name of Aufgabentraeger
    • shortname string: unique identifier

EVANumber

  • EVANumber object
    • geographicCoordinate GeographicPoint
    • isMain boolean: station related EVA-Numbers
    • number integer: EVA identifier

Error

  • Error object
    • errMsg string: error message
    • errNo integer: error number

GeographicPoint

  • GeographicPoint object: GEOJSON object of type point. By default WGS84 is the coordinate system in GEOJSON.
    • coordinates array: first value is longitude, second latitude third altitude (currently not provided)
      • items number
    • type string: the type of the GEOJSON Object e.g. point. Currently only point coordinates without altitude are provided.

OpeningHours

  • OpeningHours object: period of time from/to
    • fromTime string
    • toTime string

Partial

  • Partial string (values: yes, no, partial)

RegionalBereichRef

  • RegionalBereichRef object: reference object. an internal organization type of Station&Service, regional department.
    • name string: name of the regional department
    • number integer: unique identifier of the regional department
    • shortName string

Regionalbereich

  • Regionalbereich object: reference object. an internal organization type of Station&Service, regional department.
    • name string: name of the regional department
    • number integer: unique identifier of the regional department
    • shortName string

RiL100Identifier

  • RiL100Identifier object
    • geographicCoordinate GeographicPoint
    • hasSteamPermission boolean: permission for steam engines y/n
    • isMain boolean: is stations main Ril100. Determination of Station&Service AG
    • rilIdentifier string: Unique identifier of 'Betriebsstelle' according to Ril100

SZentrale

  • SZentrale object: 3-S-Zentralen are 7/24 hours operating centers for german railway stations
    • address Address
    • email string: email adress of the 3-S-Zentrale (no longer supported!)
    • internalFaxNumber string: internal fax number
    • internalPhoneNumber string: internal phone number
    • mobilePhoneNumber string: mobile phone number (no longer supported!)
    • name string: unique identifier of 3SZentrale
    • number integer: unique identifier for SZentrale
    • publicFaxNumber string: public fax number
    • publicPhoneNumber string

SZentraleQuery

  • SZentraleQuery object
    • limit integer: maximum number of result objects to be returned
    • offset integer: offset of the first result object with respect to the total number of hits produced by the query
    • result array: result objects produced by that query
    • total integer: total number of hits produced by that query

SZentraleRef

  • SZentraleRef object: reference object contained in station
    • name string: unique identifier of 3SZentrale
    • number integer: unique identifier for SZentrale
    • publicPhoneNumber string

Schedule

Station

  • Station object
    • DBinformation Schedule
    • aufgabentraeger Aufgabentraeger
    • category integer: the stations category (-1...7). Stations with category -1 or 0 are not in production, e.g. planned, saled, without train stops.
    • evaNumbers array: station related EVA-Numbers
    • federalState string: german federal state
    • hasBicycleParking boolean: public bicycle parking y/n
    • hasCarRental boolean: car sharing or car rental y/n
    • hasDBLounge boolean: DB lounge y/n
    • hasLocalPublicTransport boolean: local public transport y/n
    • hasLockerSystem boolean: public facilities y/n
    • hasLostAndFound boolean: lost and found y/n
    • hasMobilityService string: values are 'no', 'yes, advance notification is requested...' or 'yes, advance notification is required...'
    • hasParking boolean: public parking y/n
    • hasPublicFacilities boolean: public facilities y/n
    • hasRailwayMission boolean: railway mission y/n
    • hasSteplessAccess Partial
    • hasTaxiRank boolean: taxi rank in front of the station y/n
    • hasTravelCenter boolean: local travel center y/n
    • hasTravelNecessities boolean: a shop for travel necessities y/n
    • hasWiFi boolean: public Wi-Fi is available y/n
    • localServiceStaff Schedule
    • mailingAdress Address
    • name string: the stations name
    • number integer: unique identifier representing a specific railway station
    • priceCategory integer: determines in some respect the price for train stops at a specific station (1..7)
    • regionalbereich RegionalBereichRef
    • riL100Identifiers array: station related Ril100s
    • stationManagement StationManagementRef
    • szentrale SZentraleRef
    • timetableOffice TimetableOffice

StationManagement

  • StationManagement object
    • name string
    • number integer: identifier

StationManagementRef

  • StationManagementRef object
    • name string
    • number integer: identifier

StationQuery

  • StationQuery object
    • limit integer: maximum number of result objects to be returned
    • offset integer: offset of the first result object with respect to the total number of hits produced by the query
    • result array: result objects produced by that query
    • total integer: total number of hits produced by that query

TimetableOffice

  • TimetableOffice object
    • email string: email
    • name string: identifier