IP Demographics API - Dart/Flutter Client

IP Demographics combines IP geolocation with Census demographic data to provide demographic information for any IP address. Get location, income, education, and housing data based on the IP's geographic location. Demographics cover US ZIP codes; other locations return the location with demographics set to null.

pub package License: MIT

This is the Dart/Flutter client for the IP Demographics API.

Installation

Add this to your pubspec.yaml:

dependencies:
  apiverve_ipdemographics: ^1.2.4

Then run:

dart pub get
# or for Flutter
flutter pub get

Usage

import 'package:apiverve_ipdemographics/apiverve_ipdemographics.dart';

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

  try {
    final response = await client.execute({
      'ip': '173.172.81.20'
    });

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

Response

{
  "status": "ok",
  "error": null,
  "data": {
    "ip": "8.8.8.8",
    "location": {
      "zip": "94043",
      "city": "Mountain View",
      "state": "California",
      "stateCode": "CA",
      "country": "United States",
      "countryCode": "US",
      "latitude": 37.4056,
      "longitude": -122.0775,
      "timezone": "America/Los_Angeles"
    },
    "demographics": {
      "population": 81234,
      "medianAge": 34.5,
      "medianHouseholdIncome": 142567,
      "perCapitaIncome": 78234,
      "medianHomeValue": 1875000,
      "collegeEducatedPct": 68.3,
      "unemploymentRate": 3.2,
      "homeOwnershipRate": 45.6
    },
    "acsYear": 2022,
    "formatted": {
      "medianHouseholdIncome": "$142,567",
      "perCapitaIncome": "$78,234",
      "medianHomeValue": "$1,875,000"
    }
  }
}

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_ipdemographics
IP Demographics API client for Dart/Flutter