# Solar API
## What It Does
The Solar API provides detailed solar potential analysis for any rooftop or land area using aerial imagery, sun position calculations, and shading models. Returns annual solar radiation, optimal panel placement, cost estimates, and carbon offset projections.
Uses computer vision to analyze Google's aerial imagery database, identifying roof segments, measuring area, detecting obstacles (trees, chimneys), and calculating sun exposure throughout the year.
## Music Use Case: Venue and Studio Power Planning
Understanding solar potential helps musicians and venues reduce energy costs and environmental impact:
**Recording studio energy independence:**
- Calculate rooftop solar potential for studios
- Estimate power generation for equipment (mixers, computers, air conditioning)
- Plan off-grid field recording equipment charging stations
- Document venue sustainability efforts for marketing
**Example:** El Pasaje Estudio Solar Analysis
```
Address: Av. Constitución 720, Tijuana
Roof area: 145 m²
Annual solar radiation: 1,875 kWh/m²/year
Recommended panel capacity: 12 kW
Annual generation: 18,500 kWh
Studio annual consumption: ~15,000 kWh
Result: 100%+ energy independence possible
Cost savings: $2,200/year (at Tijuana rates)
```
**Outdoor venue performance planning:**
- Analyze sun exposure patterns for outdoor stages
- Plan shade structures based on hourly solar data
- Schedule performances during lower sun intensity periods
- Design lighting to complement natural light (golden hour sets)
**Mobile recording rig sustainability:**
- Calculate solar panel size needed for field recording setup
- Map locations with good solar exposure for charging
- Plan multi-day recording expeditions with solar charging
## Environmental Research Use Case: Water Infrastructure Energy Optimization
Water and wastewater treatment are energy-intensive. Solar can significantly reduce operational costs:
**Treatment plant solar potential:**
- Analyze roofs of pump stations, treatment buildings, clarifiers
- Calculate solar array sizing for facility energy needs
- Identify land near facilities suitable for ground-mounted arrays
- Estimate carbon offset from renewable energy
**Example:** WWTP La Morita Energy Analysis
```
Facility: WWTP La Morita, Tijuana
Location: 32.4552°N, 116.8604°W
Annual consumption: 2.5 million kWh (pumps, aeration, treatment)
Available roof space: 3,200 m²
Solar potential: 380 kW capacity
Annual generation: 560,000 kWh (22% of total needs)
Cost savings: $65,000/year
ROI: 6.8 years
Carbon offset: 280 tons CO₂/year
```
**Remote monitoring station power:**
- Water quality sensors need continuous power
- Calculate solar+battery sizing for remote installations
- Plan sensor network deployment based on solar availability
- Reduce infrastructure costs (no grid connection needed)
**Pump station optimization:**
- Smaller distributed pump stations often have good solar access
- Calculate which stations are candidates for solar retrofits
- Prioritize based on energy consumption and roof quality
## How to Use It
### Direct API Call (No MCP Tool Available)
**Endpoint:** `https://solar.googleapis.com/v1/buildingInsights:findClosest`
**Get solar potential for an address:**
```bash
curl "https://solar.googleapis.com/v1/buildingInsights:findClosest?location.latitude=32.5336&location.longitude=-117.0382&key=YOUR_API_KEY"
```
**Get solar potential by coordinates:**
```json
{
"location": {
"latitude": 32.4552,
"longitude": -116.8604
}
}
```
**Response includes:**
- `solarPotential` - Annual kWh production potential
- `roofSegmentStats` - Individual roof sections with sun exposure
- `panelCapacityWatts` - Recommended installation size
- `maxArrayAreaMeters2` - Usable roof area
- `carbonOffsetFactorKgPerMwh` - Environmental impact
- `financialAnalyses` - Cost, savings, payback period
### Advanced Options
**Custom panel configuration:**
```json
{
"location": {"latitude": 32.4552, "longitude": -116.8604},
"requiredQuality": "HIGH",
"panelCapacityWatts": 400,
"panelLifetimeYears": 25,
"dcToAcDerate": 0.85,
"azimuthTolerance": 10,
"pitchTolerance": 10
}
```
## Response Structure
```json
{
"name": "building/ChIJ...",
"center": {"latitude": 32.4552, "longitude": -116.8604},
"imageryDate": {"year": 2024, "month": 6, "day": 15},
"solarPotential": {
"maxArrayPanelsCount": 48,
"maxArrayAreaMeters2": 78.5,
"maxSunshineHoursPerYear": 2890,
"carbonOffsetFactorKgPerMwh": 450,
"wholeRoofStats": {
"areaMeters2": 145,
"sunshineQuantiles": [0, 1200, 1400, 1600, 1875],
"groundAreaMeters2": 145
},
"roofSegmentStats": [
{
"pitchDegrees": 18,
"azimuthDegrees": 180,
"stats": {
"areaMeters2": 78.5,
"sunshineQuantiles": [1750, 1800, 1850, 1875, 1900]
},
"center": {"latitude": 32.4552, "longitude": -116.8604}
}
],
"financialAnalyses": [{
"monthlyBill": {"units": 1250},
"panelConfigIndex": 0,
"financialDetails": {
"costOfElectricityWithoutSolar": 30000,
"netMeteringAllowed": true,
"solarPercentage": 95,
"lifetimeSrecTotal": 0,
"upfrontCost": 18000,
"utilityDiscountRate": 0.05,
"solarDiscountRate": 0.05,
"savingsYear1": 2200,
"savingsYear20": 48000,
"breakEvenYear": 7
}
}]
}
}
```
## How It Works
**Computer vision analysis:**
1. Aerial imagery (Google Earth imagery, 15-30cm resolution)
2. 3D building models (roof pitch, orientation)
3. Obstacle detection (trees, chimneys, nearby buildings)
4. Shadow modeling (hourly sun position throughout year)
**Solar radiation calculation:**
- Sun position at location for every hour of the year
- Cloud cover statistics from historical weather data
- Atmospheric effects (elevation, latitude, air quality)
- Panel efficiency assumptions (temperature derating, soiling)
**Coverage:** Available in many regions with high-quality aerial imagery. Check coverage at specific location before building applications.
## When to Use It
**Music/Audio projects:**
- Studio energy audits and sustainability planning
- Outdoor venue sun exposure analysis
- Mobile recording rig solar sizing
- Venue marketing (solar-powered performance spaces)
**Environmental research:**
- Water treatment facility energy optimization
- Remote sensor station power planning
- Pump station retrofit prioritization
- Municipal sustainability assessments
**Don't use it for:**
- Ground-mounted arrays larger than building footprint (API focuses on rooftops)
- Areas without high-quality aerial imagery
- Rapidly changing building conditions (imagery may be 1-2 years old)
## Pro Tips
**Check imagery date:** Look at `imageryDate` in response. Recent construction may not be reflected. Verify with Street View API.
**Consider noise:** For recording studios, solar panel inverters can produce high-frequency buzz. Plan inverter location away from recording spaces.
**Combine with building details:** Use Places API to get building information, then analyze solar potential. Cross-reference with property records for ownership.
**Seasonal performance varies:** Annual kWh is useful, but check `sunshineQuantiles` to understand monthly variation. June ≠ December production.
**Financial analysis is US-focused:** Cost estimates assume US electricity rates and incentives. Adjust for Tijuana or other international locations using local utility rates.
## Real-World Integration Example
**Tijuana music venue solar survey:**
```javascript
// Pseudo-code workflow
venues = getMusicVenues("Tijuana, Mexico") // Places API
for each venue:
solar_data = getSolarPotential(venue.coords)
if solar_data.roofArea > 50 AND solar_data.annualKwh > 10000:
report({
name: venue.name,
address: venue.address,
potential: solar_data.annualKwh + " kWh/year",
panels: solar_data.panelCount,
cost_savings: estimateSavings(solar_data, tijuanaRates),
priority: "high"
})
```
## Related APIs
- [[Weather API]] - Cloud cover affects solar generation
- [[Maps Datasets API]] - Overlay solar potential on custom maps
- [[Aerial View API]] - Cinematic visualization of roof installations
- [[Places API]] - Identify buildings for solar analysis
## Resources
- [Solar API Documentation](https://developers.google.com/maps/documentation/solar)
- Understanding solar radiation and kWh calculations
- Panel sizing and financial analysis methodology