Deutsche Bahn Fahrplan API - Project

Sonatype helps open source projects to set up Maven repositories on https://oss.sonatype.org/

GroupId

GroupId

org.hisrc.db-fahrplan-api
ArtifactId

ArtifactId

db-fahrplan-api-project
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

pom
Description

Description

Deutsche Bahn Fahrplan API - Project
Sonatype helps open source projects to set up Maven repositories on https://oss.sonatype.org/
Source Code Management

Source Code Management

https://github.com/highsource/db-fahrplan-api

Download db-fahrplan-api-project

How to add to project

<!-- https://jarcasting.com/artifacts/org.hisrc.db-fahrplan-api/db-fahrplan-api-project/ -->
<dependency>
    <groupId>org.hisrc.db-fahrplan-api</groupId>
    <artifactId>db-fahrplan-api-project</artifactId>
    <version>1.0.0</version>
    <type>pom</type>
</dependency>
// https://jarcasting.com/artifacts/org.hisrc.db-fahrplan-api/db-fahrplan-api-project/
implementation 'org.hisrc.db-fahrplan-api:db-fahrplan-api-project:1.0.0'
// https://jarcasting.com/artifacts/org.hisrc.db-fahrplan-api/db-fahrplan-api-project/
implementation ("org.hisrc.db-fahrplan-api:db-fahrplan-api-project:1.0.0")
'org.hisrc.db-fahrplan-api:db-fahrplan-api-project:pom:1.0.0'
<dependency org="org.hisrc.db-fahrplan-api" name="db-fahrplan-api-project" rev="1.0.0">
  <artifact name="db-fahrplan-api-project" type="pom" />
</dependency>
@Grapes(
@Grab(group='org.hisrc.db-fahrplan-api', module='db-fahrplan-api-project', version='1.0.0')
)
libraryDependencies += "org.hisrc.db-fahrplan-api" % "db-fahrplan-api-project" % "1.0.0"
[org.hisrc.db-fahrplan-api/db-fahrplan-api-project "1.0.0"]

Dependencies

test (1)

Group / Artifact Type Version
junit : junit jar 4.11

Project Modules

  • client

Deutsche Bahn Fahrplan API

This projects provides a Swagger/OpenAPI specification for the Deutsche Bahn Fahrplan API:

Additionally, the project also provides a simple Java Client generated using Swagger Codegen and slightly customized.

Usage

Adding the client to your project

Maven

Add the following dependency to your project:

<dependency>
	<groupId>org.hisrc.db-fahrplan-api</groupId>
	<artifactId>db-fahrplan-api-client</artifactId>
	<version>...</version>
</dependency>

Using the client in your Java code

Creating the client

DbFahrplanApiClient client = new DefaultDbFahrplanApiClient(authKey);

Querying locations

List<StopLocation> stopLocations = client.locationName("Frankfurt Hbf");

Querying departures or arrivals

List<DepartureOrArrival> arrivals = client.arrivalBoard("008000105", LocalDateTime.now());
List<DepartureOrArrival> departures = client.departureBoard("008000105", LocalDateTime.now());

Querying journey details

List<DepartureOrArrival> arrivals = client.arrivalBoard("008000105", LocalDateTime.now());
JourneyDetailRef journeyDetailRef = arrivals.get(0).getJourneyDetailRef();
JourneyDetail journeyDetail = client.journeyDetail(journeyDetailRef);

Versions

Version
1.0.0