Site
Home / Forum / Developers / Finding Featured leagues using API / Finding WWE

Finding Featured leagues using API / Finding WWE


Posted: 18 Mar 2021 03:56
willorkney
Posts: 13
Joined: 2021-03-18

Hi,

I've just found this project and it looks great. I'm building a little site using the API tutorial but have hit an issue finding WWE.

The sport category is Fighting, and WWE's location is listed as "Worldwide" on it's page on this site, but when I visit the following URL I don't see WWE in the JSON?

https://www.thesportsdb.com/api/v1/json/1/search_all_leagues.php?c=Worldwide&s=Fighting

Seems to work well for a lot of other sports Ive checked so not sure why this one is different.

Also, similiar to the Fighting page on this website is it possible to fetch the Featured Leagues through the API? Currently I'm setting the default on my page to just show 'Worldwide', then asking the user to select their country, but some sports are showing only defunct results, e.g.:

https://www.thesportsdb.com/api/v1/json/1/search_all_leagues.php?c=Worldwide&s=American%20Football

Many Thanks
Will

Posted: 18 Mar 2021 15:26
curswine
Posts: 868
Joined: 2020-06-17

Does this give you what you're looking for?

https://www.thesportsdb.com/api/v1/json/1/lookupleague.php?id=4444

zag
Posted: 18 Mar 2021 17:59
willorkney
Posts: 13
Joined: 2021-03-18

Thanks curswine, that will work. I'll work out the league id's for each wrestling company and build my page manually.

I have noticed that if I leave out the Worldwide parameter then the API returns a lot more wrestling leagues like NJPW, however WWE still isn't amongst them. I guess I'm wondering if something is configured differently in the backend for certain leagues which prevents them showing up?

Also, is it possible to get a list of all countries specific to a sport through the API? So instead of getting a list of all countries, I'd just want a list of countries where Ice Hockey is played for example.

Many thanks again.

Posted: 18 Mar 2021 19:15

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

If you are using the free API then the number of leagues returned for some sport types is restricted.

Definitely look up by League ID, you can rotate round each one very easily.




Posted: 19 Mar 2021 06:33
willorkney
Posts: 13
Joined: 2021-03-18

Thanks zag. I'm currently using the free API. If I sign up for the $5p/m subscription on Patreon will WWE be enabled in the Fighting/Worldwide JSON, saving me from manually calling each league?

Posted: 20 Mar 2021 21:39

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

Thanks zag. I'm currently using the free API. If I sign up for the $5p/m subscription on Patreon will WWE be enabled in the Fighting/Worldwide JSON, saving me from manually calling each league?

I'm not quite sure what you mean, but the upgraded API has no limits on most calls.

Generally it is good practice to call the separate leagues rather than the whole lot though.


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)