Country Borders API - Dart/Flutter Client
Country Borders identifies adjacent nations by two-letter ISO country code. It returns the list of bordering countries along with region, subregion, and landlocked status.
This is the Dart/Flutter client for the Country Borders API.
Installation
Add this to your pubspec.yaml:
dependencies:
apiverve_countryborders: ^1.2.5
Then run:
dart pub get
# or for Flutter
flutter pub get
Usage
import 'package:apiverve_countryborders/apiverve_countryborders.dart';
void main() async {
final client = CountrybordersClient('YOUR_API_KEY');
try {
final response = await client.execute({
'country': 'CA'
});
print('Status: ${response.status}');
print('Data: ${response.data}');
} catch (e) {
print('Error: $e');
}
}
Response
{
"status": "ok",
"error": null,
"data": {
"country": "Canada",
"cca2": "CA",
"landlocked": false,
"region": "Americas",
"subregion": "Northern America",
"coordinates": {
"lat": 60,
"lng": -95
},
"borders": [
"USA"
]
}
}
API Reference
- API Home: Country Borders API
- Documentation: docs.apiverve.com/ref/countryborders
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_countryborders
- Country Borders API client for Dart/Flutter