Site
Home / Forum / Developers / record for MLB is all off

record for MLB is all off


Posted: 12 Aug 2020 21:28
[email protected]
Posts: 19
Joined: 2020-07-01

https://www.thesportsdb.com/api/v1/json/1/lookuptable.php?l=4424&s=2020

Wins/losses are not correct. There aren't any draws.

Posted: 12 Aug 2020 21:39
[email protected]
Posts: 19
Joined: 2020-07-01

is the intended result of leaving off the season in the call to return the last season?

Looks like it may work that way for NBA, but not all other sports return data that way. The NBA records seem slightly off too though.


Posted: 13 Aug 2020 13:17

Ovokx
Posts: 1,700
Joined: 2020-06-17


Looks like it may work that way for NBA, but not all other sports return data that way. The NBA records seem slightly off too though.


NBA records are updated daily. What did you find in order to say that they are also slightly off, please?

TY!

Posted: 13 Aug 2020 15:32
[email protected]
Posts: 19
Joined: 2020-07-01

Using the following URL: https://www.thesportsdb.com/api/v1/json/1/lookuptable.php?l=4387

It returns:
{"table":[{"name":"Milwaukee Bucks","teamid":"134874","played":79,"goalsfor":9384,"goalsagainst":8542,"goalsdifference":842,"win":63,"draw":0,"loss":16,"total":189},{"name":"Los Angeles Lakers","teamid":"134867","played":79,"goalsfor":8936,"goalsagainst":8450,"goalsdifference":486,"win":58,"draw":0,"loss":21,"total":174},......

But going to the standings on the NBA website, it shows the record for:

Milwaukee Bucks to be 56-16, not 63-16
Los Angeles Lakers to be 52-18 not 58-21

Posted: 13 Aug 2020 15:52

Ovokx
Posts: 1,700
Joined: 2020-06-17

The issue here is that a NBA season currently contains pre-season games + regular season games + playoffs games.

@Zag, is it possible to create a "Club friendlies" league for basketball (similar as we have for soccer) in order to move there pre-season & friendly games in order to show proper season values?

Posted: 14 Aug 2020 19:48
[email protected]
Posts: 19
Joined: 2020-07-01

Is that the same issue for MLB?

Also, should using:

https://www.thesportsdb.com/api/v1/json/1/lookuptable.php?l=4424

return the latest team records? Because that does not return any data. Adding &s=2020 to the URL returns data (although it is wrong).

NBA does not need the season to return the latest standings

Posted: 14 Aug 2020 20:01

zag
Posts: 3,330
Joined: 2020-03-23

Actually the lookup table method is only supposed to be used for soccer at the moment, not other sports Looks like I forgot to lock it down on the API like I have on the website..... Glad it at least works though and identifies errors.

I will look at pre-season games, they shouldnt really be listed I think really in the main season list. Its causing confusion in various places.

Posted: 14 Aug 2020 20:07

zag
Posts: 3,330
Joined: 2020-03-23

I fixed the login on the test API key to ignore "Round 0" events.

EDIT: Oh no that wont work as all the MLB events are Round 0!! Hmm always baseball causing issues

I will need to look for another solution....

Posted: 14 Aug 2020 20:29
[email protected]
Posts: 19
Joined: 2020-07-01

OK, so if the lookup tables do not work for sports other than soccer, I'd have to into all events for a season and count up wins/losses. Is that correct? Is that the easiest way at this point?

Noting that it may still be off slightly until we can determine whether an event is finished or not (or postponed/cancelled)

Posted: 14 Aug 2020 20:46

zag
Posts: 3,330
Joined: 2020-03-23

MLB is a strange one as it has so many events, its hard to get it accurate by just a quick manual check after the disruption we've had. I've tried to fix results, but its hard with all the postponements and re-arranged fixtures. If anyone else wants to help out and take a look it would be helpful.

EDIT: Yes its missing a big block of results at the end of July as the importer was turned off until August.

https://www.thesportsdb.com/season.php?l=4424&s=2020

While the table API is based on soccer, it should still work for some other sports to give total wins and losses so it is still useful. You can of course also list events for a season and calculate the results yourself.


Who is Online?

In total there are 68 users online :: 3 registered, 0 hidden and 65 guests (based on users active over the past 5 minutes) Most users ever online was 424 on Fri Nov 10, 2017 9:02 pm

About Us

Discussion forum for TheSportsDB.com site and related topics

Rules

- Be Polite
- Respect other users
- Always post log files with issues
- Try to be helpful
- No Piracy discussion

Showing 0 to 10 (Total: 10)