Skip to main content

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

Cities Lookup is a city search API that searches over 150,000 global cities to find country codes, population counts, and city size classifications by name. Paid plans add GeoJSON coordinates and cust [...]

Cities Lookup API - Dart/Flutter Client #

Cities Lookup is a city search API that searches over 150,000 global cities to find country codes, population counts, and city size classifications by name. Paid plans add GeoJSON coordinates and custom match limits.

pub package License: MIT

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

Installation #

Add this to your pubspec.yaml:

dependencies:
  apiverve_citieslookup: ^1.2.3

Then run:

dart pub get
# or for Flutter
flutter pub get

Usage #

import 'package:apiverve_citieslookup/apiverve_citieslookup.dart';

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

  try {
    final response = await client.execute({
      'city': 'San Francisco',
      'limit': 1
    });

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

Response #

{
  "status": "ok",
  "error": null,
  "data": {
    "search": "San Francisco",
    "foundCities": [
      {
        "name": "San Francisco",
        "altName": "",
        "country": "US",
        "countryName": "United States",
        "featureCode": "PPLA2",
        "population": 874961,
        "populationCategory": "major",
        "loc": {
          "type": "Point",
          "coordinates": [
            -122.4194,
            37.7749
          ]
        }
      }
    ]
  }
}

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
120
points
134
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Cities Lookup is a city search API that searches over 150,000 global cities to find country codes, population counts, and city size classifications by name. Paid plans add GeoJSON coordinates and custom match limits.

Homepage
Repository (GitHub)
View/report issues
Contributing

License

MIT (license)

Dependencies

http, http_parser

More

Packages that depend on apiverve_citieslookup