CoinGecko API
Free with high rate limits and extensive token coverage.
Provides historical price data including ATH prices (timestamp and price) via single token queries.
You can script batch requests for 3,000+ tokens with rate limit handling.
what are the limits for free users;
assist you with example API request scripts for CoinGecko or Moralis to handle large token lists and
compute ATH values automatically
yes, give me the best free methods using those options and explain in depth of the limitations when it
comes to scanning 3000+tokens
CoinGecko API Free Tier Limits and Considerations
• Rate Limit: 30 calls per minute (with a free API key from a Demo account). No key means fewer
calls (5-15/min depending on conditions).
• Monthly Quota: 10,000 calls per month on the free plan.
• Endpoints: Access to 50+ market endpoints including token data and historical data (daily and
hourly for 1 year).
• No WebSocket: Only RESTful calls, no streaming.
• No batch endpoint: You must call information per token sequentially or in manageable
batches respecting rate limits.
Best Free Method to Scan 3,000+ Tokens for ATH Using
CoinGecko API
1. Token List
• First, call /coins/list endpoint once to get the IDs of all tokens to scan.
2. Fetch Historical Data + ATH
• Use /coins/{id} endpoint with
query localization=false&tickers=false&market_data=true&community_data=fals
e&developer_data=false&sparkline=false to fetch full token info,
including market_data.ath which gives ATH price and timestamp.
• This endpoint returns ATH in USD and native currency, accessible from each token query.
1
3. Batching and Rate Limit Handling
• With 30 calls/min limit, scanning 3,000 tokens will take about 100 minutes (3,000 / 30 calls per
min = 100 mins).
• Implement rate limiting in your script (e.g., Python with asyncio and aiohttp or simple delay
loops).
• Consider running multiple instances with different IPs or API keys if available.
Limitations for Large-Scale Scanning Using Free CoinGecko
Tier
• The free monthly quota of 10,000 calls limits how frequently you can refresh or rescan the full
3,000-token dataset (you can do it about 3x per month).
• Burst calls over the 30 calls/minute limit will be rejected with HTTP 429 errors.
• No streaming or real-time updates; you get static snapshots per request.
• Historical data is limited (1-year daily granularity for most tokens).
Using Moralis API as Alternative
• Moralis provides token price data with historical OHLC and can be scripted for ATH calculation
client-side.
• Moralis free tier has limited requests, but higher rate limits than CoinGecko in some plans.
• Moralis API supports batch token queries but may require paid plans for large volumes.
2
import asyncio import aiohttp import time API_URL = "https://api.coingecko.com/api/v3/coins/{}"
TOKEN_LIST_URL = "https://api.coingecko.com/api/v3/coins/list" HEADERS = {'accept':
'application/json'} RATE_LIMIT_CALLS_PER_MIN = 30 async def fetch_token_ath(session, token_id): url =
API_URL.format(token_id) params = { 'localization': 'false', 'tickers': 'false', 'market_data': 'true',
'community_data': 'false', 'developer_data': 'false', 'sparkline': 'false' } try: async with session.get(url,
params=params, headers=HEADERS) as resp: if resp.status == 200: data = await resp.json() ath =
data.get('market_data', {}).get('ath', {}).get('usd', None) ath_date = data.get('market_data',
{}).get('ath_date', {}).get('usd', None) print(f"Token {token_id}: ATH = {ath} at {ath_date}") return
{token_id: (ath, ath_date)} else: print(f"Failed for {token_id}: HTTP {resp.status}") except Exception as e:
print(f"Exception for {token_id}: {e}") return {} async def main(): async with aiohttp.ClientSession() as
session: async with session.get(TOKEN_LIST_URL) as resp: token_list = await resp.json() results = {} #
Process tokens in batches to respect rate limits for i in range(0, len(token_list),
RATE_LIMIT_CALLS_PER_MIN): batch = token_list[i:i+RATE_LIMIT_CALLS_PER_MIN] tasks =
[fetch_token_ath(session, token['id']) for token in batch] batch_results = await asyncio.gather(*tasks)
for res in batch_results: results.update(res) if i + RATE_LIMIT_CALLS_PER_MIN < len(token_list):
print("Sleeping to respect rate limits...") time.sleep(60) # Sleep 60 seconds to avoid rate limits # Use
'results' dict for further processing or saving if __name__ == "__main__": asyncio.run(main())
In Summary
• CoinGecko free API allows tokens ATH retrieval via individual token calls with a rate limit of 30
calls/min and 10,000 calls/month quota.
• Scanning 3,000+ tokens will take a few hours per full scan at free-tier limits.
• Use batching, asynchronous requests, and rate delay to avoid hitting limits.
• Moralis is a good alternative with better batch support but potentially requires paid plans for
large scale.
• Avoid heavy web scraping or unofficial methods to ensure reliability and compliance.