Reverse Geocode API - Dart/Flutter Client

Reverse Geocode converts latitude and longitude coordinates into location details anywhere in the world. Pass coordinates to get the city, state or region, postal code, country code and time zone, plus the US county or the second-level division elsewhere. Paid plans add the matched location's coordinates and distance, the nearest cities, and the point's geohash, plus code and degrees-minutes-seconds notation.

pub package License: MIT

This is the Dart/Flutter client for the Reverse Geocode API.

Installation

Add this to your pubspec.yaml:

dependencies:
  apiverve_reversegeocode: ^1.2.7

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,
      'geocodes': true
    });

    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"
    ],
    "timezone": "America/New_York",
    "county": "Kings County",
    "countyFips": "36047",
    "geocodes": {
      "geohash": "dr5rsgyct",
      "plusCode": "87G8P27Q+MC",
      "dms": {
        "latitude": "40°42'51.2\"N",
        "longitude": "73°57'41.2\"W"
      }
    }
  }
}

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

Libraries

apiverve_reversegeocode
Reverse Geocode API client for Dart/Flutter