astro96_api 0.3.2
astro96_api: ^0.3.2 copied to clipboard
Official client for the 96Astro astrology API (kundli, panchang, horoscope, matching, PDF and audio reports), with retries and idempotency keys.
example/example.dart
import 'dart:io';
import 'package:astro96_api/astro96_api.dart';
Future<void> main() async {
final astro = Astro96Client(apiKey: Platform.environment['ASTRO_API_KEY']!);
try {
final answer = await astro.planetPositions({
'datetime': '1990-10-18T14:30:00',
'timezone': 'Asia/Kolkata',
'latitude': 28.6139,
'longitude': 77.209,
});
print(answer['data']);
} on Astro96Exception catch (e) {
print('The API answered ${e.status} ${e.code}');
} finally {
astro.close();
}
}