GET /v1/sun-exposure
Terrain aspect and slope at a point, plus optional illumination against a given light source direction (sun or moon). Useful for photographers scouting golden hour light and for solar/snow-melt/vegetation exposure analysis.
Request
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
lat | float | yes | — | Latitude, −90..90. |
lng | float | yes | — | Longitude, −180..180. |
lightAzimuthDeg | float | no | — | Light source azimuth. 0 = N, clockwise, [0, 360). Must be given together with lightAltitudeDeg, or neither. |
lightAltitudeDeg | float | no | — | Light source altitude above the horizon, −90..90. Must be given together with lightAzimuthDeg, or neither. |
Providing only one of lightAzimuthDeg / lightAltitudeDeg returns 400 with incomplete_light_params. Omit both to get aspect_deg / slope_deg without illumination.
Examples
curl -H "X-API-Key: gi_live_..." \
"https://geoinsight.dev/v1/sun-exposure?lat=45.8326&lng=6.8652&lightAzimuthDeg=100&lightAltitudeDeg=8.5"
import requests
r = requests.get(
"https://geoinsight.dev/v1/sun-exposure",
params={"lat": 45.8326, "lng": 6.8652, "lightAzimuthDeg": 100, "lightAltitudeDeg": 8.5},
headers={"X-API-Key": "gi_live_..."},
)
print(r.json()["results"][0]["illumination"])
const res = await fetch(
"https://geoinsight.dev/v1/sun-exposure?lat=45.8326&lng=6.8652&lightAzimuthDeg=100&lightAltitudeDeg=8.5",
{ headers: { "X-API-Key": "gi_live_..." } },
);
const data = await res.json();
console.log(data.results[0].illumination);
Response
{
"results": [{
"lat": 45.8326,
"lng": 6.8652,
"aspect_deg": 92.4,
"slope_deg": 31.7,
"illumination": 0.6409
}],
"dataset": "copernicus-glo-30",
"resolution_m": 30
}
| Field | Type | Unit | Description |
|---|---|---|---|
results |
array | — | One entry per requested point, in input order. |
results[].lat |
number | deg | Latitude echoed back from the request. |
results[].lng |
number | deg | Longitude echoed back from the request. |
results[].aspect_deg |
number | deg | Compass direction the slope faces: 0 = north, increasing clockwise. null on flat terrain (no downhill direction) or on nodata. |
results[].slope_deg |
number | deg | Steepness from horizontal; 0 = flat, 90 = vertical. null on nodata. |
results[].illumination |
number | 0–1 | How directly the surface faces the given light: 0 = facing away or grazing, 1 = head-on. null when no light params were supplied, or on nodata. Local lighting only — see the note below. |
dataset |
string | — | Source dataset identifier. |
resolution_m |
integer | m | Ground sample distance. Aspect and slope are derived from neighbouring cells at this spacing, so they describe terrain at ~30 m scale, not individual boulders. |
Aspect, slope & illumination
aspect_deg— the compass direction the slope faces (0 = N, clockwise).nullon flat terrain (no defined downhill direction) or where elevation data is missing (nodata).slope_deg— steepness of the terrain, 0 = flat.nullwhere elevation data is missing (nodata).illumination— how directly the surface faces the given light source, from 0 (facing away / grazing) to 1 (directly facing).nullwhenlightAzimuthDeg/lightAltitudeDegwere not provided, or on nodata.illuminationreflects local light hitting the surface only — it does not account for occlusion by distant terrain (a ridge blocking the sun). Combine with/v1/visibilityto check whether the light source itself is above the local horizon.
Photographer's tip: golden hour
A slope with aspect_deg ≈ 90 (east-facing) catches direct light earliest, at sunrise / golden hour. A slope with aspect_deg ≈ 270 (west-facing) catches it last, at sunset / golden hour. Pair with /v1/horizon to find the exact azimuth and altitude the sun clears the local ridge.