man-c / pycoingecko

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

get_coins_list(include_platform=True) is not implemented? #58

Closed NightProwler-dc closed 2 years ago

NightProwler-dc commented 2 years ago

Hello, I can't seem to make CoinGeckoAPI().get_coins_list(include_platform=True) function to return platform information, like

{
    "id": "bifi",
    "symbol": "bifi",
    "name": "BiFi",
    "platforms": {
      "ethereum": "0x2791bfd60d232150bff86b39b7146c0eaaa2ba81",
      "fantom": "0xad260f380c9a30b1d60e4548a75010ede630b665"
    }
  }

Currently, platform info is missing. Is my code wrong?

NightProwler-dc commented 2 years ago

Found the problem. It needs to be include_platform='true'

man-c commented 2 years ago

Hello! Which version of the library are you using? From v2.0.0 booleans are supported for any endpoint parameter (https://github.com/man-c/pycoingecko/blob/master/CHANGELOG.md#200--2021-04-23).

For example:

>>> cg=pycoingecko.CoinGeckoAPI()
>>> L=cg.get_coins_list(include_platform=True)
>>> L[100]
{'id': '18983-alcoy', 'symbol': 'realtoken-s-18983-alcoy-ave-detroit-mi', 'name': 'RealT Token - 18983 Alcoy Ave, Detroit, MI 48205', 
'platforms': {'xdai': '0xad91999f534f4075b00ba4231c018e57bdebb342', 'ethereum': '0xad91999f534f4075b00ba4231c018e57bdebb342'}}
>>> L=cg.get_coins_list()
>>> L[100]
{'id': '18983-alcoy', 'symbol': 'realtoken-s-18983-alcoy-ave-detroit-mi', 'name': 'RealT Token - 18983 Alcoy Ave, Detroit, MI 48205'}