edalex
Posts: 11
Joined: Fri Mar 03, 2017 6:45 pm

API v1 Flaws

Sat Mar 11, 2017 12:47 pm

Hi.
Let's discuss what could be fixed/changed in current v1 API.
Empty fields in LiveScores items are not empty strings but empty json objects. Could it be fixed?
All lookups consist of list of items? Why not just one item?
Site has history for players. Is it available in API?
I missed list of sports and its thumbs in API so i have to use my local list in code:
{"Football","http://www.thesportsdb.com/images/sports/football.jpg"},
{"Basketball","http://www.thesportsdb.com/images/sports/basketball.jpg"},
{"Rugby","http://www.thesportsdb.com/images/sports/rugby.jpg"},
{"American Football","http://www.thesportsdb.com/images/sports/american_football.jpg"},
{"Motorsport","http://www.thesportsdb.com/images/sports/motorsport.jpg"},
{"Ice Hockey","http://www.thesportsdb.com/images/sports/ice_hockey.jpg"},
{"Fighting","http://www.thesportsdb.com/images/sports/fighting.jpg"},
{"Baseball","http://www.thesportsdb.com/images/sports/baseball.jpg"},
{"Golf","http://www.thesportsdb.com/images/sports/golf.jpg"},
{"Tennis","http://www.thesportsdb.com/images/sports/tennis.jpg"},
{"Cricket","http://www.thesportsdb.com/images/sports/cricket.jpg"},
{"Cycling","http://www.thesportsdb.com/images/sports/cycling.jpg"}
What about adding such construction in API? Yes, I saw list of leagues but I miss images anyway.
I wrote some thought on old forum and forgot them. :cry:
I hope to give some suggestions later.

User avatar
zag
Site Admin
Posts: 220
Joined: Tue Oct 11, 2016 9:43 am

Re: API v1 Flaws

Fri Mar 31, 2017 1:26 pm

Yep not forgotten about this, its on my list :)

edalex
Posts: 11
Joined: Fri Mar 03, 2017 6:45 pm

Re: API v1 Flaws

Sun Jan 07, 2018 7:23 pm

Some more words from me.
I don't know why API needs root objects since they useless in my opinion and they could mislead devs.
Look at this stat:

Code: Select all

search_all_leagues.php - "countrys" root element
all_leagues.php - "leagues" root element

Code: Select all

lookup_all_players.php - "player" root element
lookupplayer.php - "players" root element

Code: Select all

eventsnext.php, eventsnextleague.php, lookupevent.php, eventspastleague.php - "events" root element
eventslast.php - "results" root element
searchevents.php, searchfilename.php - "event" root element

Also I need Alternate leagues names in allleagues.php or even maybe search by league name including alternate names.
And it will be cool to search events by "Arsenal_vs_Chelsea" where Arsenal both home and away team and the same for Chelsea.

User avatar
zag
Site Admin
Posts: 220
Joined: Tue Oct 11, 2016 9:43 am

Re: API v1 Flaws

Wed Jan 10, 2018 3:00 pm

Must have forgotten this again :)

- I've added alternate league names to all_leagues.php
- New API method http://www.thesportsdb.com/api/v1/json/1/all_sports.php

I agree with the other stuff, but some are breaking changes so will have to wait for v2 of the api.

I will also look into the events home and away, that should be possible without breaking things.

edalex
Posts: 11
Joined: Fri Mar 03, 2017 6:45 pm

Re: API v1 Flaws

Wed Jan 10, 2018 8:31 pm


Awesome :)
zag wrote:- I've added alternate league names to all_leagues.php

Awesome :) I've already added alt name for English Premier League :roll:
I will dream about full-text search by all names (incl. main and alternates) in future but for now I'll think of making search on client side. :?
zag wrote:I will also look into the events home and away, that should be possible without breaking things.

Awesome, thanks :)
zag wrote:I agree with the other stuff, but some are breaking changes so will have to wait for v2 of the api.

Yeah, no problem. Those cosmetic changes will make my code for API implementation cleaner and it will remove some almost duplicate classes.

Return to “Developers”