jasonroman / nba-api

PHP Library to access NBA API endpoints
MIT License
95 stars 14 forks source link

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

Open rudymiked opened 1 year ago

rudymiked commented 1 year ago

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!

carsonsaldanha commented 1 year ago

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 commented 1 year ago

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

rudymiked commented 1 year ago

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: @.***>

carsonsaldanha commented 1 year ago

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: @.***>

rudymiked commented 1 year ago

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: @.***>

carsonsaldanha commented 1 year ago

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?

rudymiked commented 1 year ago

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 commented 1 year ago

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

there are a number of repos attempting the same thing.

rudymiked commented 1 year ago

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: @.***>

carsonsaldanha commented 1 year ago

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

image

rudymiked commented 1 year ago

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: @.***>

carsonsaldanha commented 1 year ago

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

rudymiked commented 1 year ago

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: @.***>