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. With changes=true it also returns the direction against the previous year, and on paid plans the prior year's GDP, the dollar and percent change, whether real growth is accelerating or slowing, and 5- and 10-year compound annual growth.
This is the Dart/Flutter client for the GDP Data API.
Installation
Add this to your pubspec.yaml:
dependencies:
apiverve_gdp: ^1.2.6
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,
'changes': true
});
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": 2025,
"gdp": 30769700000000,
"gdpFormatted": "$30.77 trillion",
"gdpGrowth": 2.16,
"gdpPerCapita": 90027,
"count": 1,
"years": [
{
"year": 2025,
"gdp": 30769700000000,
"gdpFormatted": "$30.77 trillion",
"gdpGrowth": 2.16,
"gdpPerCapita": 90027
}
],
"previousYear": 2024,
"changeDirection": "up",
"previousGdp": 29298013000000,
"gdpChange": 1471687000000,
"gdpChangePercent": 5.02,
"previousGdpGrowth": 2.79,
"growthTrend": "slowing",
"gdpPerCapitaChangePercent": 4.48,
"gdpCagr5y": 7.56,
"gdpCagr10y": 5.34,
"averageGrowth5y": 3.31
},
"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
Libraries
- apiverve_gdp
- GDP Data API client for Dart/Flutter