Agent-first, machine-readable weather model data access via GRIB2 byte-range fetching.
High-performance API for accessing numerical weather prediction models (HRRR, RAP, GFS, NAM, GEFS) with:
- ⚡ Efficient byte-range GRIB2 access via IDX files
- 🤖 Agent-optimized with comprehensive grounding/provenance
- � Intelligent weather scanning - Automatically finds interesting weather patterns across CONUS
- 📊 Multi-model synthesis (near/short/long term forecasts)
- 🔬 Meteorological analysis (soundings, severe weather, hodographs, ensemble stats)
- 🌍 Synoptic pattern detection (ridges, troughs, jets, fronts)
- 📡 Real-time ingestion monitoring with NCEP-observed latencies
📚 View Complete Documentation | 👤 Human Guide | 🤖 AI Agent Guide
This API is designed specifically for AI agents (particularly OpenClaw) to efficiently process and communicate weather model data.
- Interest-driven scanning -
/scan/synoptic-patternsautomatically finds noteworthy weather across CONUS (severe wx, heavy precip, winter wx, fire wx, tropical, etc.) - Efficient JSON - All responses optimized for programmatic parsing
- Progressive detail - Scan broadly → prioritize by
interest_level→ drill down with specialized endpoints - Grounding metadata - Every response includes model/cycle/valid_time for transparency
- Scan -
GET /scan/synoptic-patternsto find interesting weather nationwide - Prioritize - Focus on areas with
interest_level: "high" - Analyze - Use specialized endpoints for details:
/analysis/severe-wx- Severe weather parameters (STP, SCP, EHI, shear, storm motion)/analysis/hodograph- Wind profile for storm motion analysis/analysis/sounding- Full atmospheric profile/ensemble/stats- Forecast uncertainty quantification
- Communicate - Present findings with appropriate detail level
# Create virtual environment
python -m venv .venv
.venv\\Scripts\\activate # Windows
# source .venv/bin/activate # Linux/Mac
# Install dependencies
pip install -r requirements.txt
# Install package in editable mode
pip install -e .The API works fully without ecCodes using high-quality synthetic data. To use real NOMADS GRIB2 data:
Windows (Choose One):
Option 1: Install Miniconda (Recommended)
# 1. Download Miniconda from https://docs.conda.io/en/latest/miniconda.html
# 2. Install it, then run:
conda install -c conda-forge eccodes
python -c "import cfgrib; print('✅ ecCodes working')"Option 2: Use WSL (Windows Subsystem for Linux)
# If you have WSL installed:
wsl
sudo apt-get update
sudo apt-get install libeccodes-dev
pip install --force-reinstall cfgribOption 3: Use Synthetic Data (No Installation)
- API is fully functional without ecCodes
- Returns high-quality synthetic weather data
- Perfect for development, testing, and many production use cases
- Check
grounding.data_sourcefield - shows"synthetic_fallback"
Linux (Ubuntu/Debian):
sudo apt-get install libeccodes-dev
pip install --force-reinstall cfgribLinux (RHEL/CentOS):
sudo yum install eccodes eccodes-devel
pip install --force-reinstall cfgribmacOS:
brew install eccodes
pip install --force-reinstall cfgrib# Development server with auto-reload
uvicorn app.main:app --reload --port 8000
# Production server
uvicorn app.main:app --host 0.0.0.0 --port 8000 --workers 4pytest -v # Verbose output
pytest -q # Quiet mode
pytest --cov=app # With coverageChoose the guide that fits your needs:
-
📖 Documentation Index - Start here to navigate all documentation
-
👤 Human User Guide - For developers using the API directly
- Getting started tutorial
- Endpoint reference with examples
- Meteorological concepts explained
- Common workflows (storm chasing, winter weather, etc.)
- Troubleshooting guide
-
🤖 AI Agent Usage Guide - For building AI weather agents
- Optimized scan → prioritize → analyze → communicate workflow
- Complete code examples with decision trees
- Communication templates
- Error handling and performance optimization
-
🔬 Meteorological Enhancements - Technical deep-dive
- Severe weather parameters (STP, SCP, EHI) explained
- Hodograph analysis and storm motion
- Ensemble statistics interpretation
-
📊 Workflow Diagrams - Visual guides
- ASCII diagrams of API workflows
- Data flow architecture
- Decision trees
-
GET /v1/forecast/point- Point forecast with auto-model selection- Parameters:
lat,lon,model,cycle,f_hour,units - Auto-selects: RAP (<1h), HRRR (1-18h), GFS (18h+)
- Parameters:
-
GET /v1/forecast/summary/{lat}/{lon}- Multi-model summary- Returns: near (RAP@0h), short (HRRR@6h), long (GFS@48h)
-
GET /v1/system/status- Model ingestion status- Real-time data availability based on NCEP observations
- Latencies: RAP (27min), HRRR (47min), NAM (1.5h), GFS (3.5h), GEFS (4.5h)
-
GET /v1/system/health- Service health check -
GET /v1/system/metrics- Prometheus metrics
-
GET /v1/analysis/sounding- Vertical atmospheric profile- Returns: Temperature, dewpoint, wind at standard levels (1000-200mb)
- Includes: CAPE, CIN, LCL, LFC stability indices
-
GET /v1/analysis/severe-wx- Comprehensive severe weather diagnostics- Parameters: STP (Significant Tornado Parameter), SCP (Supercell Composite), EHI (Energy Helicity Index)
- Shear: Bulk shear at 0-1km, 0-3km, 0-6km levels
- Storm motion: Bunkers right/left vectors, mean wind
- Interpretation: Tornado threat level (low/moderate/high), supercell potential
- Use case: AI can identify tornado/supercell threats from scan, then get detailed parameters here
-
GET /v1/analysis/hodograph- Wind profile for storm motion analysis (SounderPy-like)- Returns: u/v wind components at 11 height levels (0-10km AGL)
- Use case: Plot hodograph, analyze wind shear, determine storm motion
- Interpretation: Hodograph curvature, low-level turning, shear vectors
-
GET /v1/analysis/precip-type- Precipitation type determination- Uses: 1000-500mb thickness + wet-bulb temperature
- Returns: Rain, Snow, Sleet, Freezing Rain, or Mixed
-
GET /v1/analysis/compare- Model run comparison- Modes:
model_difforcycle_diff - Returns: Agreement metrics, max differences, sample points
- Modes:
GET /v1/ensemble/stats- GEFS ensemble statistics (31 members)- Returns: Mean, median, std dev, min, max
- Probabilities: Threshold exceedance (e.g., below freezing)
- Spread assessment: Low/moderate/high confidence categories
- Use case: Quantify forecast uncertainty for 3-10 day forecasts
-
GET /v1/scan/synoptic-patterns- Comprehensive CONUS weather scan ("Interesting Weather Finder")- Purpose: AI agent's starting point - scans entire CONUS for meteorologically interesting patterns
- Returns 7 categories:
synoptic_features- Ridges, troughs, jet streaks with 4-quadrant forcing, frontsheavy_precipitation- Significant rainfall (>0.5 in/hr) or snowfall (>1 in/hr) areassevere_weather- Tornado risk (STP), supercell potential (SCP), damaging windswinter_weather- Heavy snow, ice accumulation, extreme coldfire_weather- Critical fire conditions (high winds + low RH)tropical- Development potential in Atlantic/Caribbeantemperature_extremes- Extreme heat or cold events
- Each area includes:
interest_level: "high", "moderate", "low" (for AI prioritization)centroidorbbox: Location for follow-up queriesdescription: Human-readable context
- AI workflow: Scan → filter by interest_level → drill down with analysis endpoints
-
POST /v1/scan/anomalies- Enqueue anomaly detection job- Returns: Job ID and status URL
-
GET /v1/scan/jobs/{job_id}- Job status polling- Status: queued → running → finished
-
GET /v1/data/grib- NOMADS/AWS GRIB2 URLs- Supports: HTTP byte-range via IDX files
- Models: HRRR, RAP, GFS, NAM
-
GET /v1/metadata/variables- Variable catalog- Returns: Units, descriptions, GRIB2 parameter names
GET /v1/openapi.yaml- OpenAPI 3.0.3 specificationGET /v1/agent-manifest- Agent discovery manifest
The API provides efficient byte-range access to GRIB2 files:
import httpx
# 1. Get GRIB URLs
response = httpx.get("http://localhost:8000/v1/data/grib",
params={"model": "HRRR", "cycle": "12Z", "f_hour": 6})
urls = response.json()
# 2. Fetch IDX file to find variable offset
idx_text = httpx.get(urls["idx_url"]).text
# 3. Parse IDX for specific variable (e.g., temperature)
for line in idx_text.splitlines():
if "TMP:2 m" in line:
parts = line.split(":")
start_byte = int(parts[1])
# Calculate end_byte from next line...
break
# 4. Fetch only that variable using Range header
headers = {"Range": f"bytes={start_byte}-{end_byte}"}
grib_data = httpx.get(urls["grib_url"], headers=headers).content
# 5. Parse with cfgrib/xarray (when installed)
# import xarray as xr
# ds = xr.open_dataset(BytesIO(grib_data), engine='cfgrib')Agent/Client Request
↓
FastAPI Endpoint (app/main.py)
↓
Weather Module (app/weather.py)
↓
GRIB2 Fetching (fetch_grib_section)
↓
├→ IDX File Parsing (parse_idx_for_variable)
├→ HTTP Range Request
└→ GRIB2 Byte Section
↓
Response with Grounding Metadata
app/main.py- FastAPI application with all endpointsapp/weather.py- GRIB2 data fetching and meteorological analysisdocs/openapi.yaml- Comprehensive OpenAPI 3.0.3 specagent-manifest.json- Machine-readable endpoint catalogtests/test_endpoints.py- Full endpoint integration tests
For AI agents, the API provides:
- Discovery: Start with
/agent-manifestfor endpoint catalog - Grounding: All responses include provenance metadata
- Error Handling: RFC 7807 problem details format
- Documentation: Machine-readable OpenAPI spec
See docs/agent_integration.md for detailed workflows.
- ✅ All 14+ endpoint implementations with realistic data
- ✅ GRIB2 byte-range fetching infrastructure
- ✅ Multi-model forecast synthesis (RAP/HRRR/GFS tiering)
- ✅ Meteorological analysis endpoints
- ✅ Comprehensive OpenAPI 3.0.3 documentation
- ✅ Real-time ingestion status (NCEP-observed latencies)
- ✅ Full test coverage (7 passing tests)
- ⏳ Real GRIB2 parsing with cfgrib/xarray
- ⏳ Authentication and rate limiting
- ⏳ Job queue workers for async processing
- ⏳ Docker containerization
- ⏳ CI/CD workflow
- ⏳ Python SDK generation
- ⏳ Prompt templates for agents
- FastAPI 0.128.7 - Modern async web framework
- Pydantic 2.12.5 - Data validation
- httpx 0.28.1 - HTTP client for GRIB2 fetching
- pytest 9.0.2 - Testing framework
- cfgrib (planned) - GRIB2 parsing
- xarray (planned) - Scientific data arrays
MIT License - See LICENSE file for details
- Documentation:
docs/directory - Issues: GitHub Issues
- API Spec:
http://localhost:8000/v1/openapi.yaml