You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+16-13Lines changed: 16 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -15,40 +15,41 @@ If you install manually, be sure to also install requests.
15
15
16
16
## Available Functions
17
17
18
-
*`statsapi.get()` - make calls directly to MLB StatsAPI endpoints;
19
-
supports the most flexibility in request parameters, and returns raw json data
18
+
*`statsapi.get()` - make calls directly to MLB StatsAPI endpoints; supports the most flexibility in request parameters, and returns raw json data
20
19
21
-
*`statsapi.meta()` - retrieve available values from StatsAPI for use in other queries,
22
-
or look up descriptions for values found in API results
20
+
*`statsapi.meta()` - retrieve available values from StatsAPI for use in other queries, or look up descriptions for values found in API results
23
21
24
-
*`statsapi.notes()` - retrieve notes for a given endpoint,
25
-
including a list of required parameters, as well as hints for some endpoints
22
+
*`statsapi.notes()` - retrieve notes for a given endpoint, including a list of required parameters, as well as hints for some endpoints
23
+
24
+
*`statsapi.lookup_player()` - get a list of player data based on first, last, or full name, jersey number, current team Id, position, etc.
25
+
26
+
*`statsapi.lookup_team()` - get a lsit of teams info based on the team name, city, abbreviation, or file code
26
27
27
28
*`statsapi.schedule()` - retrieve a list of games on a given date/range and/or team/opponent
28
29
29
30
*`statsapi.boxscore()` - generate a formatted boxscore for a given game
30
31
31
32
*`statsapi.linescore()` - generate a formatted linescore for a given game
32
33
33
-
*`statsapi.roster()` - generate a list of players on a team's roster
34
+
*`statsapi.roster()` - generate a formatted list of players on a team's roster
34
35
35
36
*`statsapi.standings()` - generate a formatted list of standings for a given league/date
36
37
37
-
*`statsapi.team_leaders()` - generate a list of a team's leaders for a given stat
38
+
*`statsapi.team_leaders()` - generate a formatted list of a team's leaders for a given stat
38
39
39
-
*`statsapi.league_leaders()` - generate a list of stat leaders for all-time (single season) or a given season
40
+
*`statsapi.league_leaders()` - generate a formatted list of stat leaders for all-time (single season) or a given season
40
41
41
-
*`statsapi.player_stats()` - get a list of a player's career or season stats
42
+
*`statsapi.player_stats()` - generate a formatted list of a player's career or season stats
42
43
43
44
*`statsapi.last_game()` - get the game id for the given team's most recent game
44
45
45
46
*`statsapi.next_game()` - get the game id for the given team's next game
46
47
47
-
*`statsapi.game_highlights()` - generate a list of highlights with video links for a given game
48
+
*`statsapi.game_highlights()` - generate a formatted list of highlights with video links for a given game
48
49
49
-
*`statsapi.game_pace()` - get information about pace of game for a given season (back to 1999)
50
+
*`statsapi.game_pace()` - generate a formatted list of pace of game information for a given season (back to 1999)
50
51
51
-
*`statsapi.game_scoring_plays()` - get a list of scoring plays for a given game
52
+
*`statsapi.game_scoring_plays()` - generate a formatted list of scoring plays for a given game
52
53
53
54
## Example Use
54
55
@@ -133,7 +134,9 @@ use `statsapi.get()` to call the sports_players endpoint for the 2008 World Seri
133
134
lookup Chase Utley's person id from the results, and pass it into `statsapi.player_stats()`
134
135
using `type='hitting'` and `group='career'`
135
136
137
+
```
136
138
print( statsapi.player_stats(next(x['id'] for x in statsapi.get('sports_players',{'season':2008,'gameType':'W'})['people'] if x['fullName']=='Chase Utley'), 'hitting', 'career') )
139
+
```
137
140
138
141
### Print a list of scoring plays from the 4/28/2019 Marlins @ Phillies game
0 commit comments