nba-api icon indicating copy to clipboard operation
nba-api copied to clipboard

Last publish date for standings is 2022-10-12, what is the update frequency?

Open rudymiked opened this issue 2 years ago • 13 comments

What is the update frequency of the standings data?

https://data.nba.net/prod/v1/current/standings_all.json

The last update was on October 12th. I understand that this isn't your data... but do you have any idea how often this is updated or if this source is stale?

Thanks!

rudymiked avatar Oct 21 '22 20:10 rudymiked

It seems that the data.nba.net API got shut down. I found this alternative API: https://cdn.nba.com/static/json/liveData/scoreboard/todaysScoreboard_00.json https://cdn.nba.com/static/json/liveData/boxscore/boxscore_{gameID}.json

However, I haven't found an endpoint for current standings yet.

carsonsaldanha avatar Nov 01 '22 02:11 carsonsaldanha

What API did you switch to on your repo btw? @rudymiked

carsonsaldanha avatar Nov 01 '22 02:11 carsonsaldanha

I switched to the api nba.com uses, stats.nba.com.

It works! (locally) but I am having issues after deploying to azure, the connection times out. I had to add some more headers to the http request, which solved the timeout issue locally, but it still persists after deployment.

Example api: https://stats.nba.com/ http://stats.nba.com/stats/leaguestandingsv3

-Mike

On Mon, Oct 31, 2022 at 7:10 PM carsonsaldanha @.***> wrote:

What API did you switch to on your repo btw? @rudymiked https://github.com/rudymiked

— Reply to this email directly, view it on GitHub https://github.com/jasonroman/nba-api/issues/18#issuecomment-1297922777, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABTDRHBAROYYTKHKTCOB26DWGB3XVANCNFSM6AAAAAARLPMO5M . You are receiving this because you were mentioned.Message ID: @.***>

rudymiked avatar Nov 01 '22 03:11 rudymiked

I'm a bit confused as to how to format the request you sent. Could you show me an example in something like Postman?

On Mon, Oct 31, 2022, 10:47 PM rudymiked @.***> wrote:

I switched to the api nba.com uses, stats.nba.com.

It works! (locally) but I am having issues after deploying to azure, the connection times out. I had to add some more headers to the http request, which solved the timeout issue locally, but it still persists after deployment.

Example api: https://stats.nba.com/ http://stats.nba.com/stats/leaguestandingsv3

-Mike

On Mon, Oct 31, 2022 at 7:10 PM carsonsaldanha @.***> wrote:

What API did you switch to on your repo btw? @rudymiked https://github.com/rudymiked

— Reply to this email directly, view it on GitHub <https://github.com/jasonroman/nba-api/issues/18#issuecomment-1297922777 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/ABTDRHBAROYYTKHKTCOB26DWGB3XVANCNFSM6AAAAAARLPMO5M

. You are receiving this because you were mentioned.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/jasonroman/nba-api/issues/18#issuecomment-1297986076, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQNDK7ETH4LHASDJAZAH5V3WGCHFPANCNFSM6AAAAAARLPMO5M . You are receiving this because you commented.Message ID: @.***>

carsonsaldanha avatar Nov 01 '22 03:11 carsonsaldanha

Here’s a snippet of my code:

https://github.com/rudymiked/nbaunderdogleagueAPI/blob/main/nbaunderdogleagueAPI/DataAccess/TeamDataAccess.cs

-Mike

On Mon, Oct 31, 2022 at 8:53 PM carsonsaldanha @.***> wrote:

I'm a bit confused as to how to format the request you sent. Could you show me an example in something like Postman?

On Mon, Oct 31, 2022, 10:47 PM rudymiked @.***> wrote:

I switched to the api nba.com uses, stats.nba.com.

It works! (locally) but I am having issues after deploying to azure, the connection times out. I had to add some more headers to the http request, which solved the timeout issue locally, but it still persists after deployment.

Example api: https://stats.nba.com/ http://stats.nba.com/stats/leaguestandingsv3

-Mike

On Mon, Oct 31, 2022 at 7:10 PM carsonsaldanha @.***> wrote:

What API did you switch to on your repo btw? @rudymiked https://github.com/rudymiked

— Reply to this email directly, view it on GitHub < https://github.com/jasonroman/nba-api/issues/18#issuecomment-1297922777 , or unsubscribe <

https://github.com/notifications/unsubscribe-auth/ABTDRHBAROYYTKHKTCOB26DWGB3XVANCNFSM6AAAAAARLPMO5M

. You are receiving this because you were mentioned.Message ID: @.***>

— Reply to this email directly, view it on GitHub <https://github.com/jasonroman/nba-api/issues/18#issuecomment-1297986076 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/AQNDK7ETH4LHASDJAZAH5V3WGCHFPANCNFSM6AAAAAARLPMO5M

. You are receiving this because you commented.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/jasonroman/nba-api/issues/18#issuecomment-1297989093, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABTDRHDALHI6QLZME2ANPQ3WGCH4PANCNFSM6AAAAAARLPMO5M . You are receiving this because you were mentioned.Message ID: @.***>

rudymiked avatar Nov 01 '22 04:11 rudymiked

It seems to be blocking requests that are not from the nba.com domain despite using the provided headers. How did you get around this?

carsonsaldanha avatar Nov 01 '22 22:11 carsonsaldanha

So unfortunately, I have not figured that out yet... I just wrote a hack for now. I wrote a method that pulls the data and updates a storage table, and I run that method locally daily. I query the table in my application.

Still working on a fix... I thought adding the headers would work, but it still doesn't accept the headers I have provided when running on Azure. Let me know if you figure this out! I'll do the same.

rudymiked avatar Nov 01 '22 22:11 rudymiked

https://github.com/allenmor/nbareport/blob/071b5cbe6531042e0b1c9d7c61aa5b5e1e2e69ae/src/components/StandingsContainer.js

there are a number of repos attempting the same thing.

rudymiked avatar Nov 01 '22 22:11 rudymiked

Hey,

So I actually fixed this!

I added ("X-Version", "1") to the request headers, and of course have the other headers i mentioned earlier as well:

[image: image.png]

Let me know if this works for you!

-Mike

On Tue, Nov 1, 2022 at 3:29 PM carsonsaldanha @.***> wrote:

It seems to be blocking requests that are not from the nba.com domain despite using the provided headers. How did you get around this?

— Reply to this email directly, view it on GitHub https://github.com/jasonroman/nba-api/issues/18#issuecomment-1299309411, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABTDRHF43N2PDABWHDUUU7DWGGKUFANCNFSM6AAAAAARLPMO5M . You are receiving this because you were mentioned.Message ID: @.***>

rudymiked avatar Nov 05 '22 19:11 rudymiked

Mine still times out when making a request like this. Not sure if I'm missing any additional fields.

image

carsonsaldanha avatar Nov 07 '22 07:11 carsonsaldanha

Can you add the Referrer key in postman?

-Mike

On Sun, Nov 6, 2022 at 11:52 PM carsonsaldanha @.***> wrote:

Mine still times out when making a request like this. Not sure if I'm missing any additional fields.

[image: image] https://user-images.githubusercontent.com/68826492/200254985-691240b5-1279-4698-8450-caf7f5aca864.png

— Reply to this email directly, view it on GitHub https://github.com/jasonroman/nba-api/issues/18#issuecomment-1305209765, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABTDRHCE42GOXDSBYJUAS4DWHCRLLANCNFSM6AAAAAARLPMO5M . You are receiving this because you were mentioned.Message ID: @.***>

rudymiked avatar Nov 07 '22 15:11 rudymiked

Same result. Are you able to make a request over JavaScript?

carsonsaldanha avatar Nov 08 '22 06:11 carsonsaldanha

I haven’t tried from the front end, I an wrapping the call in one of my backend APIs

On Mon, Nov 7, 2022 at 10:03 PM carsonsaldanha @.***> wrote:

Same result. Are you able to make a request over JavaScript?

— Reply to this email directly, view it on GitHub https://github.com/jasonroman/nba-api/issues/18#issuecomment-1306678949, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABTDRHBRDX5HH2UTPAZ33BLWHHULFANCNFSM6AAAAAARLPMO5M . You are receiving this because you were mentioned.Message ID: @.***>

rudymiked avatar Nov 08 '22 06:11 rudymiked