Site
Home / Forum / Developers / can't fetch data when calls api

can't fetch data when calls api


Posted: 26 Aug 2020 15:38
GOAviator
Posts: 50
Joined: 2020-08-24

Hi, i am building my own app that should list all teams of a league. For NBA I got this API endpoint: https://www.thesportsdb.com/api/v1/json/1/lookup_all_teams.php?id=4387

I am using swift language, and the problem is that if I browse the endpoint URL I can see the results listed in the browser, but when I call the url from my app I get an error, as if the url doesn't reply. I tried with all sports, all urls, and always same problem. Anyone else experienced the same?
Thanks in advance

zag
Posted: 26 Aug 2020 18:50

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

Hi, i am building my own app that should list all teams of a league. For NBA I got this API endpoint: https://www.thesportsdb.com/api/v1/json/1/lookup_all_teams.php?id=4387

I am using swift language, and the problem is that if I browse the endpoint URL I can see the results listed in the browser, but when I call the url from my app I get an error, as if the url doesn't reply. I tried with all sports, all urls, and always same problem. Anyone else experienced the same?
Thanks in advance


I looked at the source JSON and its valid so should work. You are doing the right thing by testing in the browser first so I don't think its an issue with our data.

I'm not sure the answer to your question, but make sure you are reading the JSON correctly. In PHP you use the JSON_Decode function but i'm not sure about other languages.


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