Skip to content
GET /v1/shadow-length

Shadow length from height and sun

Try it live

10 free calls per day — no sign-up, no API key. Goes through the oanor gateway.

Custom headers (optional)
api.oanor.com/pvspacing-api

It works. Grab an API key and use it in your project.

Get an API key

Code snippets

curl "https://api.oanor.com/pvspacing-api/v1/shadow-length" \
  -H "x-oanor-key: oanor_test_..."
await fetch("https://api.oanor.com/pvspacing-api/v1/shadow-length", {
  headers: { "x-oanor-key": "oanor_test_..." }
});
$ch = curl_init("https://api.oanor.com/pvspacing-api/v1/shadow-length");
curl_setopt($ch, CURLOPT_HTTPHEADER, ["x-oanor-key: oanor_test_..."]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$out = curl_exec($ch);
import requests
requests.get(
    "https://api.oanor.com/pvspacing-api/v1/shadow-length",
    headers={"x-oanor-key": "oanor_test_..."}
)

Example response

A real response from this endpoint, captured by the latest health check.

{
    "data": {
        "note": "Shadow length = object height ÷ tan(sun elevation). The lower the sun, the longer the shadow — which is why solar layouts are designed for the worst case, the winter-solstice low sun. When the sun is not square to the rows, the shadow cast across the row direction stretches by 1/cos(azimuth difference), so off-noon and off-south the shading reaches further.",
        "inputs": {
            "object_height_m": 0.85,
            "sun_elevation_deg": 20,
            "azimuth_difference_deg": 0
        },
        "shadow_length_m": 2.335
    },
    "meta": {
        "timestamp": "2026-06-07T08:17:56.739Z",
        "request_id": "47f8688d-e22c-430d-a2f5-82c3e711de7b"
    },
    "status": "ok",
    "message": "Shadow length",
    "success": true
}