Skip to main content
This document describes the roof layout API used to generate a roof layout based on latitude and longitude coordinates. The API analyzes the roof geometry and returns data required to design and visualize solar panel installations and even more. The API returns structured data that includes:
  • Detected roof segments with boundary polygons
  • Roof orientation data, including tilt and azimuth
  • Candidate solar panel placements in portrait and landscape orientations
  • Rooftop obstacle detection to avoid blocked areas
  • Optional solar production metrics (flux values) for panel placement evaluation
  • Normalized coordinates for rendering the layout on top of the provided map imagery

Base URL

https://api.solargenix.ai

Authentication

All requests to the roof layout API require an access token. Send the token in the Token header:

Access Token Generation

Access tokens can be generated from the Developer page on the SolarGenix application website. Token issuance is managed in the SolarGenix interface and is not exposed as a public API endpoint.

Token generation flow

  1. Sign in to the SolarGenix interface.
  2. Open the Developer page.
  3. Select Generate Token.
  4. Copy the generated token and store it securely.
  5. Use the token in the Token request header for all public API calls.

Token handling requirements

  • Store tokens on your server side only.
  • Do not expose tokens in client-side JavaScript, mobile bundles, or public repositories.
  • Rotate the token immediately if it is exposed.
  • Use a different token for each environment when possible.

Endpoint

POST /v1/layout/

Generates a roof layout and candidate panel placements for the requested property. Full URL:

Request Headers

Request Body

Measurement Rules

  • When measurement_system is metric, all dimensional request values must be sent in meters.
  • When measurement_system is imperial, all dimensional request values must be sent in feet.
  • Use one system consistently for panel_size_w, panel_size_h, all setback values, and panel_spacing.

Request Example

JavaScript Example

Success Response

The API returns a JSON object containing the source image and all detected roof geometry required to render candidate panel placements.

Response Field Reference

Root Object

obstacles[]

roof_segments[]

roof_segments[].cycle[]

roof_segments[].panels_portrait[]

roof_segments[].panels_landscape[]

Coordinate System and Rendering Rules

The response uses normalized image coordinates for roof layout rendering.
  • x and y values are relative to the image and typically fall in the range 0.0 to 1.0.
  • panel_size is also normalized and must be converted before rendering.
  • cycle, obstacles, panels_portrait, and panels_landscape all use the same normalized coordinate system.

Pixel conversion

To draw the result on top of the returned map_image, convert coordinates using the final rendered image dimensions:

Important note

Do not treat response placement coordinates as raw pixels. They are normalized placement values intended to be scaled against the final image size.

Common Implementation Notes

  • Use panels_portrait when you want portrait panel candidate placement.
  • Use panels_landscape when you want landscape panel candidate placement.
  • Use flux to rank panel candidate placements when production scoring is enabled.
  • Use cycle to draw roof segments.
  • Use obstacles to block placements or visually mark non-usable rooftop areas.

HTTP Status Expectations

Example Error Responses

Missing or invalid token

Invalid request body

Layout could not be generated