apiverve_countrylookup 1.2.3
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.
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 #
- API Home: Country Lookup API
- Documentation: docs.apiverve.com/ref/countrylookup
Authentication #
All requests require an API key. Get yours at apiverve.com.
License #
MIT License - see LICENSE for details.
Built with Dart for APIVerve