Site
Home / Forum / Developers / v2 livescore requests inaccurate?

v2 livescore requests inaccurate?


Posted: 27 Sep 2024 23:54
jjordan373


Posts: 3
Joined: 2024

Hello,

I have been testing querying the v2 livescore endpoints since becoming a patreon contributer and I noticed some weird behavior. This is specifically with NHL. There are several games in progress right now that do not report any proper live data from the /api/v2/json/livescore/{league} endpoint. For example, the game below is currently 6-1 in favor of the Carolina Hurricanes over the Florida Panthers. However the score in the json response is "None", the status and progress are empty, and additionally the away and home teams are listed as the opposite (Carolina is home):

{'idLiveScore': '211630923', 'idEvent': '2155399', 'strSport': 'Ice Hockey', 'idLeague': '4380', 'strLeague': 'NHL', 'idHomeTeam': '134833', 'idAwayTeam': '134838', 'strHomeTeam': 'Florida Panthers', 'strAwayTeam': 'Carolina Hurricanes', 'strHomeTeamBadge': 'https://www.thesportsdb.com/images/media/team/badge/8qtaz11547158220.png', 'strAwayTeamBadge': 'https://www.thesportsdb.com/images/media/team/badge/v07m3x1547232585.png', 'intHomeScore': None, 'intAwayScore': None, 'intEventScore': None, 'intEventScoreTotal': None, 'strStatus': '', 'strProgress': 'NS', 'strEventTime': '22:00', 'dateEvent': '2024-09-28', 'updated': '2024-09-28 00:39:22'},

There are additional games such as New York Islanders vs. New Jersey Devils that are omitted from the response entirely (it is currently in progress). Oddly enough on thesportsdb website these games are listed under "Results" on the NHL league tab and are also incorrect in their score totals - however they seem to be updating now and then, but way behind live play. Carolina-Florida is listed at 3-0 there now when the live game is 6-1.

How much of this is intended behavior and how much might be faulty here?

Posted: 29 Sep 2024 15:46

zag


Posts: 3,511
Joined: 2020

Hello,

I have been testing querying the v2 livescore endpoints since becoming a patreon contributer and I noticed some weird behavior. This is specifically with NHL. There are several games in progress right now that do not report any proper live data from the /api/v2/json/livescore/{league} endpoint. For example, the game below is currently 6-1 in favor of the Carolina Hurricanes over the Florida Panthers. However the score in the json response is "None", the status and progress are empty, and additionally the away and home teams are listed as the opposite (Carolina is home):

{'idLiveScore': '211630923', 'idEvent': '2155399', 'strSport': 'Ice Hockey', 'idLeague': '4380', 'strLeague': 'NHL', 'idHomeTeam': '134833', 'idAwayTeam': '134838', 'strHomeTeam': 'Florida Panthers', 'strAwayTeam': 'Carolina Hurricanes', 'strHomeTeamBadge': 'https://www.thesportsdb.com/images/media/team/badge/8qtaz11547158220.png', 'strAwayTeamBadge': 'https://www.thesportsdb.com/images/media/team/badge/v07m3x1547232585.png', 'intHomeScore': None, 'intAwayScore': None, 'intEventScore': None, 'intEventScoreTotal': None, 'strStatus': '', 'strProgress': 'NS', 'strEventTime': '22:00', 'dateEvent': '2024-09-28', 'updated': '2024-09-28 00:39:22'},

There are additional games such as New York Islanders vs. New Jersey Devils that are omitted from the response entirely (it is currently in progress). Oddly enough on thesportsdb website these games are listed under "Results" on the NHL league tab and are also incorrect in their score totals - however they seem to be updating now and then, but way behind live play. Carolina-Florida is listed at 3-0 there now when the live game is 6-1.

How much of this is intended behavior and how much might be faulty here?


Livescore should be accurate to 2mins.

The main site is only updated about every 30mins for NHL.

Posted: 03 Oct 2024 00:21
jjordan373


Posts: 3
Joined: 2024

Hello,

I have been testing querying the v2 livescore endpoints since becoming a patreon contributer and I noticed some weird behavior. This is specifically with NHL. There are several games in progress right now that do not report any proper live data from the /api/v2/json/livescore/{league} endpoint. For example, the game below is currently 6-1 in favor of the Carolina Hurricanes over the Florida Panthers. However the score in the json response is "None", the status and progress are empty, and additionally the away and home teams are listed as the opposite (Carolina is home):

{'idLiveScore': '211630923', 'idEvent': '2155399', 'strSport': 'Ice Hockey', 'idLeague': '4380', 'strLeague': 'NHL', 'idHomeTeam': '134833', 'idAwayTeam': '134838', 'strHomeTeam': 'Florida Panthers', 'strAwayTeam': 'Carolina Hurricanes', 'strHomeTeamBadge': 'https://www.thesportsdb.com/images/media/team/badge/8qtaz11547158220.png', 'strAwayTeamBadge': 'https://www.thesportsdb.com/images/media/team/badge/v07m3x1547232585.png', 'intHomeScore': None, 'intAwayScore': None, 'intEventScore': None, 'intEventScoreTotal': None, 'strStatus': '', 'strProgress': 'NS', 'strEventTime': '22:00', 'dateEvent': '2024-09-28', 'updated': '2024-09-28 00:39:22'},

There are additional games such as New York Islanders vs. New Jersey Devils that are omitted from the response entirely (it is currently in progress). Oddly enough on thesportsdb website these games are listed under "Results" on the NHL league tab and are also incorrect in their score totals - however they seem to be updating now and then, but way behind live play. Carolina-Florida is listed at 3-0 there now when the live game is 6-1.

How much of this is intended behavior and how much might be faulty here?

Livescore should be accurate to 2mins.

The main site is only updated about every 30mins for NHL.


Okay noted, but I do think there are issues with the NHL livescore endpoint specifically. For the first few minutes of the live games, the livescore data is returned to me. However, they seem to disappear shortly after. They do not appear in the data returned by https://www.thesportsdb.com/api/v2/json/schedule/next/league/{id} either.

I am testing it right now while 2 games are in progress (each started just over an hour ago), and neither are returned to me with the livescore data. It only returns upcoming games for the next few days, for example:

{'idLiveScore': '212573654', 'idEvent': '2082945', 'strSport': 'Ice Hockey', 'idLeague': '4380', 'strLeague': 'NHL', 'idHomeTeam': '134846', 'idAwayTeam': '148494', 'strHomeTeam': 'Anaheim Ducks', 'strAwayTeam': 'Utah Hockey Club', 'strHomeTeamBadge': 'https://www.thesportsdb.com/images/media/team/badge/1d465t1719573796.png', 'strAwayTeamBadge': 'https://www.thesportsdb.com/images/media/team/badge/zxfycs1718706518.png', 'intHomeScore': None, 'intAwayScore': None, 'intEventScore': None, 'intEventScoreTotal': None, 'strStatus': '', 'strProgress': 'NS', 'strEventTime': '02:00', 'dateEvent': '2024-10-03', 'updated': '2024-10-03 01:17:21'}
{'idLiveScore': '212573655', 'idEvent': '2155406', 'strSport': 'Ice Hockey', 'idLeague': '4380', 'strLeague': 'NHL', 'idHomeTeam': '140082', 'idAwayTeam': '134849', 'strHomeTeam': 'Seattle Kraken', 'strAwayTeam': 'Edmonton Oilers', 'strHomeTeamBadge': 'https://www.thesportsdb.com/images/media/team/badge/zsx49m1595775836.png', 'strAwayTeamBadge': 'https://www.thesportsdb.com/images/media/team/badge/uxxsyw1421618428.png', 'intHomeScore': None, 'intAwayScore': None, 'intEventScore': None, 'intEventScoreTotal': None, 'strStatus': '', 'strProgress': 'NS', 'strEventTime': '02:00', 'dateEvent': '2024-10-03', 'updated': '2024-10-03 01:17:21'}

Any ideas? Thank you.


Posted: 03 Oct 2024 01:58
jjordan373


Posts: 3
Joined: 2024

I think I have identified what the issue may be, once GMT rolls over to midnight (and thus the next day of the week), any games that started the "day before" are no longer returned in the livescore data. So, the games that started at 7PM EST (11PM GMT) were initially part of the dataset but after 8PM EST (12AM GMT) they were not.

zag
Posted: 03 Oct 2024 17:50

zag


Posts: 3,511
Joined: 2020

I think I have identified what the issue may be, once GMT rolls over to midnight (and thus the next day of the week), any games that started the "day before" are no longer returned in the livescore data. So, the games that started at 7PM EST (11PM GMT) were initially part of the dataset but after 8PM EST (12AM GMT) they were not.

Yes that sounds logical, we keep the NFL scores for 24hrs for exactly this reason. Maybe I need to do the same with NHL....

To add to the complications, it should work fine when daylight savings happens as then the events don't go over UTC midnight.




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 5 (Total: 5)