Site
Home / Forum / Developers / Get current seasons fixtures

Get current seasons fixtures


Posted: 06 Nov 2019 16:11

garythekid
Posts: 4
Joined: Nov 2019

Hey guys, I'm glad I stumbled upon this API as i've been trying to find something for rugby for a looooong time!

However, I'm having a little trouble understanding the documentation and identifying the correct API calls... Just to go through it, if I wanted to get the fixtures for the current season my workflow would be:


1. List all leagues in a country: using the sport string as a parameter but removing the country parameter from the url. (A little odd!). Gives you an array of tournaments from the sport including the league ID.

2. List all Seasons in a League: Using the ID, list all seasons in the tournament.. On a side note: How does one identify which season is the current/upcoming season? The last one in the array?

3. All events in specific league by season: Using the ID and the (correct?) strSeason you can then use this endpoint to get all of the fixtures from the season.

Is this the most effective way of receiving this data? Anything I may be missing?
Thanks for reading,
garythekid.

Posted: 06 Nov 2019 18:05

zag
Posts: 1,558
Joined: Oct 2016

Hey glad you like it, one of our aims is to create an API for all sports and Rugby is certainly up there.

Try this:

https://www.thesportsdb.com/api/v1/json/1/eventsseason.php?id=4574&s=2019


EDIT: You are correct in that the latest season is the current one. It will be either "1920" or "2019" depending on if the league spans 1 or 2 years.

Posted: 06 Nov 2019 18:10

zag
Posts: 1,558
Joined: Oct 2016

Just to also mention that some of the other leagues are lacking data at the moment, but just due to lack of interest really.

I can always import the schedules of any leagues you want, just let me know.

Posted: 06 Nov 2019 20:10

garythekid
Posts: 4
Joined: Nov 2019

Hey, thanks for the reply!

If possible can you put up the fixtures for the upcoming Super Rugby season?
If all works out, and I can hook up the application correctly I'll sign up for the Patreon and request a few more competitions

Cheers.

Posted: 06 Nov 2019 20:41

zag
Posts: 1,558
Joined: Oct 2016

Hey, thanks for the reply!

If possible can you put up the fixtures for the upcoming Super Rugby season?
If all works out, and I can hook up the application correctly I'll sign up for the Patreon and request a few more competitions

Cheers.


Hey funny you should ask, I've been importing Rugby data today and it was the only league missing data

Its now all populated with 10 years of archived results and the new 2020 season!

https://www.thesportsdb.com/league/4551

Don't forget anyone can edit data on the site so it might be a good idea to get familiar with the edit functions. I think a few teams need moving around in that league. Just edit the team to choose a new league.

Posted: 06 Nov 2019 20:56

garythekid
Posts: 4
Joined: Nov 2019

Left til last.. so disappointing...
Aha great, good timing then!

I spotted a couple of other threads talking about time zones, however there didn't really seem to be a consensus.
Will there be any chance of an ISO 8601 time/date format or the Date's toJson format as per https://stackoverflow.com/a/15952652?
Although perhaps I should stick this question in another thread..?

Posted: 06 Nov 2019 23:20

zag
Posts: 1,558
Joined: Oct 2016

?
Although perhaps I should stick this question in another thread..?


Yeh we are still working out the timezone thing. At the moment all dates should be in UTC as well as times.

The additional local time and date works (most of the time especially in Europe) but for leagues like this that are all over the place geographically then its probably not going to be reliable. Anyone can edit an individual event though if they know the local times. I don't mind batch importing data but the users of the site are still needed for things like this.

If you add strDate + strTime together you can probably re-create the ISO 8601 format.

Posted: 08 Nov 2019 14:16

garythekid
Posts: 4
Joined: Nov 2019

Ok fair enough!
Well thanks for importing, I'll be checking through all the times so I'll figure out how to update them as need be.


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