Solar API Overview¶
The Solar API provides endpoints for solar resource assessment, system optimization, power prediction, and report generation.
Base URL¶
Endpoints¶
| Endpoint | Method | Description |
|---|---|---|
/health |
GET | Service health status |
/resource |
POST | Get solar irradiance data |
/predict |
POST | ML-based power prediction |
/optimization/quick |
POST | Instant optimization |
/optimization/run |
POST | Full optimization job |
/optimization/multi |
POST | Multi-objective (Pareto) |
/optimization/{job_id} |
GET | Get job results |
/assess |
POST | Site assessment |
/report |
POST | Generate PDF report |
Health Check¶
Check if the Solar API is operational:
Response:
Common Request Structure¶
Most endpoints accept a site object:
Site Parameters¶
| Field | Type | Required | Description |
|---|---|---|---|
latitude |
float | Yes | Latitude (-90 to 90) |
longitude |
float | Yes | Longitude (-180 to 180) |
capacity_kw |
float | Yes | System DC capacity in kW |
land_area_ha |
float | No | Available land in hectares |
Common Response Structure¶
Optimal Parameters¶
| Parameter | Description | Unit |
|---|---|---|
tilt |
Panel tilt from horizontal | degrees |
azimuth |
Panel orientation (180=south) | degrees |
dc_ac_ratio |
DC/AC capacity ratio | ratio |
gcr |
Ground coverage ratio | ratio |
Energy Metrics¶
{
"energy_metrics": {
"annual_energy_mwh": 1850.5,
"capacity_factor": 0.211,
"specific_yield": 1850.5,
"performance_ratio": 0.82
}
}
| Metric | Description | Unit |
|---|---|---|
annual_energy_mwh |
Yearly AC energy | MWh |
capacity_factor |
Actual/theoretical output | ratio |
specific_yield |
Energy per kWp | kWh/kWp |
performance_ratio |
System efficiency | ratio |
Financial Metrics¶
{
"financial_metrics": {
"lcoe_cents_per_kwh": 3.45,
"npv_dollars": 1250000,
"irr_percent": 14.5,
"payback_years": 6.2,
"total_capex": 850000
}
}
| Metric | Description | Unit |
|---|---|---|
lcoe_cents_per_kwh |
Levelized cost of energy | ยข/kWh |
npv_dollars |
Net present value | USD |
irr_percent |
Internal rate of return | % |
payback_years |
Simple payback period | years |
total_capex |
Capital expenditure | USD |
Error Handling¶
All errors follow a consistent format:
{
"error": "validation_error",
"message": "latitude must be between -90 and 90",
"field": "latitude"
}
See Error Codes for a complete list.
Data Sources¶
- Solar Irradiance: NASA POWER (satellite-derived)
- Temperature: NASA POWER MERRA-2
- Financial Assumptions: Industry standard defaults (customizable)