riot-games-api

Riot API How to get summoner profile icon image


I found out i can get Summoner Icon image using this url:

https://ddragon.leagueoflegends.com/cdn/11.14.1/img/profileicon/934.png

The basic form of this is:

https://ddragon.leagueoflegends.com/cdn/{version}/img/profileicon/{profileIconId}.png

i know i can get the second value of {profileIconId} through Riot API but how do i know when i should update the version value? I don't want my app to crash when the version should be changed.


Solution

  • If someone is using the data dragon (ddragon) cdn, you can know the latest version looking at this json that they provide:

    https://ddragon.leagueoflegends.com/api/versions.json

    Just take the first element of the array and you are good to go without any scripting.