Skip to main content

apiverve_gdp 1.2.4 copy "apiverve_gdp: ^1.2.4" to clipboard
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.

pub package License: MIT

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 #

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
0
points
1.09k
downloads

Publisher

unverified uploader

Weekly Downloads

Get GDP (Gross Domestic Product) data for any country including current values and historical data going back to 1960.

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

http, http_parser

More

Packages that depend on apiverve_gdp