---
title: "Analyze Solar Potential and Roof — AI Analysis API"
description: "Return solar generation potential for a US property alongside an AI roof-condition assessment covering usable roof area, orientation, and shading. 4 credits."
---

# Solar potential + AI roof condition for a property

`GET /api/solar/analysis/`

4 credits

## What it returns

Two coupled analyses in one call:

1. **Solar Potential** — 20-year cost projection, payback timeline, energy coverage percentage, federal/state incentive estimate.
2. **Roof Condition** — AI roof condition score (0-10), condition category, material identification, damage indicators, and risk assessment, from AI analysis of aerial imagery.

## When to use it

- Pre-screen properties for solar installation viability.
- Underwrite roof replacement cost for an investor offer.
- Add a solar-readiness flag to a property report.

## Performance

**This is an expensive, slow endpoint — use a 90-second client timeout and cache responses.**

## Response shape

The response shape varies with the optional query parameters:

- `detailed=true` — adds the raw `solar_potential.data` blob and includes both `roof_image_url` and `roof_image_base64` in `roof_condition.imagery`.
- `agent=false` — sets `roof_condition.analysis` to `null` (skips the AI roof analysis).

If the roof image fails to upload to storage, `roof_condition.imagery` contains `roof_image_base64` (raw base64 PNG) instead of `roof_image_url`. Individual entries in `solar_layers` may be missing if a particular data layer was unavailable for the address.

## FAQ

### Why is `agent=true` the default?
Without it, the roof condition section is skipped (you get solar potential only). The AI roof analysis is the expensive part but it's what makes the endpoint useful — leave it on unless you specifically need solar-only.

### What if the building isn't covered?
Returns a clear error indicating imagery unavailable. Charges 0 credits in that case.
