Skip to main content

apiverve_sunposition 1.2.6 copy "apiverve_sunposition: ^1.2.6" to clipboard
apiverve_sunposition: ^1.2.6 copied to clipboard

Sun Position calculates the sun altitude and azimuth, plus compass bearing, for any geographic coordinates and time. Provide latitude and longitude to read sun elevation angles and daylight status; pa [...]

Sun Position API - Dart/Flutter Client #

Sun Position calculates the sun altitude and azimuth, plus compass bearing, 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.

pub package License: MIT

This is the Dart/Flutter client for the Sun Position API.

Installation #

Add this to your pubspec.yaml:

dependencies:
  apiverve_sunposition: ^1.2.6

Then run:

dart pub get
# or for Flutter
flutter pub get

Usage #

import 'package:apiverve_sunposition/apiverve_sunposition.dart';

void main() async {
  final client = SunpositionClient('YOUR_API_KEY');

  try {
    final response = await client.execute({
      'lat': 37.7749,
      'lon': -122.4194,
      'date': '01-16-2026',
      'time': '14:30',
      'timezone': 'America/Los_Angeles'
    });

    print('Status: ${response.status}');
    print('Data: ${response.data}');
  } catch (e) {
    print('Error: $e');
  }
}

Response #

{
  "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
    }
  }
}

API Reference #

Authentication #

All requests require an API key. Get yours at apiverve.com.

License #

MIT License - see LICENSE for details.


Built with Dart for APIVerve

0
likes
120
points
107
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Sun Position calculates the sun altitude and azimuth, plus compass bearing, 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.

Homepage
Repository (GitHub)
View/report issues
Contributing

License

MIT (license)

Dependencies

http, http_parser

More

Packages that depend on apiverve_sunposition