Expand description
§myip-foo
Official Rust client for myip.foo - a free, privacy-focused IP lookup API.
§Features
- Async/await support with tokio
- Full type definitions with serde
- Dual-stack IPv4/IPv6 support
- Connection type detection
- No API key required
§Quick Start
use myip_foo::{get_ip, get_ip_data};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Get plain IP
let ip = get_ip().await?;
println!("IP: {}", ip);
// Get full data
let data = get_ip_data().await?;
println!("City: {}", data.location.city);
Ok(())
}Structs§
- Cloudflare
- Cloudflare information
- Connection
Type Data - Connection type data
- Dual
Stack Data - Dual-stack IPv4/IPv6 data
- IpData
- Full IP data including geolocation
- Location
- Location information
- Network
- Network information
Enums§
- Error
- Error type for myip-foo operations
Functions§
- get_
connection_ type - Get connection type (residential, vpn, datacenter).
- get_
dual_ stack - Get both IPv4 and IPv6 addresses.
- get_
headers - Get all HTTP headers as seen by the server.
- get_ip
- Get your IP address as plain text.
- get_
ip_ data - Get full IP data including geolocation.
- get_
user_ agent - Get your user agent string.
Type Aliases§
- Result
- Result type for myip-foo operations