Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C# - How do I get the URL of an icon from Steam Trading API (encoded)

Here is the part of the XML that the API returns for every item:

<message>
    <appid>730</appid>
    <classid>469467368</classid>
    <instanceid>302028390</instanceid>
    <currency>false</currency>
    <background_color/>
    <icon_url>
    -9a81dlWLwJ2UUGcVs_nsVtzdOEdtWwKGZZLQHTxDZ7I56KU0Zwwo4NUX4oFJZEHLbXH5ApeO4YmlhxYQknCRvCo04DEVlxkKgpou6ryFA957PfMYTxW09SzlZaS2aX3MOvSlzlQucdy2LqU9NmnjAzl_UJoYmqldYSTIQI_NV_X81bvkufxxcjryPo2vmI
    </icon_url>
</message>

How do I parse and convert this string to an URL?

Thanks!

like image 845
Reynevan Avatar asked Dec 30 '25 21:12

Reynevan


1 Answers

I've never used this Api. I searched on google and i came on this answer: Steam Web API: I'm not sure what to do with this hash looking url to generate an image with it. It seems you just need to prepend the http://cdn.steamcommunity.com/economy/image/ before the url string.

The image link in your case should be: http://cdn.steamcommunity.com/economy/image/-9a81dlWLwJ2UUGcVs_nsVtzdOEdtWwKGZZLQHTxDZ7I56KU0Zwwo4NUX4oFJZEHLbXH5ApeO4YmlhxYQknCRvCo04DEVlxkKgpou6ryFA957PfMYTxW09SzlZaS2aX3MOvSlzlQucdy2LqU9NmnjAzl_UJoYmqldYSTIQI_NV_X81bvkufxxcjryPo2vmI

like image 161
Stefano Castriotta Avatar answered Jan 02 '26 10:01

Stefano Castriotta



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!