Site
Home / Forum / Developers / API JSON attribute

API JSON attribute


Posted: 02 Oct 2018 12:22

ierws
Posts: 2
Joined: Oct 2018

Hello there,

how easy and quick would it be to add one more attribute on the league list, that has the value of the country.
For example, with PHP, i have these attributes:

[idLeague] => 4328
[strLeague] => English Premier League
[strSport] => Soccer
[strLeagueAlternate] => Premier League
[strCountry] => 1 or England


Best regards

Posted: 03 Oct 2018 16:56

zag
Posts: 1,558
Joined: Oct 2016

As far as I know, looking up leagues by ID should return the country. We certainly store it in the DB.

What exact method are you using?

Posted: 04 Oct 2018 09:08

ierws
Posts: 2
Joined: Oct 2018

Just some PHP with file_get_contents and i am using the function

all_leagues


Posted: 04 Oct 2018 20:10

zag
Posts: 1,558
Joined: Oct 2016

Ahh OK, well that APi method is meant to be used to find the names and ID's only really.

You will need to do a 2nd lookup on each one to find the country and other info:

Example
https://www.thesportsdb.com/api/v1/json ... hp?id=4346

Posted: 22 Jan 2019 19:58

mitico
Posts: 4
Joined: Jan 2019

What about returning team short name in event's calls? It would be possible?

Thanks in advance!

Posted: 25 Jan 2019 19:00

pololalo
Posts: 21
Joined: Nov 2018

Hi,
I noticed that there is a slight difference between the attributes in the response on TvEvent By Date and TvEvent by IdEvent,
there is an TvEvent by IdEvent:


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)