# Introduction

Discover GeckoTerminal's free Public API! Access real-time crypto prices, OHLC, trading volumes, and liquidity across 1,500+ DEXs and 200+ networks. Build powerful DeFi apps with on-chain market data!

GeckoTerminal is a DeFi and DEX aggregator that tracks real-time cryptocurrency prices, trading volumes, transactions, and liquidity data across decentralized exchanges. GeckoTerminal offers advanced charting tools and analytics to assist traders in making informed decisions.

Explore the market data and prices of more than 6M+ tokens traded across 200+ blockchain networks across 1,500+ DEXes – brought to you by the same team behind CoinGecko.

### About GeckoTerminal API (Beta)

With the GeckoTerminal Public API, developers can access price, market data, and historical charts of any token by calling the API through **RESTful JSON endpoints**.

Here are some examples of what you can do with public endpoints:

* Get the market data (price, volume, historical chart) of any token on-chain, with a token or pool address.
* Find all the pools that are trading a specific token.
* Plot a candlestick chart with OHLCV data, with a given pool address.

**Try out all free endpoints via our** [**GeckoTerminal Public API Swagger Docs**](https://www.geckoterminal.com/dex-api?utm_source=gt-apiguide\&utm_medium=referral\&utm_content=apiguide-swagger) 👈

### Is the GeckoTerminal API free to use?

Yes, the GeckoTerminal API is currently free to use. We appreciate a link attribution back to GeckoTerminal because it helps us to continue providing the API for free. Your support enables us to keep delivering this valuable resource to the community at no cost.

Please note that the GeckoTerminal API is currently in Beta and therefore subject to changes. We recommend setting the request version when calling the API to avoid unexpected issues.<br>

***

**Access On-Chain DEX Data on** [**CoinGecko API**](https://www.coingecko.com/en/api/pricing?utm_source=gt-apiguide\&utm_medium=referral\&utm_content=apiguide-intro-banner) 👈

<figure><img src="/files/17HxYNjb8Nd10jD9rrVa" alt=""><figcaption></figcaption></figure>

The same on-chain DEX data that is currently available on GeckoTerminal’s Public API is also accessible via CoinGecko API’s new **/onchain** endpoints. Subscribe to any [paid plan](https://www.coingecko.com/en/api/pricing?utm_source=gt-apiguide\&utm_medium=referral\&utm_content=apiguide-intro) to increase rate limits and gain access to crypto price, market data, metadata and more.

{% embed url="<https://docs.coingecko.com/reference/endpoint-overview?utm_source=gt-apiguide&utm_medium=referral&utm_content=apiguide-bookmark>" %}

***

### Embedded Charts

If you like to quickly add OHLCV charting capability to your website. You may use the embedded chart feature on GeckoTerminal to add the chart via an iframe. Follow this guide on [how to add embedded DEX chart to your website](https://about.geckoterminal.com/embed-charts).


# Getting Started

It is really easy!

## 1. Making an API request

* Root URL for GeckoTerminal API: <https://api.geckoterminal.com/api/v2>
* You can find all the available API endpoints at <https://www.geckoterminal.com/dex-api>
* Make an API call using curl or any HTTP libraries
* Try it by pasting the code below into your terminal

```
curl -X 'GET' \
  'https://api.geckoterminal.com/api/v2/networks?page=1' \
  -H 'accept: application/json'
```


# Authentication

GeckoTerminal API is currently in Beta and is available publicly. There is no authentication needed at the moment. However you are subject to a universal rate limit.


# FAQ

### Q: What is the rate limit for the GeckoTerminal API?

A: The current rate limit for the Public API is set at 30 calls per minute. Should you require a higher rate limit, please refer to the question below.

### Q: Is there a paid plan to access higher rate limit for GeckoTerminal API?

A: Yes, you may subscribe to any CoinGecko API paid plan to access higher rate limit for GeckoTerminal endpoints (known as [**/onchain** endpoints](https://docs.coingecko.com/reference/endpoint-overview#onchain-dex-endpoints-geckoterminal)). Learn more on: <https://www.coingecko.com/en/api/pricing>

### Q: I have a CoinGecko API subscription, can I use that subscription with the GeckoTerminal API?

A: Yes, you may now access all the[ endpoints](https://docs.coingecko.com/reference/endpoint-overview#onchain-dex-endpoints-geckoterminal) directly with your CoinGecko API paid subscription. Here's the documentation: <https://docs.coingecko.com/>

### Q: I am already using the CoinGecko API to get token prices, why do I need GeckoTerminal API?

A: Here are a few reasons why you would want to consider GeckoTerminal API :-

1. On-chain first. In GeckoTerminal everything is an address. You can query DEX and token data using contract addresses.
2. Tokens that are not listed on CoinGecko. Since GeckoTerminal ingests all trades on the network. You can get prices for any tokens that are not found on CoinGecko. However you need to know what you are doing since these tokens may be spams.
3. OHLCV based on on-chain trades.

### Q: Can I get the historical price and volume of a token?

A: Yes you can. You will need to identify the pool that is trading the token you are interested in. Use the `ohlcv` endpoint and pass in the pool address. Specify the candle timeframe and aggregate. For example, if you are looking for daily data, pass `day` into the timeframe and `1` into the aggregate.

### Q: For <mark style="color:blue;">/networks/{network}/tokens/{token\_address}/pool</mark> endpoint, how are the top 20 pools being ranked?

A: The top 20 pools are ranked based on their liquidity and trading activity, with the goal of identifying the most liquid pools. The ranking is determined by a combination of two key factors: liquidity ('reserve\_in\_usd') and 24-Hour Trading Volume ('volume\_usd').&#x20;

### Q: For <mark style="color:blue;">/networks/{network}/tokens/{address}</mark> endpoint, what does "price\_usd" refer to?

A: "price\_usd" refers to the USD price of the token in the **first pool** listed under "top\_pools".

### Q: What is the timestamp format used in the OHLCV endpoint?

A: Timestamp format is in epoch/unix timestamp seconds. For example use `1679414400` and not `1679414400000` which is in epoch/unix milliseconds. The OHLCV endpoint returns candlestick timestamp in this format, and you should also use this format when calling the query parameter.

### Q: Why is \`market\_cap\_usd\` null?

`market_cap_usd` is null if the token returned on GeckoTerminal API is not listed on coingecko.com or do not have its supply verified (if listed on CoinGecko). `fdv` will always be returned as its a multiplier of onchain supply and current price.


# Changelogs

**Note:** Starting from November 2024, all new changes and updates will be posted on this page: <https://docs.coingecko.com/changelog> . Please bookmark and refer to the new changelog page instead.

#### 8 October 2024:

* `/tokens/info_recently_updated` can be filtered by blockchain network.

#### 9 July 2024:

* `/tokens/info_recently_updated` includes decimal places.

#### 11 March 2024:

* All pool in responses now returns `price_change_percentage` , `transactions`, and `volume_usd` in more intervals 5-minutes, 1-hour, 6-hours, and 24-hours.

#### 28 February 2024:

* `image_url` now returned in the token response in the `/tokens` and `/pools` endpoints.
* Sorting parameters such as `order=h24_volume_usd_desc` and `order=h24_tx_count_desc` added for `/pools` endpoints.
* `/ohlc` endpoint can now accept token address (as long as it exist in the pool queried) to be returned as data.
* `/ohlc` response describes the base and target token.

#### 3 December 2023:

* Pool data now returns transaction stats for the last 1 hour. Unique buyers and sellers in the last 1 hour and 24 hours are now returned in the response.

#### 24 November 2023:

* Trending Pools API is now available to fetch a list of pools that are trending as seen on GeckoTerminal based on web visits and onchain activities. `/networks/{network}/trending_pools`

#### 10 November 2023:

* Inspired by CoinGecko API most popular endpoint, we have launched the Simple endpoint. Simply pass in addresses of any tokens on supported blockchain and get price data for it.

#### 8 November 2023:

* You can now get the latest 300 trades in the past 24 hours of a given pool. You may optionally filter by trade size as well. `/networks/{network}/pools/{pool_address}/trades`\
  You can now build your own telegram bot alert!&#x20;

#### 23 October 2023:

* You can now fetch token information such as name, image, social links, and description via API calls
* To fetch information of tokens inside a pool, use `/networks/{network}/pools/{pool_address}/info`
* To fetch information of a specific token use `/networks/{network}/tokens/{address}/info`
* If you like to get token information of the most recently updated tokens, use `/tokens/info_recently_updated`

#### 11 September 2023:

* Pool response data now returns price in the base and quote token of the pool `base_token_price_quote_token` and `quote_token_price_base_token` for your convenience without the need to do additional calculation to derive these values.

#### 7 September 2023:

* Added new endpoint to search for pools `/search/pools` based on keywords passed into query.

#### 6 September 2023:

* Added new endpoints to allow querying multiple pools and tokens in a single API call. `/networks/{network}/pools/multi/{addresses}` and `/networks/{network}/tokens/multi/{addresses}`

#### 23 June 2023:

* More data added to the Pool response such as FDV, market cap (from CoinGecko if available), price change percentage, volume, number of buy/sell transactions
* More data added when querying for token such as FDV, volume, market cap, and the top 3 pools.

#### 28 May 2023:

* Token metadata such as name, symbol, and CoinGecko ID are now returned in the Pool response. Need to pass in this attribute `include=base_token,quote_token`.
* CoinGecko asset platform ID added to the response for **/api/v2/networks** API call.

#### 19 April 2023:

* Rate limit increased from 10 calls per minute to 30 calls per minute

#### 18 April 2023:

* `base_token_native_currency` and `quote_token_native_currency` added to the **pools** endpoint response. This allows you to obtain price in the network's native currency in addition to in USD.
* `reserve_in_usd` added to the **pools** endpoint response. This returns total liquidity/reserve of the pool in USD.
* `pool_created_at` added to the **pools** endpoint response.
* **/networks/{network}/new\_pools** API endpoint added to query new pools discovered for a network
* **/networks/new\_pools API endpoint** added to query new pools discovered across all networks

#### **23 March 2023:**

* **ohlcv** endpoint returns more granularity `day`, `hour`, `minute` and multiple `aggregates`


# Clients/Libraries (Unofficial)

These are open-sourced projects owned by their respective maintainers and community. CoinGecko is not responsible for maintaining the compatibility of these projects - please DYOR.

Note: These wrappers are for GeckoTerminal API only. For CoinGecko API clients, check them out at the [CoinGecko API doc](https://apiguide.coingecko.com/others/clients-unofficial).

<table><thead><tr><th width="132">Wrapper</th><th>Link</th></tr></thead><tbody><tr><td>Rust</td><td><a href="https://github.com/dineshpinto/geckoterminal-rs">https://github.com/dineshpinto/geckoterminal-rs</a></td></tr><tr><td>Python</td><td><a href="https://github.com/dineshpinto/geckoterminal-api">https://github.com/dineshpinto/geckoterminal-api</a></td></tr><tr><td>Python</td><td><a href="https://github.com/cardosofede/geckoterminal-py">https://github.com/cardosofede/geckoterminal-py</a></td></tr><tr><td>Python</td><td><a href="https://github.com/samuel-poon/geckoterminal">https://github.com/samuel-poon/geckoterminal</a></td></tr><tr><td>Kotlin</td><td><a href="https://github.com/Viktor-Kollegov/geckoterminal-kotlin-api-ktor">https://github.com/Viktor-Kollegov/geckoterminal-kotlin-api-ktor</a></td></tr></tbody></table>


