This document describes the Level 2 Enterprise Features successfully implemented in IntelliWeather API v3.0.0. All features are production-ready and fully functional.
Endpoints:
GET /api/v3/pollen/current- Current pollen levels and allergy riskGET /api/v3/pollen/forecast- 7-day pollen forecastGET /api/v3/pollen/trends- Historical trends and seasonal analysis
Data Provided:
- Tree pollen breakdown (Alder, Birch, Olive)
- Grass pollen levels
- Weed pollen breakdown (Mugwort, Ragweed)
- Overall pollen score (0-100)
- Allergy risk assessment (minimal/low/moderate/high/extreme)
- Activity recommendations
- Health precautions
Example Request:
curl "http://localhost:8000/api/v3/pollen/current?latitude=40.71&longitude=-74.01"Data Source: Open-Meteo Air Quality API
Endpoints:
GET /api/v3/solar/current- Current solar conditions and PV estimatesGET /api/v3/solar/forecast- Solar forecast (up to 7 days)GET /api/v3/solar/analysis- Daily/hourly solar analysis
Data Provided:
- Sun position (azimuth, elevation, zenith angle)
- Solar irradiance (GHI, DNI, DHI in W/m²)
- PV yield estimates (W/m² and kWh/m²/day)
- Solar potential scoring (excellent/good/fair/poor)
- System efficiency factors
- Daylight information (sunrise, sunset, solar noon)
Example Request:
curl "http://localhost:8000/api/v3/solar/current?latitude=40.71&longitude=-74.01"Data Source: Open-Meteo Forecast API + Solar calculations
Use Cases:
- Solar panel performance estimation
- Energy production forecasting
- Solar installation planning
- Smart home energy optimization
Endpoints:
GET /api/v3/air-quality/current- Detailed current air qualityGET /api/v3/air-quality/forecast- Air quality forecastGET /api/v3/air-quality/pollutant/{name}- Single pollutant detailsGET /api/v3/air-quality/health- Health recommendations
Pollutants Tracked:
- PM2.5 (Fine Particulate Matter)
- PM10 (Coarse Particulate Matter)
- NO₂ (Nitrogen Dioxide)
- O₃ (Ozone)
- SO₂ (Sulfur Dioxide)
- CO (Carbon Monoxide)
Data Provided:
- US EPA AQI (0-500 scale)
- European Air Quality Index (1-5 scale)
- Individual pollutant concentrations (µg/m³ or ppm)
- Health impact information
- Dominant pollutant identification
- Activity recommendations by sensitivity group
Example Request:
curl "http://localhost:8000/api/v3/air-quality/current?latitude=40.71&longitude=-74.01"Data Source: Open-Meteo Air Quality API
Sensitivity Groups:
- General population
- Sensitive groups (children, elderly, respiratory/cardiac patients)
Endpoints:
GET /api/v3/marine/current- Current marine conditionsGET /api/v3/marine/forecast- Marine weather forecastGET /api/v3/marine/tides- Tide predictionsGET /api/v3/marine/health- Marine safety assessment
Data Provided:
- Wave height (m) and period (s)
- Wave direction (degrees)
- Swell characteristics
- Sea surface temperature (°C)
- Ocean current data
- Tide times and heights
- Marine safety conditions
Example Request:
curl "http://localhost:8000/api/v3/marine/current?latitude=40.71&longitude=-74.01"Data Source: Open-Meteo Marine API
Use Cases:
- Sailing and boating
- Surfing conditions
- Fishing planning
- Coastal safety
- Maritime operations
All Level 2 features are integrated into the enhanced dashboard at /:
- Pollen Tab - Interactive pollen level cards with visual indicators
- Solar Tab - Solar potential gauge and PV yield estimates
- AQI Extended Tab - Detailed pollutant breakdown with health impacts
- Marine Tab - Wave and tide information (when available)
The dashboard features:
- Tabbed interface for organized data display
- Real-time updates using geolocation
- Responsive grid layouts
- Color-coded severity indicators
- Scrollable sections for extensive data
modules/
├── pollen.py # Pollen data fetching and calculation (563 lines)
├── solar.py # Solar position and PV estimation
├── air_quality.py # Extended AQI calculations
└── marine.py # Marine conditions processing
routes/
├── pollen.py # Pollen API endpoints
├── solar.py # Solar API endpoints
├── air_quality.py # Air quality API endpoints
└── marine.py # Marine API endpoints
- FastAPI - Modern async web framework
- Open-Meteo APIs - Free weather data source (no API key required)
- In-memory caching - TTL-based cache for API responses
- Starlette middleware - Session management and rate limiting
- ✅ Response caching (60-minute TTL)
- ✅ Rate limiting (60 requests/minute per IP)
- ✅ Async/await for concurrent requests
- ✅ Efficient data transformation
- ✅ Fallback handling for unavailable data
All Level 2 endpoints follow a consistent response structure:
{
"status": "success",
"latitude": 40.71,
"longitude": -74.01,
"timestamp": "2025-11-30T22:00:00Z",
"data_field_name": {
// Feature-specific data
}
}Status Values:
success- Data retrieved successfullyunavailable- Data temporarily unavailable (e.g., nighttime solar data)error- An error occurred
Error Responses:
{
"status": "error",
"message": "Detailed error description",
"latitude": 40.71,
"longitude": -74.01
}Development:
./start_server.shOr manually:
python -m uvicorn app:app --host 0.0.0.0 --port 8000 --reloadProduction:
python -m uvicorn app:app --host 0.0.0.0 --port 8000 --workers 4python app.py directly. The middleware stack (session management, rate limiting) only initializes during ASGI application startup, which requires uvicorn.
No additional environment variables needed for Level 2 features. All use the Open-Meteo free tier API (no API key required).
# Test all Level 2 endpoints
curl "http://localhost:8000/api/v3/pollen/current?latitude=40.71&longitude=-74.01"
curl "http://localhost:8000/api/v3/solar/current?latitude=40.71&longitude=-74.01"
curl "http://localhost:8000/api/v3/air-quality/current?latitude=40.71&longitude=-74.01"
curl "http://localhost:8000/api/v3/marine/current?latitude=40.71&longitude=-74.01"curl "http://localhost:8000/healthz"Planned features for the next phase:
-
Agriculture Weather API
- Frost risk prediction
- Growing degree days
- Crop-specific weather
- Soil moisture estimates
-
Aviation Weather API
- METAR/TAF integration
- Turbulence forecasts
- Icing conditions
- Cloud ceiling data
-
Sports & Recreation API
- Running weather index
- Cycling conditions
- Golf weather score
- Event weather suitability
See future_build.md for detailed specifications.
- Weather Data: Open-Meteo (https://open-meteo.com/)
- Framework: FastAPI (https://fastapi.tiangolo.com/)
- Developer: IntelliWeather Development Team
✅ Added:
- Pollen Forecast API with allergy risk assessment
- Solar & Energy Weather API with PV estimates
- Extended Air Quality API (AQI V2) with 6 pollutants
- Marine & Coastal Weather API
- Enhanced dashboard with tabbed interface
- Comprehensive health recommendations
- Activity suggestions based on conditions
✅ Fixed:
- Session middleware initialization (must use uvicorn)
- Middleware registration order
- API route organization
✅ Improved:
- Dashboard UI with scrollable sections
- Error handling for unavailable data
- Response caching for all endpoints
- Documentation and examples
Status: ✅ Production Ready
Version: 3.0.0
Last Updated: 2025-11-30