Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NBA player game logs no longer returned as desired #33

Open
pssguy opened this issue Jun 23, 2016 · 10 comments
Open

NBA player game logs no longer returned as desired #33

pssguy opened this issue Jun 23, 2016 · 10 comments

Comments

@pssguy
Copy link

pssguy commented Jun 23, 2016

This code has been working smoothly, providing 2015/6 regular season data

ss_get_result(token=,sport="basketball", league="nba", ep="game_logs", query=list(player_id="nba-stephen-curry"), version=1, verbose=TRUE, walk=TRUE)

but now returns

    [1] "Making initial API request"
    [[1]]
    [[1]]$game_logs
    list()

If I try something like

ss_get_result(token, sport = "basketball", league = "nba", ep = "game_logs",
          query = list(season_id="nba-2015-2016",player_id="nba-stephen-curry"), version = 1, walk = FALSE, page = NA,
          verbose = TRUE)

I just get the 7 championship games. I have tried entering a since value into the query list but that does not help either

Is it possible to access a players results for specified period - or indeed whole career gamelogs

I am using version 0.0.5

@Btibert3
Copy link
Contributor

The defaults change as new seasons and intervals come into play. You are getting the 7 championship games because that is the current interval, which you can read more about here. If you want regular season, try adding interval_type='regularseason' to the list. For example, to get his regular season game logs

x <- ss_get_result(token, 
                   sport = "basketball", 
                   league = "nba", 
                   ep = "game_logs",
                   query = list(season_id="nba-2015-2016",
                                player_id="nba-stephen-curry",
                                interval_type = 'regularseason'), 
                   version = 1, 
                   walk = TRUE, 
                   page = NA,
                   verbose = TRUE)

In your example above, you set the walk flag to FALSE. I often do this when I am testing queries, but if you wanted to get all of the data that will come across multiple pages, be sure to set it to TRUE

@pssguy
Copy link
Author

pssguy commented Jun 23, 2016

@Btibert3 Thanks very muchfor code and link.

Just to clarify, the since parameter is only effective within a season_id and there is no way of obtaining all a player game_logs at one fell swoop and then filtering them subsequently by season and/or interval_type?

@Btibert3
Copy link
Contributor

To the best of my knowledge, not at the moment, but in the short run it's
easy enough to loop through the intervals to grab what you need.

On Thu, Jun 23, 2016 at 3:35 PM, Andrew Clark notifications@github.com
wrote:

@Btibert3 https://github.com/Btibert3 Thanks very muchfor code and
link.

Just to clarify, the since parameter is only effective within a season_id
and there is no way of obtaining all a player game_logs at one fell swoop
and then filtering them subsequently by season and/or interval_type?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#33 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AAMaT4PNWLupwo5tZ8msygAQZwLR3-wpks5qOt_kgaJpZM4I9FV6
.

@pssguy
Copy link
Author

pssguy commented Jun 23, 2016

Sure no technical problem but for an interactive web experience one wants the quickest return of data possible

@dthyresson
Copy link
Contributor

Hi @Btibert3 and @pssguy - have reset the default interval for NBA to the regularseason.

Thanks for the reminder!

@dthyresson
Copy link
Contributor

@pssguy I think an enhancement of maybe and interval_type=all might be handy -- but, would also want: preseason, all-star/probowl, games as well? I guess so.

I'll add this as an enhancement to the API filter.

@pssguy
Copy link
Author

pssguy commented Jun 23, 2016

@dthyresson Thanks very much. As long as I can get data.frame with an interval_type column then can process as required

@sangamc
Copy link

sangamc commented Oct 6, 2016

I am unable to get preseason stats using the same method described above. Are they available?

@dthyresson
Copy link
Contributor

Hi, @sangamc.

We're in the process of migrating to a new dataset for both NBA and NHL so right now we don't have the preseason stats for those sports.

Plan is to do NHL first (as their season begins before NBA) and in time for regular season start.

We'll backfill all preseason stats.

Will update here when NBA is up and running for 2016-7 (could be next weekend).

@sangamc
Copy link

sangamc commented Oct 7, 2016

Thanks for the update! I've been testing my scripts with past data and 2015-16 season is more than enough for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants