# Quick Test Guide - Real Data Implementation ## ๐Ÿš€ Quick Start (30 seconds) ```bash # 1. Start the server python main.py # 2. In another terminal, test real data curl http://localhost:8000/api/market # 3. Check it's real (not mock) # Look for: "mode": "real" and "source": "CoinGecko" ``` ## โœ… What to Expect ### Real Data (Default) ```json { "mode": "real", "cryptocurrencies": [...], "source": "CoinGecko", "timestamp": "2025-01-15T10:30:00Z" } ``` ### Mock Data (if USE_MOCK_DATA=true) ```json { "mode": "mock", "cryptocurrencies": [...] } ``` ## ๐Ÿงช Full Test Suite ```bash python test_real_data.py ``` Expected: 4/5 tests pass (DeFi returns 503 as expected) ## ๐Ÿ“Š Test Each Endpoint ```bash # Market data curl http://localhost:8000/api/market # Historical data (after calling /api/market once) curl "http://localhost:8000/api/market/history?symbol=BTC&limit=5" # Sentiment curl http://localhost:8000/api/sentiment # Trending curl http://localhost:8000/api/trending # DeFi (returns 503 - not configured) curl http://localhost:8000/api/defi # Sentiment ML (returns 501 - not implemented) curl -X POST http://localhost:8000/api/hf/run-sentiment \ -H "Content-Type: application/json" \ -d '{"texts": ["test"]}' ``` ## ๐Ÿ” Verify Real Data ### Check 1: Mode Field ```bash curl http://localhost:8000/api/market | grep '"mode"' ``` Should show: `"mode": "real"` ### Check 2: Source Field ```bash curl http://localhost:8000/api/market | grep '"source"' ``` Should show: `"source": "CoinGecko"` ### Check 3: Timestamp ```bash curl http://localhost:8000/api/market | grep '"timestamp"' ``` Should show current time (not static) ### Check 4: Database Storage ```bash # Call market endpoint curl http://localhost:8000/api/market # Check history (should have records) curl "http://localhost:8000/api/market/history?symbol=BTC&limit=1" ``` Should return at least 1 record ## ๐ŸŽญ Test Mock Mode ```bash # Start in mock mode USE_MOCK_DATA=true python main.py # Test curl http://localhost:8000/api/market | grep '"mode"' ``` Should show: `"mode": "mock"` ## โŒ Common Issues ### "Provider not configured" **Fix**: Check `providers_config_extended.json` exists and has `coingecko` provider ### "Connection refused" **Fix**: Ensure server is running on port 8000 ### Still showing mock data **Fix**: ```bash # Check environment env | grep USE_MOCK_DATA # Should be empty or "false" # If "true", restart without it python main.py ``` ## ๐Ÿ“š Full Documentation - **Complete Guide**: `REAL_DATA_IMPLEMENTATION.md` - **Changes Summary**: `CHANGES_SUMMARY.md` - **API Docs**: http://localhost:8000/docs ## โœจ Success Indicators โœ… `"mode": "real"` in responses โœ… `"source": "CoinGecko"` or `"alternative.me"` โœ… Current timestamps (not static) โœ… Database history accumulates โœ… 503/501 errors for unimplemented (not mock data) **You're all set!** ๐ŸŽ‰