LiveScore

부분 유료
Verified
분류별 Api Dojo | 업데이트됨 17 дней назад | Sports
인기

9.9 / 10

지연 시간

2,190ms

서비스 수준

100%

Health Check

N/A

모든 토론으로 돌아가기

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.

아래에 의견을 추가하고 토론에 참여하세요.

새 댓글을 게시하려면 로그인 / 가입