man-c / pycoingecko

Python wrapper for the CoinGecko API
MIT License
1.04k stars 268 forks source link

Standardization behind id #19

Closed ECBSJ closed 3 years ago

ECBSJ commented 3 years ago

Is there anyway to just use the 3 letter/4 letter ticker for when searching for an asset instead of having to type out the whole name? And if the name consists of two words, i.e. wrapped-bitcoin or yearn-finance, is it always mandatory to put a hyphen "-" in between the two words?

mfiro commented 3 years ago

I guess there is no way and you have to write a function for yourself. You can get the complete list of coins using: cg.get_coins_list() . And then use string.startswith() method or regex techniques to find your desired ticker.

man-c commented 3 years ago

The id of the coins (whole name) and the format (e.g. hyphen "-" between words) are defined this way by CoinGecko. For alternatives, you need to work on your own custom solutions, as @mfiro suggested.