swar / nba_api

An API Client package to access the APIs for NBA.com
MIT License
2.53k stars 541 forks source link

Custom filters on the NBA.COM API #445

Open omermazig opened 6 months ago

omermazig commented 6 months ago

As I understand it, NBA.COM API is limited to only return 250 rows on an API call. I want to get lineup data with more row then that, so the best idea I came up with is to use the custom filters to filter the minutes (the key that the rows are sorted by), and that way with multiple calls I would get the entire lineups info:

Untitled

When I do this from the browser, the url is:

https://www.nba.com/stats/lineups/traditional?CF=MIN*LE*24&GroupQuantity=5&PerMode=Totals&Season=2021-22&SeasonType=Regular%20Season&TeamID=1610612744&slug=traditional

And specifically my change reflects in the url like another parameter:

CF=MIN*LE*24

So I tried to manually manipulate the library code manually to preform this request:

image Untitled

But I still get the same 250 df rows that I got before I passed this parameter. Even if I pass some gibberish:

image

I still get the same results. It like the parameter is being ignored completely for some reason.

Does anyone has a good idea why this happens? I'm not very familiar with the requests library so I might be missing something obvious.

rsforbes commented 5 months ago

@omermazig - Will get this look at this weekend.

omermazig commented 5 months ago

@omermazig - Will get this look at this weekend.

@rsforbes - Hey. Did you get a chance to have a look at this?