Skip to main content

apiverve_countrylookup 1.2.3 copy "apiverve_countrylookup: ^1.2.3" to clipboard
apiverve_countrylookup: ^1.2.3 copied to clipboard

Country Lookup matches any country name or ISO code to its official names, ISO 3166 codes, capitals, region, languages, and flag emoji. Paid plans add coordinates and major cities.

Country Lookup API - Dart/Flutter Client #

Country Lookup matches any country name or ISO code to its official names, ISO 3166 codes, capitals, region, languages, and flag emoji. Paid plans add coordinates and major cities.

pub package License: MIT

This is the Dart/Flutter client for the Country Lookup API.

Installation #

Add this to your pubspec.yaml:

dependencies:
  apiverve_countrylookup: ^1.2.3

Then run:

dart pub get
# or for Flutter
flutter pub get

Usage #

import 'package:apiverve_countrylookup/apiverve_countrylookup.dart';

void main() async {
  final client = CountrylookupClient('YOUR_API_KEY');

  try {
    final response = await client.execute({
      'country': 'USA',
      'majorcities': true
    });

    print('Status: ${response.status}');
    print('Data: ${response.data}');
  } catch (e) {
    print('Error: $e');
  }
}

Response #

{
  "status": "ok",
  "error": null,
  "data": {
    "search": "USA",
    "countries": [
      {
        "name": {
          "common": "United States",
          "official": "United States of America",
          "native": {
            "eng": {
              "official": "United States of America",
              "common": "United States"
            }
          }
        },
        "tld": [
          ".us"
        ],
        "cca2": "US",
        "ccn3": "840",
        "cca3": "USA",
        "cioc": "USA",
        "independent": true,
        "status": "officially-assigned",
        "unRegionalGroup": "Western European and Others Group",
        "capital": [
          "Washington D.C."
        ],
        "altSpellings": [
          "US",
          "USA",
          "United States of America"
        ],
        "region": "Americas",
        "subregion": "North America",
        "languages": {
          "eng": "English"
        },
        "latlng": [
          38,
          -97
        ],
        "landlocked": false,
        "flag": "πŸ‡ΊπŸ‡Έ"
      }
    ]
  }
}

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
130
points
88
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Country Lookup matches any country name or ISO code to its official names, ISO 3166 codes, capitals, region, languages, and flag emoji. Paid plans add coordinates and major cities.

Homepage
Repository (GitHub)
View/report issues
Contributing

License

MIT (license)

Dependencies

http, http_parser

More

Packages that depend on apiverve_countrylookup