Skip to content

Add a command for coin contract addresses across chains #30

Description

@PaulRBerg

Problem

I wanted to use cg to answer: "what contract addresses does this coin use across all chains where CoinGecko lists it?"

For example, given a CoinGecko coin ID like usd-coin, it would be useful to get the platform-to-contract mapping currently available from the API via /coins/{id} (platforms / detail_platforms) or /coins/list?include_platform=true.

Today the CLI covers search, price, markets, trending, history, etc., but this specific coin metadata lookup still requires calling the API directly after resolving the coin ID.

Suggested solution

Add a command or flag for this, e.g. one of:

cg contracts usd-coin -o json
cg coin usd-coin --platforms -o json
cg search usd-coin --include-platforms -o json

A JSON shape like this would be enough for scripting:

[
  {
    "platform": "ethereum",
    "contract_address": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"
  }
]

If backed by detail_platforms, an optional detailed mode could also include fields like decimal_place where CoinGecko exposes them.

Why this helps

This is handy for agents/scripts that need to normalize a coin to on-chain addresses across EVM and non-EVM platforms. It would make cg more self-contained for coin discovery workflows: search for the coin ID, then ask the CLI which chains/contracts CoinGecko knows about.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions