LiveScore

GRATIS CON POSSIBILITร€ DI UPGRADE
Verified
โœ“
Da Api Dojo | Aggiornamento ืœืคื ื™ 23 ื™ืžื™ื | Sports
Popolaritร 

9.9 / 10

Latenza

2,183ms

Livello di servizio

100%

Health Check

N/A

Torna a tutte le discussioni

Hockey Team Image/Logo

Rapid account: Wakpedwakyeng
wakpedwakyeng
ืœืคื ื™ 5 ื—ื•ื“ืฉื™ื

Hi there. Currently i try with your API, btw itโ€™s awesome.

But, i have a problem when showing hockey category that one of your endpoint in:
https://livescore6.p.rapidapi.com/teams/detail?ID=xxxx

Show like this: โ€œImgโ€: โ€œenet/261.pngโ€,

Thatโ€™s not a correct url right? How can i show that? Because i already ready your doc and canโ€™t find the solution. I already see the previous discussion that bring me like this: https://static.livescore.com/i2/fh/{Ccd}.jpg.

I already try like: https://static.livescore.com/i2/fh/enet/261.png
or
https://static.livescore.com/enet/261.png

but itโ€™s still not working.

Thanks.

Rapid account: Alberthamoui
alberthamoui Commented ืœืคื ื™ 5 ื—ื•ื“ืฉื™ื

To wakpedwakyeng.

I was able to make it work, hereยดs my function,

def get_team_image_url(data, team_index):
base_url = 'https://lsm-static-prod.livescore.com/mediumโ€™
relative_url = data[โ€˜LeagueTableโ€™][โ€˜Lโ€™][0][โ€˜Tablesโ€™][0][โ€˜teamโ€™][team_index][โ€˜Imgโ€™]
absolute_url = f"{base_url}/{relative_url}"

img = requests.get(absolute_url)
if img.status_code == 200:
    print("Image downloaded successfully.")
elif img.status_code == 404:
    print("Image not found. Check the URL.")
else:
    print(f"Failed to download image. Status code: {img.status_code}")
return absolute_url

print(get_team_image_url(data, 0))

โ€œ0โ€ in this case is for manchester city

Rapid account: Alberthamoui
alberthamoui Commented ืœืคื ื™ 5 ื—ื•ื“ืฉื™ื

To apidojo,

I read your comment to use 'https://static.livescore.com/i2/fh/{url}.jpgโ€™
but its not working for the team images, only for the country, for example โ€œenglandโ€

Rapid account: Alberthamoui
alberthamoui Commented ืœืคื ื™ 5 ื—ื•ื“ืฉื™ื

I`m having the same problem trying to get the url or path for the soccer teams images

this is what I`m getting: enet/8456.png

Rapid account: Apidojo
apidojo Commented ืœืคื ื™ 5 ื—ื•ื“ืฉื™ื

You should read that discussion again with CARE.

Regards.

Partecipa alla discussione - aggiungi un commento di seguito:

Accedi/Iscriviti per pubblicare nuovi commenti