ipdata/lib.rs
1//! # ipdata
2//!
3//! Rust client for the [ipdata.co](https://ipdata.co) IP geolocation and
4//! threat intelligence API.
5//!
6//! ## Quick Start
7//!
8//! ```no_run
9//! # async fn example() -> ipdata::Result<()> {
10//! let client = ipdata::IpData::new("your-api-key");
11//!
12//! // Look up a specific IP
13//! let info = client.lookup("8.8.8.8").await?;
14//! println!("{} is in {}", info.ip, info.country_name.unwrap_or_default());
15//!
16//! // Look up your own IP
17//! let me = client.lookup_self().await?;
18//!
19//! // Bulk lookup (up to 100 IPs, requires paid key)
20//! let results = client.bulk(&["8.8.8.8", "1.1.1.1"]).await?;
21//! # Ok(())
22//! # }
23//! ```
24
25mod client;
26mod error;
27mod types;
28
29pub use client::IpData;
30pub use error::{Error, Result};
31pub use types::{
32 Asn, Blocklist, Carrier, Company, Currency, IpInfo, Language, Threat, ThreatScores, TimeZone,
33};