Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a way to use symbol to get data about a coin? #68

Open
PetruIulian opened this issue Apr 17, 2022 · 1 comment
Open

Is there a way to use symbol to get data about a coin? #68

PetruIulian opened this issue Apr 17, 2022 · 1 comment

Comments

@PetruIulian
Copy link

Hi, I'm trying to use a symbol in order to get data about a coin, for e.g. BTC using cg.get_price(ids='bitcoin') will work, but is there a way to do something like cg.get_price(ids = 'BTC')?

@0xMimir
Copy link

0xMimir commented Aug 3, 2022

Yes there is, I will try to integrate it, we only need dict with every coins symbol as key and id as value then just return result of get_price, for example

{
    'BTC': 'bitcoin', 
    'ETH': 'ethereum',
    'XRP': 'ripple'
}

This is one way of doing, but it would need to updated every time new coin is added. Other is querying https://api.coingecko.com/api/v3/coins/list before and then finding item which matches symbol and take id from there and then get use that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants