sportsdataio-api-client

A feign-based Java API client for the sportsdata.io API

License

License

Categories

Categories

Data CLI User Interface
GroupId

GroupId

io.github.enemyghost
ArtifactId

ArtifactId

sportsdataio-api-client
Last Version

Last Version

0.3.0
Release Date

Release Date

Type

Type

jar
Description

Description

sportsdataio-api-client
A feign-based Java API client for the sportsdata.io API
Project URL

Project URL

https://github.com/enemyghost/sportsdataio-api-client
Source Code Management

Source Code Management

http://github.com/enemyghost/sportsdataio-api-client/tree/master

Download sportsdataio-api-client

How to add to project

<!-- https://jarcasting.com/artifacts/io.github.enemyghost/sportsdataio-api-client/ -->
<dependency>
    <groupId>io.github.enemyghost</groupId>
    <artifactId>sportsdataio-api-client</artifactId>
    <version>0.3.0</version>
</dependency>
// https://jarcasting.com/artifacts/io.github.enemyghost/sportsdataio-api-client/
implementation 'io.github.enemyghost:sportsdataio-api-client:0.3.0'
// https://jarcasting.com/artifacts/io.github.enemyghost/sportsdataio-api-client/
implementation ("io.github.enemyghost:sportsdataio-api-client:0.3.0")
'io.github.enemyghost:sportsdataio-api-client:jar:0.3.0'
<dependency org="io.github.enemyghost" name="sportsdataio-api-client" rev="0.3.0">
  <artifact name="sportsdataio-api-client" type="jar" />
</dependency>
@Grapes(
@Grab(group='io.github.enemyghost', module='sportsdataio-api-client', version='0.3.0')
)
libraryDependencies += "io.github.enemyghost" % "sportsdataio-api-client" % "0.3.0"
[io.github.enemyghost/sportsdataio-api-client "0.3.0"]

Dependencies

compile (9)

Group / Artifact Type Version
com.fasterxml.jackson.core : jackson-databind jar 2.10.1
com.fasterxml.jackson.datatype : jackson-datatype-jdk8 jar 2.10.1
com.fasterxml.jackson.datatype : jackson-datatype-jsr310 jar 2.10.1
io.github.openfeign : feign-core jar 10.7.0
io.github.openfeign : feign-jackson jar 10.7.0
io.github.openfeign : feign-jaxrs jar 10.7.0
io.github.openfeign : feign-slf4j jar 10.7.0
javax.ws.rs : jsr311-api jar 1.1.1
org.slf4j : slf4j-api jar 1.7.26

test (4)

Group / Artifact Type Version
com.google.guava : guava jar 28.1-jre
io.github.openfeign : feign-mock jar 10.7.0
org.junit.jupiter : junit-jupiter-api jar 5.3.2
org.junit.jupiter : junit-jupiter-engine jar 5.3.2

Project Modules

There are no modules declared in this project.

sportsdata.io API Client

This is a feign based Java client for the sportsdata.io API.

Maven

    <dependency>
        <groupId>io.github.enemyghost</groupId>
        <artifactId>sportsdataio-api-client</artifactId>
        <version>0.3.0</version>
    </dependency>

This dependency will transitively bring required Feign and Jackson dependencies.

Usage

Use FeignClientFactory to get a properly configured Feign client targeting NcaaBasketballV3ApiClient:

    final NcaaBasketballV3ApiClient client = FeignClientFactory.createClient("https://api.sportsdata.io",
            API_KEY,
            NcaaBasketballV3ApiClient.class);
    final List<Conference> conferences = client.leagueHierarchy();
    conferences
            .stream()
            .map(Conference::getName)
            .forEach(System.out::println);

You can also add your own configuration to the Feign client:

final NcaaBasketballV3ApiClient client = FeignClientFactory.createDefaultBuilder(API_KEY, NcaaBasketballV3ApiClient.class)
        .client(myConfiguredClient)
        .logLevel(Level.FULL)
        .target("https://api.sportsdata.io", NcaaBasketballV3ApiClient.class);

Of course, you can avoid using the factory altogether and configure your own Feign client however you like.

Coverage

Currently, only the following endpoints for NCAA Men's Basketball are supported.

  • FREE tier
    • Are Games In Progress
    • Current Season
    • League Hierarchy
    • Player Details by Active
    • Player Details by Player
    • Player Details by Team
    • Stadiums
    • Teams
  • PLAYER STATS tier
    • Player Game Stats by Date
    • Player Game Stats by Player
  • FANTASY tier
    • Projected Game Stats by Date
    • Projected Game Stats by Player

The project is under active development.

Implementation Details

Accessors for all properties marked as nullable in the API documentation will return an Optional. A value of Optional#empty() represents a null field in the API response.

Contributions

Contributions are welcome, and should follow the patterns established in the entities and client packages. PRs will run mvn package to verify changes. Test coverage is required.

Build

$ git clone [email protected]:enemyghost/sportsdataio-api-client.git
$ cd sportsdataio-api-client
$ mvn clean install

Versions

Version
0.3.0
0.2.0