| # Environment Variables for Cryptocurrency Data API | |
| # Copy this file to .env and add your API keys | |
| # ============================================================================= | |
| # PRIMARY DATA PROVIDERS (Highly Recommended) | |
| # ============================================================================= | |
| # CryptoCompare API (Free tier: 100,000 calls/month) | |
| # Get key at: https://www.cryptocompare.com/api/ | |
| CRYPTOCOMPARE_API_KEY=your_key_here | |
| # CoinGecko API (Pro tier for higher rates) | |
| # Get key at: https://www.coingecko.com/en/api | |
| COINGECKO_API_KEY=your_key_here | |
| # Binance API (Optional - for direct access) | |
| # Get key at: https://www.binance.com/en/my/settings/api-management | |
| BINANCE_API_KEY=your_key_here | |
| BINANCE_API_SECRET=your_secret_here | |
| # ============================================================================= | |
| # SECONDARY DATA PROVIDERS (Optional) | |
| # ============================================================================= | |
| # CoinDesk API Key (For Bitcoin Price Index) | |
| # Contact CoinDesk for API access | |
| COINDESK_API_KEY=313f415173eb92928568d91eee6fd91d0c7569a56a9c7579181b7a083a740318 | |
| # BSCScan API (For BNB data from Binance Smart Chain) | |
| # Get free key at: https://bscscan.com/apis | |
| # Note: Free tier has rate limits. Upgrade for production use. | |
| BSCSCAN_KEY=your_key_here | |
| # Tronscan API (For TRON network data) | |
| # Get key at: https://tronscan.org/ | |
| TRONSCAN_KEY=your_key_here | |
| # ============================================================================= | |
| # FALLBACK & BACKUP SERVICES | |
| # ============================================================================= | |
| # Render.com Backup Service (Ultimate fallback) | |
| RENDER_SERVICE_URL=https://crypto-dt-source.onrender.com | |
| # ============================================================================= | |
| # APPLICATION CONFIGURATION | |
| # ============================================================================= | |
| # Server Configuration | |
| HOST=0.0.0.0 | |
| PORT=7860 | |
| ENV=production | |
| # Logging Level (DEBUG, INFO, WARNING, ERROR) | |
| LOG_LEVEL=INFO | |
| # Rate Limiting | |
| RATE_LIMIT_ENABLED=true | |
| RATE_LIMIT_PER_MINUTE=60 | |
| # Cache Configuration | |
| CACHE_ENABLED=true | |
| CACHE_TTL_SECONDS=300 | |
| # ============================================================================= | |
| # NOTES | |
| # ============================================================================= | |
| # 1. API keys are OPTIONAL - the system works with fallback providers | |
| # 2. For production use, add real API keys to increase rate limits | |
| # 3. Never commit .env file to git (it's in .gitignore) | |
| # 4. BSCScan and Tronscan are supplementary - not required for core functionality | |
| # 5. CoinDesk API key included above is valid for BTC price data | |
| # ============================================================================= | |
| # FREE TIER LIMITS (Approximate) | |
| # ============================================================================= | |
| # CryptoCompare Free: 100,000 calls/month | |
| # CoinGecko Free: 10-50 calls/minute | |
| # Binance Public: No auth needed for public endpoints | |
| # BSCScan Free: 5 calls/second, 100,000 calls/day | |
| # Tronscan Free: Rate limits vary | |
| # ============================================================================= | |
| # PRODUCTION RECOMMENDATIONS | |
| # ============================================================================= | |
| # 1. Get API keys for ALL primary providers | |
| # 2. Monitor usage with provider health dashboard | |
| # 3. Set up alerts for rate limit warnings | |
| # 4. Use caching to reduce API calls | |
| # 5. Implement request queuing for high traffic | |