iplocate

Crates.ioiplocate
lib.rsiplocate
version0.1.0
sourcesrc
created_at2018-09-24 01:38:45.741685
updated_at2018-09-24 01:38:45.741685
descriptionA powerful IP geolocation API
homepage
repositoryhttps://github.com/rustka/iplocate
max_upload_size
id86253
size9,601
Rustka K. Blinsk (rustka)

documentation

README

IPLocate

Build Status

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() {
    let ip = "8.8.8.8".parse().unwrap();
    let result = iplocate::lookup(ip).unwrap();
    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);
    }
}

You can find more examples in the examples directory.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Commit count: 0

cargo fmt