Sha256: 876c6afb1c9e7e0564e20d63b951d47aef6db79ec55ccbe0a6d32fb9e3a723e2

Contents?: true

Size: 1.37 KB

Versions: 127

Compression:

Stored size: 1.37 KB

Contents

# Sportradar Baseball

![API Reference](http://developer.sportradar.com/files/MLBv6SVG.svg)

*Currently, only MLB is supported.*

## MLB

Get started with official MLB api v6:

```ruby
mlb = Sportradar::Api::Baseball::Mlb::Hierarchy.new
res = mlb.get_daily_summary # => res is the raw response from Sportradar. `mlb` now has game summaries to interact with
res = mlb.get_hierarchy     # => res is the raw response from Sportradar. `mlb` now has leagues/divisions/teams to interact with
mlb.leagues.count           # => 2
mlb.divisions.count         # => 6
mlb.teams.count             # => 30
res = mlb.get_schedule      # => res is the raw response from Sportradar. `mlb` now has games to interact with
mlb.games.count             # => 2430 

game = mlb.games.sample     # => Sportradar::Api::Baseball::Game
data = game.get_pbp         # => data is raw response from Sportradar. `game` now has innings/half innings/atbats/pitches to interact with
game.innings.count          # => 10 (Sportradar has an inning #0, representing starting lineups)
game.half_innings.count     # => 20 (if the game went the full 9 innings)
data = game.get_summary     # => data is raw response from Sportradar. `game` now statistical information to interact with
game.count                  # `count` contains information about the current game state, such as balls/strikes to current batter, current inning, and outs
```

Version data entries

127 entries across 127 versions & 1 rubygems

Version Path
sportradar-api-0.20.2 lib/sportradar/api/baseball/README.md
sportradar-api-0.20.1 lib/sportradar/api/baseball/README.md
sportradar-api-0.20.0 lib/sportradar/api/baseball/README.md
sportradar-api-0.20.0.pre2 lib/sportradar/api/baseball/README.md
sportradar-api-0.20.0.pre lib/sportradar/api/baseball/README.md
sportradar-api-0.19.6 lib/sportradar/api/baseball/README.md
sportradar-api-0.19.5 lib/sportradar/api/baseball/README.md
sportradar-api-0.19.4 lib/sportradar/api/baseball/README.md
sportradar-api-0.19.3 lib/sportradar/api/baseball/README.md
sportradar-api-0.19.2 lib/sportradar/api/baseball/README.md
sportradar-api-0.19.1 lib/sportradar/api/baseball/README.md
sportradar-api-0.19.0 lib/sportradar/api/baseball/README.md
sportradar-api-0.18.1 lib/sportradar/api/baseball/README.md
sportradar-api-0.18.0 lib/sportradar/api/baseball/README.md
sportradar-api-0.17.6 lib/sportradar/api/baseball/README.md
sportradar-api-0.17.5 lib/sportradar/api/baseball/README.md
sportradar-api-0.17.5.pre lib/sportradar/api/baseball/README.md
sportradar-api-0.17.4 lib/sportradar/api/baseball/README.md
sportradar-api-0.17.3 lib/sportradar/api/baseball/README.md
sportradar-api-0.17.2 lib/sportradar/api/baseball/README.md