This guide explains how to configure API keys for Wealth Manager to enable real-time market data and currency conversion features.
Wealth Manager integrates with multiple APIs to provide real-time market data:
- Finnhub API: Global stock market data
- TWSE API: Taiwan stock exchange data
- ExchangeRate-API: Currency conversion rates
All API keys are stored securely on your device using Android Keystore encryption.
Purpose: Global stock market data for US and international stocks
Features:
- Real-time stock prices
- Company information
- Market data for global exchanges
Sign Up: Finnhub.io
- Free tier: 60 API calls/minute
- Paid plans available for higher limits
API Key Format: your_finnhub_key_here
Purpose: Taiwan stock exchange data
Features:
- Taiwan stock prices
- TWSE market data
- Taiwan company information
Sign Up: TWSE API
- Free tier available
- Registration required
API Key Format: your_twse_key_here
Purpose: Currency conversion rates (USD/TWD)
Features:
- Real-time exchange rates
- Historical rate data
- Multiple currency support
Sign Up: ExchangeRate-API
- Free tier: 1,500 requests/month
- Paid plans for higher limits
API Key Format: your_exchange_rate_key_here
- Open Wealth Manager
- Go to Settings → Manage API Keys
- Enter your API keys in the respective fields
- Click "Validate & Save"
- Keys are encrypted and stored securely
-
Configure Android SDK:
# Option 1: Set environment variable export ANDROID_HOME=/path/to/android/sdk # Option 2: Create local.properties (SDK path only) echo "sdk.dir=/path/to/android/sdk" > local.properties
-
API Keys: Configure through the app's settings interface - no build configuration needed.
-
Build and run:
./gradlew assembleDebug
Set environment variables in your CI/CD system:
API keys are now managed through the app's settings interface. No environment variables needed.
The app automatically validates API keys when you save them:
- Finnhub: Tests connection and retrieves sample data
- TWSE: Validates API key format and connection
- ExchangeRate-API: Tests currency conversion functionality
If API keys are invalid or missing:
- Warning messages will be displayed
- Market data features will be disabled
- App will continue to work with limited functionality
- Encrypted Storage: All API keys are encrypted using Android Keystore
- No Cloud Sync: Keys are stored locally only
- Secure Transmission: All API requests use HTTPS
- Key Rotation: Support for updating keys without app reinstall
- Open Settings → Manage API Keys
- Click "Test API Keys"
- Check the results:
- ✅ Green: API key is working
- ❌ Red: API key is invalid or expired
⚠️ Yellow: API key has limited functionality
Test each API individually:
# Test Finnhub API
curl "https://finnhub.io/api/v1/quote?symbol=AAPL&token=YOUR_FINNHUB_KEY"
# Test TWSE API
curl "https://www.twse.com.tw/exchangeReport/STOCK_DAY?response=json&date=20250101&stockNo=2330"
# Test ExchangeRate-API
curl "https://v6.exchangerate-api.com/v6/YOUR_EXCHANGE_RATE_KEY/latest/USD"Enable debug logging to troubleshoot API issues:
- Open Settings → Developer Options
- Enable "Debug Logging"
- Check logs in Android Studio or via ADB
Possible Causes:
- Incorrect API key format
- Expired API key
- API key not activated
Solutions:
- Verify API key format
- Check API key status on provider website
- Generate new API key if needed
Possible Causes:
- No internet connection
- API server down
- Firewall blocking requests
Solutions:
- Check internet connection
- Verify API server status
- Check firewall settings
Possible Causes:
- Too many API requests
- Free tier limits exceeded
Solutions:
- Wait for rate limit reset
- Upgrade to paid plan
- Reduce API request frequency
Check API status and limits:
- Finnhub: Status Page
- TWSE: TWSE Website
- ExchangeRate-API: Status Page
# Check API key configuration
adb shell dumpsys activity com.wealthmanager | grep API
# View network requests
adb logcat | grep "API_REQUEST"
# Check encrypted storage
adb shell run-as com.wealthmanager ls -la /data/data/com.wealthmanager/shared_prefs/| API | Free Tier | Paid Tier | Notes |
|---|---|---|---|
| Finnhub | 60 calls/min | 1000+ calls/min | Global stocks |
| TWSE | No limit | No limit | Taiwan stocks only |
| ExchangeRate-API | 1,500/month | 10,000+ calls/month | Currency rates |
- Cache Data: App caches API responses to reduce calls
- Batch Requests: Multiple requests are batched when possible
- Error Handling: Graceful degradation when APIs are unavailable
- Offline Support: Cached data available when offline
- No Personal Data: API keys are the only data sent to external services
- Local Storage: All market data is cached locally
- Encrypted Keys: API keys are encrypted using Android Keystore
- No Tracking: No user data is collected or shared
- Never share API keys publicly
- Use environment variables in development
- Rotate keys regularly for security
- Monitor usage for unusual activity
- HTTPS Only: All API requests use TLS 1.3
- Certificate Pinning: Validates API server certificates
- Request Encryption: Sensitive data encrypted in transit
- Local Storage: All data stored locally on device
- No Cloud Sync: No data transmitted to external servers
- Encrypted Database: Local database encrypted with Android Keystore
- GitHub Issues: Report Issues
- Documentation: README.md
- Security: SECURITY.md
Q: Do I need all three API keys? A: No, but having all three provides the best experience. You can use the app with just one API key.
Q: Are API keys stored securely? A: Yes, all API keys are encrypted using Android Keystore and stored locally on your device.
Q: What happens if I don't have API keys? A: The app will work with limited functionality. You won't have real-time market data.
Q: Can I change API keys later? A: Yes, you can update API keys anytime in Settings → Manage API Keys.
Last Updated: October 2025
Next Review: March 2025
For more information, see the Development Guide and Security Policy.