Skip to Content

Serving Static Files

Serving your images through a managed Content Delivery Network (CDN) minimizes maintenance overhead and keeps your project footprint small. Below are two widely used CDNs for hosting static assets such as splash arts, profile icons, item icons, and spell icons.

DataDragon

Riot Games provides an extremely convenient CDN called DataDragon. You can access images stored in DataDragon using the URL format shown below:

https://ddragon.leagueoflegends.com/cdn/{VERSION}/img/profileicon/{ID}.png

This is the URL for accessing a profile icon. Notice that {VERSION} and {ID} are required parameters for this request

  • {VERSION} : The version of DataDragon that you would like to access. These usually correspond to patch versions. For example, DataDragon 15.14.1 would have the latest splash arts and champion icon for Yunara, who was released in patch 25.14. Generally, you should just use the latest DataDragon version listed in the versions.json file

  • {ID} : The integer ID of the asset you would like to access. In the case of the URL above, you would pass in the ID of a profile icon, such as 3866. You would probably be passing this ID in from the output of a seperate API request, but if you want a list of profile icon IDs, you can use https://ddragon.leagueoflegends.com/cdn/{VERSION}/data/en_US/profileicon.json. Notice this URL is predictably generated using the same {VERSION} parameter alongside the locality, en_US, and the asset category profileicon

With these considerations, we can construct a URL to serve a profile icon:

https://ddragon.leagueoflegends.com/cdn/15.14.1/img/profileicon/3866.png

For more information about DataDragon, you can read their docs. An easy way to find more assets that are available through DataDragon (such as splash arts or item icons) is to download the archive. Any file in this archive is also availble through the URL structure by appending its path to the base URL https://ddragon.leagueoflegends.com/cdn/.

Community Dragon

Community Dragon is a community maintained alternative to DataDragon. The advantage of this service is that it supports a “latest” path. Using this path, you don’t have to change/update the version parameter every patch. Using the profile icon example above, the Community Dragon URL would be:

https://raw.communitydragon.org/latest/plugins/rcp-be-lol-game-data/global/default/v1/profile-icons/3866.jpg

You can find other accessible paths for Community Dragon by simply going to their base URL:

https://raw.communitydragon.org/latest/plugins/rcp-be-lol-game-data/global/default/v1/

Last updated on