Skip to main content

ip-api-io — Official Python client for ip-api.io

PyPI test License: MIT

The official Python client for the ip-api.io IP intelligence platform. One client covers IP geolocation, email validation and verification (syntax, MX, SMTP deliverability), fraud detection and risk scoring, VPN/proxy/Tor detection, disposable email detection, ASN lookup, WHOIS, reverse DNS, MX records and domain age.

Zero dependencies — pure standard library.

Install

pip install ip-api-io

Quickstart

from ipapi_io import IpApiClient

client = IpApiClient(api_key="YOUR_API_KEY")  # free key at https://ip-api.io

# Where is this IP, and is it risky?
info = client.lookup("8.8.8.8")
print(info["location"]["country"])            # "United States"
print(info["suspicious_factors"]["is_vpn"])   # False

risk = client.risk_score("8.8.8.8")
print(risk["score"], risk["risk_level"])      # 0 "low"

email = client.validate_email("user@example.com")
print(email["reachable"], email["disposable"]) # "yes" False

An API key is required — the API rejects keyless requests with 401. Sign up at ip-api.io for a free key.

Documentation

Each guide documents the methods for one capability, with runnable examples and a link to the matching ip-api.io product page:

Methods

Every method maps to one ip-api.io endpoint and its product page:

Method Endpoint Product page
lookup(ip=None) GET /api/v1/ip[/{ip}] IP geolocation
lookup_batch(ips) POST /api/v1/ip/batch (≤100 IPs) Bulk IP lookup
email_info(email) GET /api/v1/email/{email} Email validation
validate_email(email) GET /api/v1/email/advanced/{email} Advanced email validation
validate_email_batch(emails) POST /api/v1/email/advanced/batch (≤100) Email list cleaning
risk_score(ip=None) GET /api/v1/risk-score[/{ip}] Risk score
email_risk_score(email) GET /api/v1/risk-score/email/{email} Fraud detection
ip_reputation(ip) GET /api/v1/ip-reputation/{ip} IP reputation
tor_check(ip) GET /api/v1/tor/{ip} Tor detection
asn(ip) GET /api/v1/asn/{ip} ASN lookup
whois(domain) GET /api/v1/dns/whois/{domain} WHOIS lookup
reverse_dns(ip) GET /api/v1/dns/reverse/{ip} Reverse DNS
forward_dns(hostname) GET /api/v1/dns/forward/{hostname}
mx_records(domain) GET /api/v1/dns/mx/{domain} MX record lookup
domain_age(domain) GET /api/v1/domain/age/{domain} Domain age checker
domain_age_batch(domains) POST /api/v1/domain/age/batch Domain age checker
rate_limit() GET /api/v1/ratelimit
usage_summary() GET /api/v1/usage/summary

All methods return parsed JSON as plain dicts. ipapi_io.types ships TypedDict definitions for editor autocompletion.

Error handling

The client raises typed exceptions and never retries — on 429, RateLimitError.reset tells you when your quota renews:

from ipapi_io import IpApiClient, RateLimitError, AuthenticationError

client = IpApiClient(api_key="YOUR_API_KEY")
try:
    client.lookup("8.8.8.8")
except RateLimitError as e:
    print(f"limit={e.limit} remaining={e.remaining} resets_at={e.reset}")
except AuthenticationError:
    print("invalid API key")

See docs/error-handling.md for the full exception taxonomy.

Links


ip-api-io is the official client for ip-api.io. It is not affiliated with ip-api.com or ipapi.com.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ip_api_io-1.0.0.tar.gz (24.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ip_api_io-1.0.0-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

Details for the file ip_api_io-1.0.0.tar.gz.

File metadata

  • Download URL: ip_api_io-1.0.0.tar.gz
  • Upload date:
  • Size: 24.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for ip_api_io-1.0.0.tar.gz
Algorithm Hash digest
SHA256 99bc48c7e50c3df82d2b22780ba14fcc39f4826b3989d12360c859ab99b8a44e
MD5 f297aef62a1c6b207fc67c50c35def9f
BLAKE2b-256 f8be563ab30ca4a5f24cf232bf01e295d73daa02f8b215273d0f704e419425e5

See more details on using hashes here.

File details

Details for the file ip_api_io-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: ip_api_io-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 8.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for ip_api_io-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8ddc0620d3bd69b9593b95be80142b4baed2ae643340ff6123aec63328c12b2e
MD5 e46a5e98af0b7c81b44b10e68b6df170
BLAKE2b-256 0fb2bfa5dba21cbaf9f62285c045f0b11c26df3a7a2fc63e49419895dba703ad

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page