Sun Position API

GET

Calculate exact sun angles and compass bearings for any location.

Sun Position calculates solar altitude, azimuth, and compass bearings for any geographic coordinates and time. Provide latitude and longitude to read sun elevation angles and daylight status; paid plans add panel aiming angles and shadow ratios.

Try it — live request, no key required

Request
GETapi.apiverve.com/v1/sunposition?lat=37.7749&lon=-122.4194
Query parameters
Verification
Format

No key required to try it. Get a key to use it in your app.

Example
{
  "status": "ok",
  "error": null,
  "data": {
    "date": "01-16-2026",
    "time": "14:30",
    "timezone": "America/Los_Angeles",
    "timestampUTC": "2026-01-16T22:30:00.000Z",
    "coordinates": {
      "latitude": 37.7749,
      "longitude": -122.4194
    },
    "sun": {
      "altitude": 0.41616137328975444,
      "azimuth": 0.5817558808515568,
      "altitudeDegrees": 23.844,
      "azimuthDegrees": 33.332,
      "compassBearing": 213.332,
      "isDaylight": true,
      "declination": -20.7961,
      "rightAscension": 19.9228,
      "hourAngle": 2.174,
      "distance": 0.983786
    },
    "equationOfTime": -9.88,
    "airMass": 2.454,
    "clearSky": {
      "directNormal": 702.4,
      "globalHorizontal": 284.9
    },
    "shadowRatio": 2.254,
    "panelAim": {
      "tilt": 66.07,
      "azimuth": 213.44
    }
  }
}

About the Sun Position API

Sun Position works by analyzing the location provided and calculating sun position data. It uses advanced algorithms to calculate data such as altitude, azimuth, and distance of the sun from the location and returns the sun position data.

What people use it for

Golden Hour Photo Planning
To help photographers capture natural light, mobile photography guides check solar altitude and compass bearings to forecast golden hour windows.
Smart Blind Automation
Lower automated window shades when incoming sun altitude and bearing show direct glare striking specific building facades.
Architectural Glare Analysis
Building design software computes sun elevation angles across the day to evaluate interior daylighting and orient office windows.
Athletic Field Orientation
When setting up temporary sports pitches, venue managers check compass bearings to align player sightlines away from the setting sun.

Ways to call it

One endpoint, many ways in — REST with JSON, XML, YAML and CSV, plus GraphQL and an MCP interface for AI agents.

JSON
Default REST response
XML
Markup format
YAML
Human-readable
CSV
Tabular export
Beta
GraphQL
Query language
New
MCP
For AI agents

Other ways to use Sun Position

Same data, same APIVerve account, same credit balance — one key works on all of them.

Questions.

Common questions about the Sun Position API.

Read the docs →
Can I query sun position for any date and timezone worldwide?
Yes. You can supply any global latitude and longitude alongside a specific date and time in 24-hour format. If you do not provide a timezone, the API automatically resolves the local IANA timezone from the coordinates. Note that calculating positions for dates other than today requires a paid plan.
Is it cheap enough to calculate sun positions for every user request?
Yes. Each lookup costs 2 credits, allowing the Starter plan to handle 100,000 calculations every month. That works out to about $0.30 per 1,000 calls, or roughly $0.0003 per call. You can also test queries on the Free plan, which provides 100 calculations per month.
Are solar panel aiming angles and shadow ratios included on the Free plan?
No, those are premium fields that require a paid plan. The Free plan returns basic altitude, azimuth, compass bearing, and daylight status for the current date. Solar panel tilt and azimuth, shadow ratio, atmospheric air mass, clear-sky irradiance estimates, and custom query dates are available on Starter and higher plans.
What happens to the calculation when the sun is below the horizon?
When the sun is below the horizon, the daylight indicator is set to false and the altitude values become negative. On paid plans, fields that require direct sunlight—including solar panel aim angles, shadow ratio, clear-sky irradiance, and atmospheric air mass—return as null.
Can I use the sun position calculations in a commercial solar or photography app?
Yes, provided you are on a paid plan. The Free plan is limited to non-commercial evaluation. You can display the sun positions, angles, and solar estimates directly in your product, but you may not resell or redistribute the raw calculation data as a standalone service.

Ready to build with Sun Position? Start with 200 free credits — one key unlocks all 300+ APIs.

Explore the catalog

300+ APIs on the same key and the same response shape.

Browse all APIs