# Cryptocurrency Data Crawler (Updates CustomCoinData.json Every 12 hours)
A robust Node.js script that fetches comprehensive cryptocurrency data from the CoinGecko API, including market data, social media links, and technical details for the top cryptocurrencies by market cap.
## Features
- Fetches detailed data for top 1500 cryptocurrencies (configurable)
- Implements rate limiting and retry mechanisms
- Saves progress for resume capability
- Generates unique IDs for each coin
- Includes comprehensive error handling
- Stores data in JSON format
- Supports multiple blockchain platforms
- Collects social media links and community metrics
## Prerequisites
- Node.js (v12 or higher)
- npm (Node Package Manager)
## Installation
1. Clone the repository:
```bash
git clone https://github.com/genfuture/cryptocurrency-scraper.git
- Install dependencies:
cd crypto-scraper
npm install
Run the script using Node.js:
node coins.cjs
The script will:
- Fetch data for the top 1500 cryptocurrencies (6 pages of 250 coins each) able to modify the number of coins per page
- Save progress automatically after each coin
- Generate a
customCoinData.json
file with the results
The crawler collects the following data for each cryptocurrency:
- Name and symbol
- Current price and market cap
- Rank and scores (CoinGecko rank, developer score, etc.)
- Launch date and genesis information
- 24h price changes and volumes
- Supply information (circulating, total, max)
- High/low prices
- Market cap changes
- Telegram
- YouTube
- Discord
- Blockchain platforms and addresses
- Explorer links
- Website URLs
- Platform-specific addresses
The script implements several measures to respect CoinGecko's API rate limits:
- 15-second delay between individual coin requests
- 30-second delay between page requests
- Exponential backoff for rate limit errors
- Maximum 5 retries per request
The script includes robust error handling:
- Automatic retry mechanism for failed requests
- Progress saving for resume capability
- Default values for missing data
- Detailed error logging
Data is saved in JSON format with the following structure:
{
"uniqueId": {
"name": "Bitcoin",
"symbol": "BTC",
"price": "50000",
"rank": "1",
// ... additional fields
}
}
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- CoinGecko API for providing cryptocurrency data
- Contributors and maintainers of the project
For questions, suggestions, or collaboration opportunities:
- GitHub: genfuture
- Email: g.prem2349@gmail.com
- LinkedIn: Prem
Feel free to reach out for any inquiries or discussions about the project!
This tool is for educational and research purposes only. Always verify the data independently before making any financial decisions.
This README provides a comprehensive overview of your cryptocurrency data crawler, including installation instructions, features, usage guidelines, and important technical details. It's well-structured and should help users understand and use your tool effectively.