Java implementation to get a historical record of motor racing data from Ergast Developer API
Java
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
console
ergast
gradle/wrapper
.gitignore
.travis.yml
README.md
build.gradle
gradlew
gradlew.bat
settings.gradle

README.md

Formula One Ergast Build Status

Java implementation to get a historical record of motor racing data from Ergast Developer API.

Add dependencies

Gradle

Add the JitPack repository to your build file. Add it in your root build.gradle at the end of repositories:

allprojects {
    repositories { 
        maven { url 'https://jitpack.io' }
    }
}

Add the dependency:

dependencies {
    compile 'com.github.olerom.formula-one-ergast:ergast:0.1.1'
}

Maven

Add the JitPack repository to your build file:

<repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>

Add the dependency:

<dependency>
    <groupId>com.github.olerom.formula-one-ergast</groupId>
    <artifactId>ergast</artifactId>
    <version>0.1.1</version>
</dependency>

Usage

You have to initialize Ergast object:

Ergast ergast = new Ergast(2016, 100, 2);
Ergast ergast = new Ergast();

If you use default constructor, season will be set as NO_SEASON, limit as DEFAULT_LIMIT and offset as DEFAULT_OFFSET.

You can get the following objects that satisfy Ergast queries:

For example, to get information about pit stops at final race of 2016 season with 100 limit:

Ergast ergast = new Ergast(2016, 100, Ergast.DEFAULT_OFFSET);
ergast.getRacePitStops(21).forEach(System.out::println);

Help

It would be cool, if you review the code or create a pull request.