0.01
No commit activity in last 3 years
No release in over 3 years
Connect to and retrieve sports data from the Stattleship API
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.10
~> 10.0

Runtime

>= 2.0.2, ~> 2.0
~> 0.0.8
>= 1.11.2, ~> 1.11
>= 2.14.2, ~> 2.14
>= 1.0.1, ~> 1.0
~> 0.0.3
>= 1.0.4, ~> 1.0
>= 1.0.5, ~> 1.0
 Project Readme

stattleship-ruby

Join the chat at https://gitter.im/stattleship/stattleship-ruby Stattleship API Ruby client

Build Status

Check out the Stattleship API - The Sports Data API you've always wanted

Meaningful. Developer-Friendly.

🏈 🏀 and ⚫ ❄️ and ⚾ !

We're gonna need a bigger ⛵!

Installation

gem install stattleship-ruby

Usage

gem 'stattleship-ruby', '~> 0.1.26'

Build

gem build stattleship-ruby.gemspec

Install

gem install stattleship-ruby-0.1.26.gem

Prerequisites

You'll need

Configuration

There are two ways to configure the gem.

Stattleship.configure do |config|
  config.api_token = YOUR_TOKEN
end

or via a .env

STATTLESHIP_ACCESS_TOKEN=YOUR_TOKEN

API Documentation

Examples

Check out some examples of how to make API calls.

It's dead simple.

  • Build and set parameters
  • Use that to fetch data
  • Use fully populated PORO's with real Ruby datatypes (DateTime, Integers, bool) not just JSON strings

The pattern is pretty much as follows:

query_params = Stattleship::Params::BasketballGameLogsParams.new
query_params.player_id = 'nba-stephen-curry'
query_params.since = '1 week ago'
game_logs = Stattleship::BasketballGameLogs.fetch(params: query_params)
pp game_logs.first

That's it.

If you want to see what the example JSON responses are, have a look in fixtures as there are samples for each sport.

Apps

We're using the Stattleship API and this gem! You can, too.

Questions?

Follow us on @stattleship or join our free, public Fanboat Slack group where you can try out "cosell" -- an instance of Glickman -- and get API updates.