apiverve_reversegeocode 1.2.5
apiverve_reversegeocode: ^1.2.5 copied to clipboard
Reverse Geocode converts latitude and longitude coordinates into US and Canada location details. Pass geographic coordinates to retrieve the corresponding city, state, postal code, and country code.
Reverse Geocode API - Dart/Flutter Client #
Reverse Geocode converts latitude and longitude coordinates into US and Canada location details. Pass geographic coordinates to retrieve the corresponding city, state, postal code, and country code.
This is the Dart/Flutter client for the Reverse Geocode API.
Installation #
Add this to your pubspec.yaml:
dependencies:
apiverve_reversegeocode: ^1.2.5
Then run:
dart pub get
# or for Flutter
flutter pub get
Usage #
import 'package:apiverve_reversegeocode/apiverve_reversegeocode.dart';
void main() async {
final client = ReversegeocodeClient('YOUR_API_KEY');
try {
final response = await client.execute({
'lat': 40.714224,
'lon': -73.961452
});
print('Status: ${response.status}');
print('Data: ${response.data}');
} catch (e) {
print('Error: $e');
}
}
Response #
{
"status": "ok",
"error": null,
"data": {
"zipcode": "11211",
"state_abbr": "NY",
"city": "Brooklyn",
"state": "New York",
"distance": 0.6501757300758664,
"latitudeClosest": "40.712090",
"longitudeClosest": "-73.95427",
"countryCode": "US",
"latitude": 40.714224,
"longitude": -73.961452,
"estimatedCity": true,
"nearestCities": [
"Brooklyn",
"Brooklyn Park",
"East Brooklyn",
"Brooklyn Center",
"Brooklyn Heights"
]
}
}
API Reference #
- API Home: Reverse Geocode API
- Documentation: docs.apiverve.com/ref/reversegeocode
Authentication #
All requests require an API key. Get yours at apiverve.com.
License #
MIT License - see LICENSE for details.
Built with Dart for APIVerve