//! Quickstart example for the ipdata.info Rust SDK.
//! Run: cargo run --example quickstart

use ipdatainfo::Client;

fn main() {
    // Free tier — no API key needed. For higher limits + batch, get a free
    // key at https://ipdata.info/register and use Client::builder().api_key("...").
    let client = Client::new();

    let info = client.lookup("8.8.8.8").expect("lookup failed");
    println!(
        "{} is in {:?}, {:?} (ASN {:?} — {:?})",
        info.ip, info.city, info.country, info.asn, info.asn_org
    );

    let threat = client
        .threat_domain("example.com")
        .expect("threat lookup failed");
    println!("example.com listed as a threat: {}", threat.listed);
}
