### Make a Simple Price Request Source: https://docs.coingecko.com/docs/sdk-typescript Example of making a request to get the price of Bitcoin in USD using the initialized client. The response is logged to the console. ```typescript async function main() { const response = await client.simple.price.get({ vs_currencies: 'usd', ids: 'bitcoin', }); console.log(JSON.stringify(response, null, 2)); } main() ``` -------------------------------- ### Make a Simple Price Request Source: https://docs.coingecko.com/docs/sdk-python Example of making a basic request to get the price of Bitcoin in USD. Ensure your client is properly initialized. ```python response = client.simple.price.get( vs_currencies="usd", ids="bitcoin", ) print(response) ``` -------------------------------- ### Install CoinGecko CLI using Go Source: https://docs.coingecko.com/ai-integration/cli Install the CoinGecko CLI using the Go package manager. ```bash go install github.com/coingecko/coingecko-cli@latest ``` -------------------------------- ### Install CoinGecko CLI using npm Source: https://docs.coingecko.com/ai-integration/cli Install the CoinGecko CLI globally using npm. ```bash npm install -g @coingecko/cg ``` -------------------------------- ### Install CoinGecko SDK Source: https://docs.coingecko.com/docs/ai-agents-llm-apps Install the CoinGecko SDK for Python or TypeScript using pip or npm. ```bash pip install coingecko_sdk ``` ```bash npm install @coingecko/coingecko-typescript ``` -------------------------------- ### Install CoinGecko TypeScript SDK (Bun) Source: https://docs.coingecko.com/docs/sdk-typescript Install the SDK using Bun. This is an alternative package manager for installing the CoinGecko TypeScript SDK. ```bash bun add @coingecko/coingecko-typescript ``` -------------------------------- ### Install CoinGecko CLI using Homebrew Source: https://docs.coingecko.com/ai-integration/cli Install the CoinGecko CLI using the Homebrew package manager. ```bash brew install coingecko/coingecko-cli/cg ``` -------------------------------- ### Install CoinGecko Python SDK Source: https://docs.coingecko.com/ai-integration/sdk-prompts Install the CoinGecko Python SDK using pip. Ensure you have Python and pip installed. ```bash pip install coingecko_sdk ``` -------------------------------- ### Install CoinGecko TypeScript SDK Source: https://docs.coingecko.com/ai-integration/sdk-prompts Install the CoinGecko TypeScript SDK using npm. Ensure you have Node.js and npm installed. ```bash npm install @coingecko/coingecko-typescript ``` -------------------------------- ### Install skills package via npm Source: https://docs.coingecko.com/ai-integration/agent-skill Install the `skills` package globally using npm. This is the first step for agents using the npm-based installation method. ```bash npm install -g skills ``` -------------------------------- ### Initialize CoinGecko Client (Demo API) Source: https://docs.coingecko.com/docs/sdk-typescript Set up the CoinGecko client for the Demo API. Replace 'YOUR_API_KEY' with your actual demo API key. ```typescript import Coingecko from '@coingecko/coingecko-typescript'; const client = new Coingecko({ demoAPIKey: 'YOUR_API_KEY', environment: 'demo', }); ``` -------------------------------- ### Get Latest Crypto News Source: https://docs.coingecko.com/reference/news Fetches a list of the latest crypto news and guides. The `guides` filter is applicable only when a valid `coin_id` is provided. ```APIDOC ## GET /api/v3/news ### Description Retrieves a list of the latest crypto news and guides. The `guides` filter is only applicable if `coin_id` is specified and valid. ### Method GET ### Endpoint /api/v3/news ### Query Parameters - **currency_id** (string) - Optional - The ID of the coin to filter news by. - **category** (string) - Optional - The category of news to filter by. Possible values: `all`, `news`, `guides`. - **locale** (string) - Optional - The locale of the news to retrieve (e.g., `en`). - **per_page** (integer) - Optional - The number of results per page. - **page** (integer) - Optional - The page number. ### Response #### Success Response (200) - **title** (string) - News article title. - **url** (string) - News article URL. - **image** (string) - News article image URL. - **author** (string) - News article author. - **posted_at** (string) - News article published timestamp in ISO 8601 format. - **type** (string) - News article type (`news` or `guide`). - **source_name** (string) - News article source name. - **related_coin_ids** (array) - Related coin IDs. ### Response Example ```json [ { "title": "European Union debates limits on Big Tech access to cloud tenders", "url": "https://cryptobriefing.com/eu-big-tech-cloud-tender-limits/", "image": "https://assets.coingecko.com/articles/images/107301317/large/open-uri20260527-7-l3llje.?1779877857", "author": "Editorial Team", "posted_at": "2026-05-27T10:27:57Z", "type": "news", "source_name": "Crypto Briefing", "related_coin_ids": [ "could", "union-2" ] } ] ``` ``` -------------------------------- ### Get News Source: https://docs.coingecko.com/ai-integration/mcp-tools Queries the latest crypto news and guides available on CoinGecko. ```APIDOC ## GET /news ### Description Fetches the most recent cryptocurrency news articles and guides from CoinGecko. ### Method GET ### Endpoint /news ``` -------------------------------- ### Initialize CoinGecko Client Source: https://docs.coingecko.com/docs/sdk-python Set up the CoinGecko client using your API key. Load keys from environment variables for security. Supports 'pro' or 'demo' environments. ```python import os from coingecko_sdk import Coingecko client = Coingecko( pro_api_key=os.environ.get("YOUR_API_KEY"), environment="pro", # or "demo" with demo_api_key max_retries=2, ) ``` ```python from coingecko_sdk import Coingecko client = Coingecko( pro_api_key='YOUR_API_KEY', environment="pro", ) ``` ```python from coingecko_sdk import Coingecko client = Coingecko( demo_api_key='YOUR_API_KEY', environment="demo", ) ``` -------------------------------- ### Get Latest Crypto News Source: https://docs.coingecko.com/reference/news Fetches the latest crypto news and guides. Without `coin_id`, it returns all latest news. With `coin_id`, it returns both news and guides by default. Supports pagination with `page` and `per_page` parameters. ```APIDOC ## GET /api/v3/news ### Description Fetches the latest crypto news and guides. ### Method GET ### Endpoint /api/v3/news ### Parameters #### Query Parameters - **coin_ids** (string) - Optional - CoinGecko ID of the coin to filter news by. - **id** (string) - Optional - CoinGecko ID of the news to fetch. - **category** (string) - Optional - Category of the news (e.g., 'defi', 'nft'). - **type** (string) - Optional - Type of content to return ('news' or 'guide'). Defaults to 'all'. - **page** (integer) - Optional - Page number for pagination. Defaults to 1. - **per_page** (integer) - Optional - Number of articles per page. Defaults to 10. Maximum 20. ### Response #### Success Response (200) - **type** (string) - Type of the article ('news' or 'guide'). - **title** (string) - Title of the article. - **description** (string) - Description of the article. - **content** (string) - Full content of the article. - **url** (string) - URL of the article. - **image_url** (string) - URL of the article's image. - **news_url** (string) - URL of the news source. - **coin_ids** (array) - Array of CoinGecko IDs of coins mentioned in the article. - **published_at** (string) - Timestamp when the article was published. - **source_name** (string) - Name of the news source. - **source_logo** (string) - Logo URL of the news source. - **upvotes** (integer) - Number of upvotes for the article. - **downvotes** (integer) - Number of downvotes for the article. - **user_interest** (integer) - User interest score for the article. ### Request Example ```json { "example": "/api/v3/news?coin_ids=bitcoin&type=news&page=1&per_page=10" } ``` ### Response Example ```json { "example": [ { "type": "news", "title": "Bitcoin Price Analysis: BTC Eyes $70K Amidst Bullish Momentum", "description": "Bitcoin continues its upward trend, approaching the $70,000 mark...", "content": "Full article content...", "url": "https://www.coingecko.com/en/news/bitcoin-price-analysis-btc-eyes-70k-amidst-bullish-momentum", "image_url": "https://static.coingecko.com/s/coingecko-logo-32x32-97022664043744340600.png", "news_url": "https://example.com/news/bitcoin-analysis", "coin_ids": [ "bitcoin" ], "published_at": "2024-05-15T10:00:00Z", "source_name": "CoinGecko News", "source_logo": "https://static.coingecko.com/s/coingecko-logo-32x32-97022664043744340600.png", "upvotes": 100, "downvotes": 5, "user_interest": 85 } ] } ``` ``` -------------------------------- ### Define LLM Tool Schema Source: https://docs.coingecko.com/docs/ai-agents-llm-apps Example JSON schema for defining a tool that the LLM can call to get cryptocurrency prices. ```json { "name": "get_crypto_price", "description": "Get current prices for one or more cryptocurrencies", "parameters": { "type": "object", "properties": { "ids": { "type": "string", "description": "Comma-separated CoinGecko coin IDs (e.g. bitcoin,ethereum)" }, "vs_currencies": { "type": "string", "description": "Comma-separated target currencies (e.g. usd,eur)" } }, "required": ["ids", "vs_currencies"] } } ``` -------------------------------- ### Set up CoinGecko Python Client Source: https://docs.coingecko.com/ai-integration/sdk-prompts Initialize the CoinGecko Python client. Load API keys from environment variables and set the environment to 'pro' or 'demo'. Configure max retries for robustness. ```python import os from coingecko_sdk import Coingecko client = Coingecko( pro_api_key=os.environ.get("YOUR_API_KEY"), environment="pro", # or "demo" with demo_api_key max_retries=2, ) ``` -------------------------------- ### Set up CoinGecko MCP Server with Demo API Key Source: https://docs.coingecko.com/ai-integration/openclaw Configure the MCP server to connect to CoinGecko using a demo API key. Replace YOUR_API_KEY with your actual key from the Developer Dashboard. ```bash openclaw mcp set coingecko_mcp \ '{"command":"npx","args":["-y","@coingecko/coingecko-mcp"],"env":{ "COINGECKO_DEMO_API_KEY":"YOUR_API_KEY", "COINGECKO_ENVIRONMENT":"demo" }}' ``` -------------------------------- ### Initialize CoinGecko Client (Pro API) Source: https://docs.coingecko.com/docs/sdk-typescript Set up the CoinGecko client for the Pro API. Load API keys from environment variables and initialize a single reusable client instance. ```typescript import Coingecko from '@coingecko/coingecko-typescript'; const client = new Coingecko({ proAPIKey: process.env['YOUR_API_KEY'], environment: 'pro', maxRetries: 2, }); ``` -------------------------------- ### Get Crypto News Source: https://docs.coingecko.com/reference/news Queries the latest crypto news and guides on CoinGecko. Supports filtering by page, items per page, coin ID, language, and type. ```APIDOC ## GET /news ### Description To query the latest crypto news and guides on CoinGecko. ### Method GET ### Endpoint https://pro-api.coingecko.com/api/v3/news ### Parameters #### Query Parameters - **page** (integer) - Optional - Page through results. Default value: 1. Valid values: 1...20 - **per_page** (integer) - Optional - Total results per page. Default value: 10. Valid values: 1...20 - **coin_id** (string) - Optional - Filter news by coin ID. Refers to `/coins/list`. - **language** (string) - Optional - Filter news by language. Default: `en`. Enum: `en`, `ru`, `de`, `pl`, `es`, `vi`, `fr`, `pt-br`, `ar`, `bg`, `cs`, `da`, `el`, `fi`, `he`, `hi`, `hr`, `hu`, `id`, `it`, `ja`, `ko`, `lt`, `nl`, `no`, `ro`, `sk`, `sl`, `sv`, `th`, `tr`, `uk`, `zh`, `zh-tw`. - **type** (string) - Optional - Filter news by type. Default: `all`. ``` -------------------------------- ### Get Token Data by Address (Python) Source: https://docs.coingecko.com/demo/reference/token-data-contract-address Retrieve token data by specifying the contract address and network. This Python example demonstrates the equivalent functionality to the TypeScript version. ```python response = client.onchain.networks.tokens.get_address( "0xdac17f958d2ee523a2206206994597c13d831ec7", network="eth", ) print(response.model_dump_json(indent=2)) ``` -------------------------------- ### Ping Endpoint Example Source: https://docs.coingecko.com/reference/authentication Demonstrates how to authenticate requests using the recommended 'x-cg-pro-api-key' header. Replace 'YOUR_API_KEY' with your actual API key. ```APIDOC ## GET /ping ### Description This endpoint is used to check if the API is responsive. It requires authentication. ### Method GET ### Endpoint https://pro-api.coingecko.com/api/v3/ping ### Parameters #### Header Parameters - **x-cg-pro-api-key** (string) - Required - Your CoinGecko Pro API key. ### Request Example ```bash curl "https://pro-api.coingecko.com/api/v3/ping" \ -H "x-cg-pro-api-key: YOUR_API_KEY" ``` ### Response #### Success Response (200) An empty JSON object `{}` indicates a successful response. #### Response Example ```json {} ``` ``` -------------------------------- ### OpenAPI Specification for Exchange Rates Source: https://docs.coingecko.com/demo/reference/exchange-rates This OpenAPI specification defines the GET /exchange_rates endpoint, which returns BTC exchange rates against various currencies. It includes an example response. ```yaml openapi: 3.0.0 info: title: CoinGecko Demo API version: 3.0.0 servers: - url: https://api.coingecko.com/api/v3 security: - headerAuth: [] - queryAuth: [] paths: /exchange_rates: get: summary: BTC-to-Currency Exchange Rates description: To query BTC exchange rates with other currencies operationId: exchange-rates responses: '200': description: BTC exchange rates with other currencies content: application/json: schema: $ref: '#/components/schemas/ExchangeRates' example: rates: btc: name: Bitcoin unit: BTC value: 1 type: crypto eth: name: Ether unit: ETH value: 36.856 type: crypto ltc: name: Litecoin unit: LTC value: 1467.048 type: crypto bch: name: Bitcoin Cash unit: BCH value: 220.614 type: crypto bnb: name: Binance Coin unit: BNB value: 115.992 type: crypto eos: name: EOS unit: EOS value: 966946.841 type: crypto xrp: name: XRP unit: XRP value: 57106.503 type: crypto xlm: name: Lumens unit: XLM value: 516007.211 type: crypto link: name: Chainlink unit: LINK value: 8071.362 type: crypto dot: name: Polkadot unit: DOT value: 60793.71 type: crypto yfi: name: Yearn.finance unit: YFI value: 31.064 type: crypto sol: name: Solana unit: SOL value: 910.892 type: crypto usd: name: US Dollar unit: $ value: 75817.765 type: fiat aed: name: United Arab Emirates Dirham unit: DH value: 278488.131 type: fiat ars: name: Argentine Peso unit: $ value: 106789785.77 type: fiat aud: name: Australian Dollar unit: A$ value: 105840.918 type: fiat bdt: name: Bangladeshi Taka unit: ৳ value: 9307822.089 type: fiat bhd: name: Bahraini Dinar unit: BD value: 28600.735 type: fiat bmd: ``` -------------------------------- ### Basic CoinGecko CLI Commands Source: https://docs.coingecko.com/ai-integration/cli Examples of basic commands to fetch cryptocurrency data, including prices, markets, and historical data, as well as launching the interactive TUI. ```bash cg price --ids bitcoin,ethereum ``` ```bash cg markets --total 100 ``` ```bash cg history bitcoin --days 7 ``` ```bash cg tui markets ``` -------------------------------- ### OpenAPI Specification for /coins/list/new Source: https://docs.coingecko.com/reference/coins-list-new This OpenAPI specification defines the `get /coins/list/new` endpoint, which returns a list of recently added coins. It includes request parameters, response schemas, and example responses. ```yaml openapi: 3.0.0 info: title: CoinGecko Pro API version: 3.0.0 servers: - url: https://pro-api.coingecko.com/api/v3 security: - headerAuth: [] - queryAuth: [] paths: /coins/list/new: get: summary: Recently Added Coins description: To query the latest 200 coins that recently listed on CoinGecko operationId: coins-list-new responses: '200': description: List of recently added coins content: application/json: schema: $ref: '#/components/schemas/CoinsListNew' example: - id: upside-down-cat symbol: USDC name: UpSide Down Cat activated_at: 1778737128 - id: chinification symbol: chinify name: Chinification activated_at: 1778705764 components: schemas: CoinsListNew: type: array items: type: object required: - id - symbol - name - activated_at properties: id: type: string description: Coin ID symbol: type: string description: Coin symbol name: type: string description: Coin name activated_at: type: integer description: Timestamp when coin was activated on CoinGecko securitySchemes: headerAuth: type: apiKey in: header name: x-cg-pro-api-key description: >- Learn how to [set up your API key](https://docs.coingecko.com/docs/setting-up-your-api-key) queryAuth: type: apiKey in: query name: x_cg_pro_api_key description: >- Learn how to [set up your API key](https://docs.coingecko.com/docs/setting-up-your-api-key) ``` -------------------------------- ### OpenAPI Specification for Supported Currencies Source: https://docs.coingecko.com/demo/reference/simple-supported-currencies This OpenAPI specification defines the GET endpoint `/simple/supported_vs_currencies` for retrieving a list of supported currencies. It includes request and response details, along with an example response. ```yaml openapi: 3.0.0 info: title: CoinGecko Demo API version: 3.0.0 servers: - url: https://api.coingecko.com/api/v3 security: - headerAuth: [] - queryAuth: [] paths: /simple/supported_vs_currencies: get: summary: Currencies List description: To query all the supported currencies on CoinGecko operationId: simple-supported-currencies responses: '200': description: List of supported currencies content: application/json: schema: $ref: '#/components/schemas/SupportedCurrencies' example: - btc - eth - ltc - bch - bnb - eos - xrp - xlm - link - dot - yfi - sol - usd - aed - ars - aud - bdt - bhd - bmd - brl - cad - chf - clp - cny - czk - dkk - eur - gbp - gel - hkd - huf - idr - ils - inr - jpy - krw - kwd - lkr - mmk - mxn - myr - ngn - nok - nzd - php - pkr - pln - rub - sar - sek - sgd - thb - try - twd - uah - vef - vnd - zar - xdr - xag - xau - bits - sats components: schemas: SupportedCurrencies: type: array items: type: string securitySchemes: headerAuth: type: apiKey in: header name: x-cg-demo-api-key description: >- Learn how to [set up your API key](https://docs.coingecko.com/docs/setting-up-your-api-key) queryAuth: type: apiKey in: query name: x_cg_demo_api_key description: >- Learn how to [set up your API key](https://docs.coingecko.com/docs/setting-up-your-api-key) ``` -------------------------------- ### Set up CoinGecko TypeScript Client Source: https://docs.coingecko.com/ai-integration/sdk-prompts Initialize the CoinGecko TypeScript client. Load API keys from environment variables and set the environment to 'pro' or 'demo'. Configure max retries. ```typescript import Coingecko from '@coingecko/coingecko-typescript'; const client = new Coingecko({ proAPIKey: process.env['YOUR_API_KEY'], environment: 'pro', // or 'demo' with demoAPIKey maxRetries: 2, }); ``` -------------------------------- ### Derivatives Tickers List OpenAPI Specification Source: https://docs.coingecko.com/demo/reference/derivatives-tickers This OpenAPI specification defines the GET /derivatives endpoint for retrieving a list of derivative tickers. It includes request parameters, response schemas, and examples. ```yaml openapi: 3.0.0 info: title: CoinGecko Demo API version: 3.0.0 servers: - url: https://api.coingecko.com/api/v3 security: - headerAuth: [] - queryAuth: [] paths: /derivatives: get: summary: Derivatives Tickers List description: To query all the tickers from derivatives exchanges on CoinGecko operationId: derivatives-tickers responses: '200': description: List of derivative tickers content: application/json: schema: $ref: '#/components/schemas/DerivativesTickers' example: - market: Binance (Futures) symbol: BTCUSDT index_id: BTC price: '77034.8' price_percentage_change_24h: -1.1733397846861013 contract_type: perpetual index: 76691.4276087 basis: -0.138769748300737 spread: 0.01 funding_rate: 0.004308 open_interest: 7497508223.83 volume_24h: 9623150393.3656 last_traded_at: 1779807819 expired_at: null - market: Binance (Futures) symbol: ETHUSDT index_id: ETH price: '2113.92' price_percentage_change_24h: -1.213464572845443 contract_type: perpetual index: 2099.55744186 basis: -0.19217332857957786 spread: 0.01 funding_rate: 0.005327 open_interest: 4563725156.36 volume_24h: 7655835901.46112 last_traded_at: 1779807818 expired_at: null components: schemas: DerivativesTickers: type: array items: type: object required: - market - symbol - index_id - price - price_percentage_change_24h - contract_type - index - basis - spread - funding_rate - open_interest - volume_24h - last_traded_at - expired_at properties: market: type: string description: Derivative market name symbol: type: string description: Derivative ticker symbol index_id: type: string description: Derivative underlying asset price: type: string description: Derivative ticker price price_percentage_change_24h: type: number description: Derivative ticker price percentage change in 24 hours contract_type: type: string description: Derivative contract type index: type: number description: Derivative underlying asset price basis: type: number description: Difference of derivative price and index price spread: type: number description: Derivative bid-ask spread funding_rate: type: number description: Derivative funding rate open_interest: type: number description: Derivative open interest volume_24h: type: number description: Derivative trading volume in 24 hours last_traded_at: type: number description: Derivative last traded time in UNIX timestamp expired_at: type: number nullable: true description: Derivative expiry time in UNIX timestamp securitySchemes: headerAuth: type: apiKey in: header name: x-cg-demo-api-key description: >- Learn how to [set up your API key](https://docs.coingecko.com/docs/setting-up-your-api-key) queryAuth: type: apiKey in: query name: x_cg_demo_api_key description: >- Learn how to [set up your API key](https://docs.coingecko.com/docs/setting-up-your-api-key) ``` -------------------------------- ### Initialize CoinGecko Client (Pro API with Hardcoded Key) Source: https://docs.coingecko.com/docs/sdk-typescript Set up the CoinGecko client for the Pro API using a hardcoded API key. It is recommended to use environment variables instead. ```typescript import Coingecko from '@coingecko/coingecko-typescript'; const client = new Coingecko({ proAPIKey: 'YOUR_API_KEY', environment: 'pro', }); ``` -------------------------------- ### Get Exchange Data by ID (OpenAPI Spec) Source: https://docs.coingecko.com/demo/reference/exchanges-id This OpenAPI specification defines the endpoint for retrieving detailed information about a specific cryptocurrency exchange using its ID. It includes parameters for filtering and examples of the response structure. ```yaml openapi: 3.0.0 info: title: CoinGecko Demo API version: 3.0.0 servers: - url: https://api.coingecko.com/api/v3 security: - headerAuth: [] - queryAuth: [] paths: /exchanges/{id}: get: summary: Exchange Data by ID description: >- To query exchange's data (name, year established, country, etc.), exchange volume in BTC and top 100 tickers based on exchange's ID operationId: exchanges-id parameters: - name: id in: path required: true description: |- Exchange ID. *refers to [`/exchanges/list`](/reference/exchanges-list). schema: type: string default: binance - name: dex_pair_format in: query required: false description: |- Set to `symbol` to display DEX pair base and target as symbols. Default: `contract_address` schema: type: string enum: - contract_address - symbol responses: '200': description: Exchange data content: application/json: schema: $ref: '#/components/schemas/ExchangesId' example: name: Binance year_established: 2017 country: Cayman Islands description: >- One of the world's largest cryptocurrency exchanges by trading volume. url: https://www.binance.com/ image: >- https://coin-images.coingecko.com/markets/images/52/small/binance.jpg?1706864274 facebook_url: https://www.facebook.com/binanceexchange reddit_url: https://www.reddit.com/r/binance/ telegram_url: '' slack_url: '' other_url_1: https://medium.com/binanceexchange other_url_2: https://steemit.com/@binanceexchange twitter_handle: binance has_trading_incentive: false centralized: true public_notice: '' alert_notice: '' trust_score: 10 trust_score_rank: 2 coins: 435 pairs: 1391 trade_volume_24h_btc: 95073.68489926813 tickers: - base: USDC target: USDT market: name: Binance identifier: binance has_trading_incentive: false last: 1.00087 volume: 2089887585 converted_last: btc: 0.00001301 eth: 0.00047417 usd: 0.999569 converted_volume: btc: 27187 eth: 990971 usd: 2088986570 trust_score: null bid_ask_spread_percentage: 0.010999 timestamp: '2026-05-26T10:21:17+00:00' last_traded_at: '2026-05-26T10:21:17+00:00' last_fetch_at: '2026-05-26T10:23:00+00:00' is_anomaly: false is_stale: false trade_url: https://www.binance.com/en/trade/USDC_USDT?ref=37754157 token_info_url: null coin_id: usd-coin target_coin_id: tether coin_mcap_usd: 76286248956.20789 - base: BTC target: USDT market: name: Binance identifier: binance has_trading_incentive: false last: 76960 volume: 9037.21995 converted_last: btc: 1.000348 eth: 36.491428 usd: 76860 converted_volume: btc: 9040 eth: 329781 usd: 694600292 trust_score: null bid_ask_spread_percentage: 0.010013 timestamp: '2026-05-26T10:21:39+00:00' last_traded_at: '2026-05-26T10:21:39+00:00' last_fetch_at: '2026-05-26T10:22:33+00:00' is_anomaly: false is_stale: false trade_url: https://www.binance.com/en/trade/BTC_USDT?ref=37754157 token_info_url: null coin_id: bitcoin target_coin_id: tether coin_mcap_usd: 1536007329547.9153 status_updates: - description: >- ``` -------------------------------- ### OpenAPI Specification for NFTs List Source: https://docs.coingecko.com/demo/reference/nfts-list This OpenAPI specification defines the `/nfts/list` GET endpoint, which allows querying all supported NFTs. It includes parameters for ordering, results per page, and pagination, along with response schema and examples. ```yaml openapi: 3.0.0 info: title: CoinGecko Demo API version: 3.0.0 servers: - url: https://api.coingecko.com/api/v3 security: - headerAuth: [] - queryAuth: [] paths: /nfts/list: get: summary: NFTs List description: >- To query all supported NFTs with ID, contract address, name, asset platform ID and symbol on CoinGecko operationId: nfts-list parameters: - name: order in: query required: false description: Sort order of responses. schema: type: string enum: - h24_volume_usd_asc - h24_volume_usd_desc - h24_volume_native_asc - h24_volume_native_desc - floor_price_native_asc - floor_price_native_desc - market_cap_native_asc - market_cap_native_desc - market_cap_usd_asc - market_cap_usd_desc - name: per_page in: query required: false description: |- Total results per page. Valid values: 1...250 schema: type: integer - name: page in: query required: false description: Page through results. schema: type: integer responses: '200': description: List of supported NFTs content: application/json: schema: $ref: '#/components/schemas/NFTsList' example: - id: cryptopunks contract_address: '0xb47e3cd837dDF8e4c57F05d70Ab865de6e193BBB' name: CryptoPunks asset_platform_id: ethereum symbol: PUNK - id: bored-ape-yacht-club contract_address: '0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d' name: Bored Ape Yacht Club asset_platform_id: ethereum symbol: BAYC components: schemas: NFTsList: type: array items: type: object required: - id - contract_address - name - asset_platform_id - symbol properties: id: type: string description: NFT collection ID contract_address: type: string description: NFT collection contract address name: type: string description: NFT collection name asset_platform_id: type: string description: NFT collection asset platform ID symbol: type: string description: NFT collection symbol securitySchemes: headerAuth: type: apiKey in: header name: x-cg-demo-api-key description: >- Learn how to [set up your API key](https://docs.coingecko.com/docs/setting-up-your-api-key) queryAuth: type: apiKey in: query name: x_cg_demo_api_key description: >- Learn how to [set up your API key](https://docs.coingecko.com/docs/setting-up-your-api-key) ``` -------------------------------- ### Initialize CoinGecko Client Source: https://docs.coingecko.com/docs/ai-agents-llm-apps Initialize the CoinGecko client with your API key and desired environment (pro or demo). ```python import os from coingecko_sdk import Coingecko client = Coingecko( pro_api_key=os.environ.get("COINGECKO_PRO_API_KEY"), environment="pro", # or "demo" with demo_api_key ) ``` ```typescript import Coingecko from '@coingecko/coingecko-typescript'; const client = new Coingecko({ proAPIKey: process.env['COINGECKO_PRO_API_KEY'], environment: 'pro', // or 'demo' with demoAPIKey }); ``` -------------------------------- ### Get Circulating Supply Chart within Time Range by ID Source: https://docs.coingecko.com/reference/coins-id-circulating-supply-chart-range Fetches historical circulating supply data for a coin within a specified time range. Requires a coin ID, a start date, and an end date. ```APIDOC ## GET /coins/{id}/circulating_supply_chart/range ### Description To query historical circulating supply of a coin, within a range of timestamp based on the provided coin ID. ### Method GET ### Endpoint https://pro-api.coingecko.com/api/v3/coins/{id}/circulating_supply_chart/range ### Parameters #### Path Parameters - **id** (string) - Required - Coin ID. Refers to `/coins/list`. #### Query Parameters - **from** (string) - Required - Starting date in ISO date string (`YYYY-MM-DD` or `YYYY-MM-DDTHH:MM`) or UNIX timestamp. Use ISO date string for best compatibility. - **to** (string) - Required - Ending date in ISO date string (`YYYY-MM-DD` or `YYYY-MM-DDTHH:MM`) or UNIX timestamp. Use ISO date string for best compatibility. ### Response #### Success Response (200) - **circulating_supply** (array) - Circulating supply data points as [timestamp, supply] pairs - items (array) - items (oneOf: number, string) ### Response Example ```json { "circulating_supply": [ [ 1735689600000, "19803921.0" ], [ 1735776000000, "19804340.0" ], [ 1735862400000, "19804871.0" ] ] } ``` ``` -------------------------------- ### Authenticate with Header Source: https://docs.coingecko.com/demo/reference/authentication Use the `x-cg-demo-api-key` header for authentication. This method is recommended for production environments. ```bash curl "https://api.coingecko.com/api/v3/ping" \ -H "x-cg-demo-api-key: YOUR_API_KEY" ``` -------------------------------- ### Top Pools by Token Address OpenAPI Specification Source: https://docs.coingecko.com/reference/top-pools-contract-address This OpenAPI specification defines the structure and parameters for the /onchain/networks/{network}/tokens/{token_address}/pools GET endpoint. It includes details on request parameters, response schemas, and an example response. ```yaml openapi: 3.0.0 info: title: CoinGecko Pro API version: 3.0.0 servers: - url: https://pro-api.coingecko.com/api/v3 security: - headerAuth: [] - queryAuth: [] paths: /onchain/networks/{network}/tokens/{token_address}/pools: get: summary: Top Pools by Token Address description: >- To query top pools based on the provided token contract address on a network operationId: top-pools-contract-address parameters: - name: network in: path required: true description: |- Network ID. *refers to [`/onchain/networks`](/reference/networks-list). schema: type: string default: eth - name: token_address in: path required: true description: Token contract address. schema: type: string default: '0xdac17f958d2ee523a2206206994597c13d831ec7' - name: include in: query required: false description: |- Attributes to include, comma-separated if more than one. Available values: `base_token`, `quote_token`, `dex` schema: type: string - name: include_inactive_source in: query required: false description: |- Include tokens from inactive pools using the most recent swap. Default: `false` schema: type: boolean - name: page in: query required: false description: |- Page through results. Default value: 1 schema: type: integer - name: sort in: query required: false description: |- Sort the pools by field. Default: `h24_volume_usd_liquidity_desc` schema: type: string enum: - h24_volume_usd_liquidity_desc - h24_tx_count_desc - h24_volume_usd_desc - name: include_gt_community_data in: query required: false description: >- Include GeckoTerminal community data (sentiment votes, suspicious reports). Default: `false` schema: type: boolean responses: '200': description: Top pools for a token content: application/json: schema: $ref: '#/components/schemas/Pool' example: data: - id: >- eth_0x395f91b34aa34a477ce3bc6505639a821b286a62b1a164fc1887fa3a5ef713a5 type: pool attributes: base_token_price_usd: '1.0008763651' base_token_price_native_currency: '0.000482317790072442' quote_token_price_usd: '0.998449563724543' quote_token_price_native_currency: '0.000481148325490986' base_token_price_quote_token: '1.0024305698' quote_token_price_base_token: '0.9975753236' address: >- 0x395f91b34aa34a477ce3bc6505639a821b286a62b1a164fc1887fa3a5ef713a5 name: USDC / USDT pool_created_at: '2025-04-13T14:45:47Z' token_price_usd: '0.998449563724543' fdv_usd: '96921299344.3568' market_cap_usd: '189288747230.058' price_change_percentage: m5: '0' m15: '-0.08' m30: '-0.02' h1: '-0.55' h6: '0.23' h24: '-0.21' transactions: m5: buys: 1 sells: 0 buyers: 1 sellers: 0 m15: buys: 2 sells: 13 buyers: 2 sellers: 12 m30: buys: 16 sells: 22 buyers: 15 sellers: 21 h1: buys: 44 sells: 50 buyers: 41 sellers: 46 h6: buys: 306 sells: 373 buyers: 240 sellers: 305 h24: buys: 1062 sells: 1217 buyers: 677 ``` -------------------------------- ### Setup CoinGecko TypeScript Client Source: https://docs.coingecko.com/ai-integration/kiro Initialize the Coingecko client with your API key loaded from environment variables. Supports 'pro' or 'demo' environments and configurable retries. ```typescript import Coingecko from '@coingecko/coingecko-typescript'; const client = new Coingecko({ proAPIKey: process.env['YOUR_API_KEY'], environment: 'pro', // or 'demo' with demoAPIKey maxRetries: 2, }); ```