--- name: "ip-info" description: "Query IP geolocation and ISP / ASN ownership via ipinfo.io or ip-api.com for IP addresses and resolved domains." homepage: https://github.com/ihmily/ip-info-api metadata: openclaw: emoji: "🌍" primaryEnv: IPINFO_TOKEN requires: bins: [python3] --- # IP Info Use `scripts/query_ip.py` for one-off IP / domain lookups. ## Command ```bash python3 {baseDir}/scripts/query_ip.py "" python3 {baseDir}/scripts/query_ip.py "" --json python3 {baseDir}/scripts/query_ip.py "" --raw python3 {baseDir}/scripts/query_ip.py "" --provider ip-api python3 {baseDir}/scripts/query_ip.py "" --all --json python3 {baseDir}/scripts/query_ip.py "" --all --summary ``` - `` can be an IPv4 address like `1.1.1.1` - `` can be an IPv6 address like `2606:4700:4700::1111` - `` can be a domain like `google.com` - `--json` emits normalized structured output, and still returns structured JSON on failure - `--raw` emits raw provider payloads - `--summary` summarizes provider consensus and differences - summary mode also normalizes obvious aliases, emits high-level labels, and produces a `verdict` / `classification` block - common structured failure codes include `TARGET_INVALID_FORMAT`, `DOMAIN_UNRESOLVED`, `TARGET_INVALID_OR_UNRESOLVED`, `UPSTREAM_UNAVAILABLE`, and fallback `NO_PROVIDER_SUCCESS` - `--provider` forces one provider from `ip-api`, `ip-sb`, `ipwhois`, `ipapi-is`, `ipinfo` - `--all` queries all configured providers and returns all successful results - default provider order is tuned as `ipwhois` → `ipapi-is` → `ip-api` → `ipinfo` → `ip-sb` - `ipinfo.io` works without a token; if `IPINFO_TOKEN` is set, the script automatically uses the tokenized query path ## Notes - The script prints human-readable output by default. - Domain input is resolved with DNS first when possible. - `ip-api.com` is used over HTTP because that is how its free endpoint works. - If all configured providers fail, the script exits non-zero. - With `--json` or `--raw`, failure paths still emit structured JSON error output. - failure JSON also includes `resolution` metadata and per-provider `errorCode` details.