pub struct Client { /* private fields */ }Expand description
Async client for the ip-api.io API.
let client = ip_api_io::Client::with_api_key("YOUR_API_KEY");
let info = client.lookup_ip("8.8.8.8").await?;
println!("{:?}", info.location.country);Implementations§
Source§impl Client
impl Client
Sourcepub fn new() -> Self
pub fn new() -> Self
Client without an API key (the live API rejects keyless requests —
prefer Client::with_api_key).
Sourcepub fn with_api_key(key: impl Into<String>) -> Self
pub fn with_api_key(key: impl Into<String>) -> Self
Client authenticated with an API key.
pub fn builder() -> ClientBuilder
Sourcepub async fn lookup(&self) -> Result<IpInfo, Error>
pub async fn lookup(&self) -> Result<IpInfo, Error>
Geolocation + threat intelligence for the caller’s IP.
Sourcepub async fn lookup_ip(&self, ip: &str) -> Result<IpInfo, Error>
pub async fn lookup_ip(&self, ip: &str) -> Result<IpInfo, Error>
Geolocation + threat intelligence for a specific IP.
Sourcepub async fn lookup_batch(
&self,
ips: &[&str],
) -> Result<BatchIpLookupResponse, Error>
pub async fn lookup_batch( &self, ips: &[&str], ) -> Result<BatchIpLookupResponse, Error>
Look up to 100 IP addresses in a single request.
Sourcepub async fn ip_reputation(&self, ip: &str) -> Result<Value, Error>
pub async fn ip_reputation(&self, ip: &str) -> Result<Value, Error>
IP reputation check (untyped map — shape may evolve).
Sourcepub async fn tor_check(&self, ip: &str) -> Result<TorDetection, Error>
pub async fn tor_check(&self, ip: &str) -> Result<TorDetection, Error>
Whether an IP is a Tor exit node.
Sourcepub async fn asn(&self, ip: &str) -> Result<AsnLookup, Error>
pub async fn asn(&self, ip: &str) -> Result<AsnLookup, Error>
Autonomous system lookup for an IP.
Sourcepub async fn email_info(&self, email: &str) -> Result<EmailInfo, Error>
pub async fn email_info(&self, email: &str) -> Result<EmailInfo, Error>
Syntax, disposability and MX analysis of an email address.
Sourcepub async fn validate_email(
&self,
email: &str,
) -> Result<AdvancedEmailValidation, Error>
pub async fn validate_email( &self, email: &str, ) -> Result<AdvancedEmailValidation, Error>
Advanced validation including SMTP deliverability checks.
Sourcepub async fn validate_email_batch(
&self,
emails: &[&str],
) -> Result<BatchEmailValidationResponse, Error>
pub async fn validate_email_batch( &self, emails: &[&str], ) -> Result<BatchEmailValidationResponse, Error>
Advanced-validate up to 100 email addresses in a single request.
Sourcepub async fn risk_score(&self) -> Result<RiskScore, Error>
pub async fn risk_score(&self) -> Result<RiskScore, Error>
Fraud risk score for the caller’s IP.
Sourcepub async fn risk_score_ip(&self, ip: &str) -> Result<RiskScore, Error>
pub async fn risk_score_ip(&self, ip: &str) -> Result<RiskScore, Error>
Fraud risk score for a specific IP.
Sourcepub async fn email_risk_score(&self, email: &str) -> Result<RiskScore, Error>
pub async fn email_risk_score(&self, email: &str) -> Result<RiskScore, Error>
Fraud risk score for an email address.
pub async fn whois(&self, domain: &str) -> Result<Whois, Error>
pub async fn reverse_dns(&self, ip: &str) -> Result<ReverseDns, Error>
pub async fn forward_dns(&self, hostname: &str) -> Result<ForwardDns, Error>
pub async fn mx_records(&self, domain: &str) -> Result<MxLookup, Error>
pub async fn domain_age(&self, domain: &str) -> Result<DomainAge, Error>
pub async fn domain_age_batch( &self, domains: &[&str], ) -> Result<BatchDomainAgeResponse, Error>
pub async fn rate_limit(&self) -> Result<RateLimitInfo, Error>
pub async fn usage_summary(&self) -> Result<UsageSummary, Error>
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Client
impl !UnwindSafe for Client
impl Freeze for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl UnsafeUnpin for Client
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more