This Weather Dashboard supports real-time weather and air quality data from external APIs. Follow this guide to set up your API keys.
- Visit OpenWeatherMap
- Sign up for a free account
- Go to your API keys section
- Copy your API key
- Open
src-tauri/src/lib.rs - Find line 126:
let api_key = "YOUR_OPENWEATHER_API_KEY"; - Replace
"YOUR_OPENWEATHER_API_KEY"with your actual API key - Example:
let api_key = "abc123def456ghi789";
- The app will automatically try the real API first
- If the API key is not configured, it will fallback to mock data
- Check the browser console for any error messages
- Visit AirVisual (IQAir)
- Sign up for a free account
- Go to your API keys section
- Copy your API key
- Open
src-tauri/src/lib.rs - Find line 228:
let api_key = "YOUR_AIRVISUAL_API_KEY"; - Replace
"YOUR_AIRVISUAL_API_KEY"with your actual API key - Example:
let api_key = "xyz789uvw456rst123";
- ✅ Current weather conditions
- ✅ 5-day weather forecast
- ✅ Temperature, humidity, wind speed
- ✅ Weather descriptions and icons
- ✅ 1,000 API calls per day
- ✅ Air Quality Index (AQI)
- ✅ AQI categories and colors
- ✅ Basic pollutant estimates
- ✅ 10,000 API calls per month
Once configured, the app will:
- Try real APIs first - Fetch live data from OpenWeatherMap and AirVisual
- Fallback to mock data - If APIs fail or keys are missing
- Show error messages - If both real and mock data fail
- Never commit API keys to version control
- Keep your API keys private
- Monitor your API usage to avoid exceeding limits
- Consider using environment variables for production deployments
- "Please add your API key" - API key not configured
- "API error: 401" - Invalid API key
- "API error: 429" - Rate limit exceeded
- "Failed to fetch" - Network connectivity issue
- Verify your API key is correct
- Check your internet connection
- Wait if you've hit rate limits
- Use mock data for testing
- Weather: OpenWeatherMap (https://openweathermap.org/)
- Air Quality: AirVisual by IQAir (https://www.iqair.com/)
- Icons: OpenWeatherMap weather icons
- Fallback: Mock data for demo purposes
- Get your API keys from both services
- Update the Rust code with your keys
- Restart the application
- Enjoy real-time weather and air quality data!
Note: The app works perfectly with mock data for demonstration purposes. Real APIs are optional but provide live, accurate data.