seeip_client 1.1.1 copy "seeip_client: ^1.1.1" to clipboard
seeip_client: ^1.1.1 copied to clipboard

Obtain IP address information using SeeIP - A simple IP address API

seeip client #

Obtain IP address information using SeeIP - A simple IP address API.

This is a pure Dart library which relies on the http package. Therefore, it can be used cross-platform, from Flutter to Web to server-side.

Usage #

You can fetch data from SeeIP without any api or auth tokens. Simply create an instance of the SeeipClient class.

Obtain a public IP address. #

Obtain the public IP of the device making the request.

import 'package:seeip_client/seeip_client.dart';

main() async {
  var seeip = SeeipClient();
  var result = await seeip.getIP();
  print(result);
}

Obtain geographical IP address information. #

Obtain the geographical public IP address information for a specific IP address.

main() async {
  var seeip = SeeipClient();
  // Leave out the ip address to return client's ip address information.
  var result = await seeip.getGeoIP('208.67.222.222');
  print(result);
}

Gives the following output...

result {
  ip: 208.67.222.222,
  organization: OPENDNS,
  city: Wright City,
  region: Missouri,
  timezone: America/Chicago,
  offset: -18000,
  longitude: -91.0332,
  countryCode3: USA,
  postalCode: 63390,
  continentCode: NA,
  country: United States,
  regionCode: MO,
  countryCode: US,
  latitude: 38.811
}

The requested IP address can be in IPv4 or IPv6 format.

Omit the IP address to return the geographical IP address information for the device making the request.

Please see example/seeip_client_example.dart for more examples.

Features and bugs #

Please file feature requests and bugs at the issue tracker.

3
likes
160
points
2.26k
downloads

Documentation

API reference

Publisher

verified publishermadaboutbrighton.net

Weekly Downloads

Obtain IP address information using SeeIP - A simple IP address API

Homepage
Repository (GitHub)
View/report issues

License

BSD-3-Clause (license)

Dependencies

http

More

Packages that depend on seeip_client