Site
Home / Forum / Developers / livescores and eventsnextleague API observations

livescores and eventsnextleague API observations


Posted: 08 Apr 2023 15:14
smathers
Posts: 30
Joined: 2023-04-07

Hi,
having just joined, I was experimenting for the first time with the livescores and eventsnextleague endpoints in order to figure out the logic I need for displaying a live score/results page in my Scottish Football League Info android app. Periodically refreshing calls to either endpoint via my browser occasionally returned:
{"events":null}

Is this the expected behaviour if the server is perhaps busy? I have no problem with this if it is, as I can cater for this assuming it is the only non-standard response!

I confirmed the Celtic vs Rangers livescore operation was as expected, with strStatus transitioning from "1H" to "HT" to "2H" during the match. After the match finished however, and now some 2 hours later, the match strStatus is still showing "2H" via the eventsnextleague endpoint. Should this not have moved on to "FT"?




Posted: 08 Apr 2023 18:17
Moonbags
Posts: 23
Joined: 2021-02-11

I think this is a new issue with with eventsnextleague.

My app has fetched from this endpoint for a long time without issue until yesterday when it was unexpectedly receiving {"events":null}

Posted: 08 Apr 2023 18:20
Moonbags
Posts: 23
Joined: 2021-02-11

Just to add, lookupteam is also affected. Might be a wider issue?

Posted: 10 Apr 2023 10:37

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

strStatus can be effected by all kinds of things, so I'm not really sure.

Generally I just rely on the start time + 120mins to check any event livescores.

The livescore API will also remove any "non live" events, so that can be useful.

Posted: 10 Apr 2023 11:47
smathers
Posts: 30
Joined: 2023-04-07

The only problem with using livescores at present is the occasional occurrence of {"events":null} which can happen while a match is in progress - and would thus result in a match being deemed finished before it actually is. Do you have any update on this issue?


Posted: 10 Apr 2023 20:57
smathers
Posts: 30
Joined: 2023-04-07

I believe I now understand the behaviour of the unexpected {"events":null}. I experimented with the livescore endpoint for tonight's English League Championship evening kick-off between Burnley and Sheffield United. Retrying the following from the browser every 2 secs:-

https://www.thesportsdb.com/api/v2/json//livescore.php?l=4329

revealed that the {"events":null} only ever happened when the livescore content was being updated - this typically being the "idLiveScore" & "updated" fields.

On Saturday, while the afternoon matches were in progress, I found that refreshing the following Scottish Premiership eventsnextleague endpoint request from the browser also gave the occasional {"events":null}, but noted that on one occasion a goal update for the Aberdeen match had been made after sending the request again:-

https://www.thesportsdb.com/api/v1/json//eventsnextleague.php?id=4330

Tonight, with no Scottish Premiership matches in progress, I have been unable to repeat Saturday's {"events":null} with the above API request.

So in summary, when an {"events":null} reponse is received, which of course is the expected and valid response from the livescores endpoint when no matches are in progress, the request should be reissued (after say 2 secs) to determine if it was a valid response, or due to a data update having taken place during the previous request.



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