crawlora-mlb 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/CHANGELOG.md +5 -0
- data/LICENSE +21 -0
- data/README.md +106 -0
- data/lib/crawlora/mlb/client.rb +460 -0
- data/lib/crawlora/mlb/version.rb +5 -0
- data/lib/crawlora/mlb.rb +2 -0
- metadata +53 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 78850e45c31684ca666e472c041575a27d989fd91d1d51faa3823a62928e24cc
|
|
4
|
+
data.tar.gz: 26d552539222ea5003dc0860b3987442e720d237530726677177edff4118119d
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: a3e953d9d64181a67ed46f622f3d5745c36f9bc2b9a469438b2cd688d9b2c6b980dc70512f72446aa2eb946cf28cf94ed7bcd81c6edf8448770a28a40d4072b6
|
|
7
|
+
data.tar.gz: 74d49ff332f96239338243b863e5faad09584e9496c8102e48cf66b7e2ae58e353d22cc32fe4ffff40793de7a7010dfcc9a3bbafb5eb5f174cc485e7855f7abc
|
data/CHANGELOG.md
ADDED
data/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Crawlora
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# Crawlora MLB API client for Ruby (`crawlora-mlb`)
|
|
2
|
+
|
|
3
|
+
This Ruby gem calls Crawlora's hosted MLB API at `https://api.crawlora.net/api/v1`. It exposes 66 endpoints covering game schedules and details, box scores, standings, player and team statistics, news, and league discovery; it does not call or scrape MLB directly. Requests require your Crawlora API key and use your account's service plan.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```ruby
|
|
8
|
+
gem "crawlora-mlb"
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Create an account at [crawlora.net](https://crawlora.net/signup?utm_source=rubygems&utm_medium=referral&utm_campaign=platform-clients&utm_content=mlb-ruby-signup), open the [Crawlora console](https://crawlora.net/app?utm_source=rubygems&utm_medium=referral&utm_campaign=platform-clients&utm_content=mlb-ruby-console) to get an API key, and set `CRAWLORA_API_KEY` before running the client:
|
|
12
|
+
|
|
13
|
+
```ruby
|
|
14
|
+
require "json"
|
|
15
|
+
require "crawlora/mlb"
|
|
16
|
+
|
|
17
|
+
client = Crawlora::Mlb::Client.new
|
|
18
|
+
result = client.request("mlb-search", JSON.parse("{\"q\": \"sample\"}"))
|
|
19
|
+
puts result
|
|
20
|
+
client.close
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Use an operation-specific method for normal calls. `request(operation_id, params = {}, response_type: :auto)` is available for every operation. `response_type: :text` returns raw response text. This gem includes 66 API operations.
|
|
24
|
+
|
|
25
|
+
```ruby
|
|
26
|
+
client = Crawlora::Mlb::Client.new(api_key: ENV.fetch("CRAWLORA_API_KEY"), timeout: 30)
|
|
27
|
+
# client.<operation_method>(<endpoint parameters>)
|
|
28
|
+
client.close
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Client options include `api_key`, `base_url`, and `timeout`. Ruby stdlib provides the HTTP and JSON support.
|
|
32
|
+
|
|
33
|
+
## Supported MLB API endpoints
|
|
34
|
+
|
|
35
|
+
Browse every route included in this gem. The [endpoint reference](https://github.com/Crawlora-org/crawlora-mlb/blob/main/docs/usage.md) includes parameter and response details.
|
|
36
|
+
|
|
37
|
+
| Method | Endpoint | API operation | Description |
|
|
38
|
+
| --- | --- | --- | --- |
|
|
39
|
+
| `GET` | `/mlb/discovery` | `mlb-discovery` | Discover MLB sections and Stats API values |
|
|
40
|
+
| `GET` | `/mlb/editorial-feed` | `mlb-editorial-feed` | Get an MLB.com editorial feed |
|
|
41
|
+
| `GET` | `/mlb/game` | `mlb-game` | Get an MLB game feed |
|
|
42
|
+
| `GET` | `/mlb/game-boxscore` | `mlb-game-boxscore` | Get an MLB player boxscore |
|
|
43
|
+
| `GET` | `/mlb/game-play-by-play` | `mlb-game-play-by-play` | Get MLB game play-by-play |
|
|
44
|
+
| `GET` | `/mlb/league-leaders` | `mlb-league-leaders` | Get MLB league leaders |
|
|
45
|
+
| `GET` | `/mlb/league-stats` | `mlb-league-stats` | Get ranked MLB league statistics |
|
|
46
|
+
| `GET` | `/mlb/player` | `mlb-player` | Get an MLB player |
|
|
47
|
+
| `GET` | `/mlb/player-stats` | `mlb-player-stats` | Get MLB player season statistics |
|
|
48
|
+
| `GET` | `/mlb/prospect-rankings` | `mlb-prospect-rankings` | Get MLB Pipeline curated prospect rankings |
|
|
49
|
+
| `GET` | `/mlb/prospect-stats` | `mlb-prospect-stats` | Get MLB Pipeline prospect statistics and rankings |
|
|
50
|
+
| `GET` | `/mlb/schedule` | `mlb-schedule` | Get the MLB schedule and scores |
|
|
51
|
+
| `GET` | `/mlb/search` | `mlb-search` | Search MLB players, teams, and content topics |
|
|
52
|
+
| `GET` | `/mlb/standings` | `mlb-standings` | Get MLB standings |
|
|
53
|
+
| `GET` | `/mlb/statcast-abs-challenges` | `mlb-statcast-abs-challenges` | Get Baseball Savant ABS challenge rankings |
|
|
54
|
+
| `GET` | `/mlb/statcast-active-spin` | `mlb-statcast-active-spin` | Get Baseball Savant Active Spin rows |
|
|
55
|
+
| `GET` | `/mlb/statcast-arm-angle` | `mlb-statcast-arm-angle` | Get Baseball Savant Pitcher Arm Angle rows |
|
|
56
|
+
| `GET` | `/mlb/statcast-arm-strength` | `mlb-statcast-arm-strength` | Get Baseball Savant Arm Strength leaderboard data |
|
|
57
|
+
| `GET` | `/mlb/statcast-arm-strength-player` | `mlb-statcast-arm-strength-player` | Get Baseball Savant player throw details |
|
|
58
|
+
| `GET` | `/mlb/statcast-arm-value` | `mlb-statcast-arm-value` | Get Baseball Savant Extra Bases Run Value leaderboard data |
|
|
59
|
+
| `GET` | `/mlb/statcast-arm-value-details` | `mlb-statcast-arm-value-details` | Get expanded Baseball Savant Arm Value player plays |
|
|
60
|
+
| `GET` | `/mlb/statcast-baserunning` | `mlb-statcast-baserunning` | Get Baseball Savant baserunning leaderboard tables |
|
|
61
|
+
| `GET` | `/mlb/statcast-bat-tracking` | `mlb-statcast-bat-tracking` | Get Baseball Savant bat-tracking rows |
|
|
62
|
+
| `GET` | `/mlb/statcast-batted-ball` | `mlb-statcast-batted-ball` | Get Baseball Savant Batted Ball Profile rows |
|
|
63
|
+
| `GET` | `/mlb/statcast-birthday-index` | `mlb-statcast-birthday-index` | Get Baseball Savant Sarah Langs Birthday Index rows |
|
|
64
|
+
| `GET` | `/mlb/statcast-catcher-blocking` | `mlb-statcast-catcher-blocking` | Get Baseball Savant Catcher Blocking leaderboard rows |
|
|
65
|
+
| `GET` | `/mlb/statcast-catcher-blocking-details` | `mlb-statcast-catcher-blocking-details` | Get Baseball Savant Catcher Blocking play details |
|
|
66
|
+
| `GET` | `/mlb/statcast-catcher-framing` | `mlb-statcast-catcher-framing` | Get Baseball Savant Catcher Framing leaderboard rows |
|
|
67
|
+
| `GET` | `/mlb/statcast-catcher-framing-details` | `mlb-statcast-catcher-framing-details` | Get Baseball Savant Catcher Framing pitch-event details |
|
|
68
|
+
| `GET` | `/mlb/statcast-catcher-pop-time` | `mlb-statcast-catcher-pop-time` | Get Baseball Savant Catcher Pop Time leaderboard |
|
|
69
|
+
| `GET` | `/mlb/statcast-catcher-stance` | `mlb-statcast-catcher-stance` | Get Baseball Savant Catcher Stance rows |
|
|
70
|
+
| `GET` | `/mlb/statcast-catcher-throwing` | `mlb-statcast-catcher-throwing` | Get Baseball Savant Catcher Throwing leaderboard rows |
|
|
71
|
+
| `GET` | `/mlb/statcast-catcher-throwing-details` | `mlb-statcast-catcher-throwing-details` | Get Catcher Throwing attempt details |
|
|
72
|
+
| `GET` | `/mlb/statcast-expected` | `mlb-statcast-expected` | Get Baseball Savant Expected Statistics |
|
|
73
|
+
| `GET` | `/mlb/statcast-fielding-run-value` | `mlb-statcast-fielding-run-value` | Get Baseball Savant Fielding Run Value rows |
|
|
74
|
+
| `GET` | `/mlb/statcast-first-base-receiving` | `mlb-statcast-first-base-receiving` | Get Baseball Savant First Base Receiving leaderboards |
|
|
75
|
+
| `GET` | `/mlb/statcast-first-base-receiving-details` | `mlb-statcast-first-base-receiving-details` | Get a player's First Base Receiving play records |
|
|
76
|
+
| `GET` | `/mlb/statcast-home-runs` | `mlb-statcast-home-runs` | Get Baseball Savant Home Runs Tracking |
|
|
77
|
+
| `GET` | `/mlb/statcast-home-runs-details` | `mlb-statcast-home-runs-details` | Get Baseball Savant Home Runs play details |
|
|
78
|
+
| `GET` | `/mlb/statcast-leaders` | `mlb-statcast` | Get Baseball Savant Statcast leaderboard data |
|
|
79
|
+
| `GET` | `/mlb/statcast-oaa` | `mlb-statcast-oaa` | Get Baseball Savant Outs Above Average |
|
|
80
|
+
| `GET` | `/mlb/statcast-park-factors` | `mlb-statcast-park-factors` | Get Baseball Savant Statcast Park Factors rows |
|
|
81
|
+
| `GET` | `/mlb/statcast-percentile` | `mlb-statcast-percentile` | Get Baseball Savant Percentile Rankings |
|
|
82
|
+
| `GET` | `/mlb/statcast-pitch-arsenal` | `mlb-statcast-pitch-arsenal` | Get Baseball Savant Pitch Arsenal Stats |
|
|
83
|
+
| `GET` | `/mlb/statcast-pitch-arsenal-details` | `mlb-statcast-pitch-arsenal-details` | Get Baseball Savant Pitch Arsenal play details |
|
|
84
|
+
| `GET` | `/mlb/statcast-pitch-arsenals` | `mlb-statcast-pitch-arsenals` | Get Baseball Savant Pitch Arsenals |
|
|
85
|
+
| `GET` | `/mlb/statcast-pitch-movement` | `mlb-statcast-pitch-movement` | Get Baseball Savant Pitch Movement rows |
|
|
86
|
+
| `GET` | `/mlb/statcast-pitch-tempo` | `mlb-statcast-pitch-tempo` | Get Baseball Savant Pitch Tempo rows |
|
|
87
|
+
| `GET` | `/mlb/statcast-pitch-tempo-player` | `mlb-statcast-pitch-tempo-player` | Get a player's Pitch Tempo detail rows |
|
|
88
|
+
| `GET` | `/mlb/statcast-pitch-timer` | `mlb-statcast-pitch-timer` | Get Baseball Savant Pitch Timer infraction rows |
|
|
89
|
+
| `GET` | `/mlb/statcast-player-details` | `mlb-statcast-player-details` | Get expanded standard Baseball Savant Statcast player plays |
|
|
90
|
+
| `GET` | `/mlb/statcast-rolling` | `mlb-statcast-rolling` | Get Baseball Savant Rolling Windows rows |
|
|
91
|
+
| `GET` | `/mlb/statcast-run-value` | `mlb-statcast-run-value` | Get Baseball Savant Run Value rows |
|
|
92
|
+
| `GET` | `/mlb/statcast-running-game` | `mlb-statcast-running-game` | Get Baseball Savant Running Game leaderboards |
|
|
93
|
+
| `GET` | `/mlb/statcast-running-game-details` | `mlb-statcast-running-game-details` | Get Baseball Savant Running Game play details |
|
|
94
|
+
| `GET` | `/mlb/statcast-sprint-speed` | `mlb-statcast-sprint-speed` | Get Baseball Savant Sprint Speed player rows |
|
|
95
|
+
| `GET` | `/mlb/statcast-sprint-speed-teams` | `mlb-statcast-sprint-speed-teams` | Get Baseball Savant Sprint Speed team rows |
|
|
96
|
+
| `GET` | `/mlb/statcast-swing-path` | `mlb-statcast-swing-path` | Get Baseball Savant Swing Path and Attack Angle rows |
|
|
97
|
+
| `GET` | `/mlb/statcast-swing-timing` | `mlb-statcast-swing-timing` | Get Baseball Savant Swing Timing and Miss Distance rows |
|
|
98
|
+
| `GET` | `/mlb/statcast-swing-timing-details` | `mlb-statcast-swing-timing-details` | Get Baseball Savant Swing Timing player details |
|
|
99
|
+
| `GET` | `/mlb/statcast-top-performers` | `mlb-statcast-top-performers` | Get Baseball Savant Top Performers |
|
|
100
|
+
| `GET` | `/mlb/statcast-year-to-year` | `mlb-statcast-year-to-year` | Get Baseball Savant Year-to-Year Changes |
|
|
101
|
+
| `GET` | `/mlb/team-roster` | `mlb-team-roster` | Get an MLB team roster |
|
|
102
|
+
| `GET` | `/mlb/team-stats` | `mlb-team-stats` | Get MLB team season statistics |
|
|
103
|
+
| `GET` | `/mlb/teams` | `mlb-teams` | List MLB teams |
|
|
104
|
+
| `GET` | `/mlb/transactions` | `mlb-transactions` | List MLB transactions |
|
|
105
|
+
|
|
106
|
+
See [Crawlora](https://crawlora.net/?utm_source=rubygems&utm_medium=referral&utm_campaign=platform-clients&utm_content=mlb-ruby-homepage), the [API documentation](https://crawlora.net/docs?utm_source=rubygems&utm_medium=referral&utm_campaign=platform-clients&utm_content=mlb-ruby-api-docs), and [the package repository](https://github.com/Crawlora-org/crawlora-mlb) for account setup, the API operation reference, and release history.
|