Calculates the sun's azimuth and elevation angles for any location and time. Use via MCP in Cursor or Windsurf for solar panel optimization, photography planning, or astronomical calculations. Returns precise angular measurements — azimuth from north (0-360°) and elevation above horizon (-90 to 90°). Essential for solar energy applications and time-dependent geospatial analysis.
curl "https://tinyfn.io/v1/geo/sun-position" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/geo/sun-position', {
headers: { 'X-API-Key': 'YOUR_API_KEY' }
});
const data = await response.json();
console.log(data);
import requests
response = requests.get('https://tinyfn.io/v1/geo/sun-position',
headers={'X-API-Key': 'YOUR_API_KEY'})
data = response.json()
print(data)
Connect your AI agent (Claude, Cursor, Windsurf, etc.) to TinyFn's geolocation tools:
{
"mcpServers": {
"tinyfn-geo": {
"url": "https://tinyfn.io/mcp/geo",
"headers": {
"X-API-Key": "YOUR_API_KEY"
}
}
}
}
Azimuth is measured clockwise from true north (0-360°), elevation is angle above horizon (-90° to 90°). Negative elevation means sun is below horizon.
AI agents can optimize panel angles by calculating sun position throughout the day, determining peak solar hours, and estimating energy output based on elevation angles.
Accepts UTC timestamps or local time with timezone offset. Always specify timezone to avoid calculation errors, especially near sunrise/sunset.
Provides approximate positions suitable for most applications. For precision astronomy or navigation, use dedicated ephemeris data sources.
Yes, works for any date/time combination. Useful for historical solar irradiance analysis or planning future solar installations.
Get your free API key and start using Sun Position in seconds.
Get Free API Key