iplocate 0.1.0

A powerful IP geolocation API
Documentation

IPLocate

IPLocate.io is an internet service for finding data associated with Internet Protocol (IP) addresses, such as city, country, approximate location, timezone, and more.

Before starting to use their service, take a look at their terms of service.

The iplocate crate provides a wrapper for IPLocate API, and it can be handled with ease!

# extern crate iplocate;
# fn main() -> iplocate::Result<()> {
let ip = "8.8.8.8".parse().unwrap();
let result = iplocate::lookup(ip)?;
if let Some(ref country) = &result.geo_ip.country {
    println!("The IP address {} comes from the {}.", ip, country);
} else {
    println!("The IP address {} does not belong to any country.", ip);
}
# Ok(())
# }