apiverve_gdp 1.2.4
apiverve_gdp: ^1.2.4 copied to clipboard
Get GDP (Gross Domestic Product) data for any country including current values and historical data going back to 1960.
GDP Data API - Dart/Flutter Client #
Get GDP (Gross Domestic Product) data for any country including current values and historical data going back to 1960.
This is the Dart/Flutter client for the GDP Data API.
Installation #
Add this to your pubspec.yaml:
dependencies:
apiverve_gdp: ^1.2.4
Then run:
dart pub get
# or for Flutter
flutter pub get
Usage #
import 'package:apiverve_gdp/apiverve_gdp.dart';
void main() async {
final client = GdpClient('YOUR_API_KEY');
try {
final response = await client.execute({
'country': 'US',
'year': 2023
});
print('Status: ${response.status}');
print('Data: ${response.data}');
} catch (e) {
print('Error: $e');
}
}
Response #
{
"status": "ok",
"error": null,
"data": {
"country": "US",
"countryName": "United States",
"currency": "USD",
"year": 2023,
"gdp": 27360935000000,
"gdpFormatted": "$27.36 trillion",
"gdpGrowth": 2.54,
"gdpPerCapita": 81632,
"count": 1,
"years": [
{
"year": 2023,
"gdp": 27360935000000,
"gdpFormatted": "$27.36 trillion",
"gdpGrowth": 2.54,
"gdpPerCapita": 81632
}
]
},
"code": 200
}
API Reference #
- API Home: GDP Data API
- Documentation: docs.apiverve.com/ref/gdp
Authentication #
All requests require an API key. Get yours at apiverve.com.
License #
MIT License - see LICENSE for details.
Built with Dart for APIVerve