File size: 3,475 Bytes
3ae846b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# 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