Hi, I was having the same problem you're now solving. However, just a different version.
I was trying to get the icon for a cryptocurrency using just its symbol. And here's how I finally went about it.
Images for cryptocurrencies are organized on CoinCap as such https://assets.coincap.io/assets/icons/{symbol}@2x.png
For example https://assets.coincap.io/assets/icons/eth@2x.png