Age Calculator API - Dart/Flutter Client
Age Calculator is a simple tool for calculating age from the date of birth. It returns the calculated age based on the date of birth provided.
This is the Dart/Flutter client for the Age Calculator API.
Installation
Add this to your pubspec.yaml:
dependencies:
apiverve_agecalculator: ^1.2.0
Then run:
dart pub get
# or for Flutter
flutter pub get
Usage
import 'package:apiverve_agecalculator/apiverve_agecalculator.dart';
void main() async {
final client = AgecalculatorClient('YOUR_API_KEY');
try {
final response = await client.execute({
'dob': '1990-08-02'
});
print('Status: ${response.status}');
print('Data: ${response.data}');
} catch (e) {
print('Error: $e');
}
}
Response
{
"status": "ok",
"error": null,
"data": {
"dob": "1990-01-01",
"age_breakdown": {
"years": 35,
"months": 431,
"weeks": 1876,
"days": 13133,
"hours": 315208,
"minutes": 18912499,
"seconds": 1134749976
},
"age_words": {
"years": "thirty-five",
"ordinal": "thirty-fifth",
"full": "thirty-five years old",
"locale": "en-US"
},
"timezone": "America/Chicago",
"locale": "en-US",
"next_birthday": {
"months": 0,
"weeks": 2,
"days": 15,
"hours": 367,
"minutes": 22060,
"seconds": 1323623
},
"insights": {
"generation": "Millennial",
"zodiacSign": "Capricorn",
"chineseZodiac": "Horse",
"birthstone": "Garnet",
"dayOfWeekBorn": "Monday",
"isLeapYearBirth": false,
"milestones": {
"canVoteUS": true,
"canDrinkUS": true,
"canRentCarUS": true,
"seniorDiscount": false
}
}
}
}
API Reference
- API Home: Age Calculator API
- Documentation: docs.apiverve.com/ref/agecalculator
Authentication
All requests require an API key. Get yours at apiverve.com.
License
MIT License - see LICENSE for details.
Built with Dart for APIVerve
Libraries
- apiverve_agecalculator
- Age Calculator API client for Dart/Flutter