Loading
Loading
Explore the complete API reference with detailed request parameters, response fields, error codes, and code examples: visit API Reference.
Pass any IPv4 address as ip. The response names the registry that answered in whois_server and returns the block in inet_nums, with the organization and contacts where the registry publishes them.
IPv6 uses the same endpoint and parameter. The fields in the record depend on the registry, not on the address family: this RIPE NCC record has no organization and no abuse_contacts. URL-encode the address when you call from a shell, or pass it as a query parameter in your HTTP library.
The abuse mailbox can sit in four places. Read abuse_contacts[].email first, then technical_contacts[].abuse_mailbox, then the Abuse contact for ... is ... line of whois_raw_response, then the block's remarks. This script tries them in that order. The first hit is the contact the registry designates, which is not always the one the holder wants: for 1.1.1.1 it is APNIC's helpdesk, while the remarks name the Cloudflare resolver abuse address. The abuse section of the overview shows both.
To write a rule for the whole range, read inet_nums. Each entry has cidr, start_ip, end_ip, net_name and status. Read the status before you block a wide allocation. For routing detail, use the ASN Lookup API.
Private, shared, loopback and link-local addresses have no public holder. An address such as 192.168.1.1 returns a 200 with IANA's special-use record , status IANA Special Use, not an error, and it is billed like any successful lookup. IPv6 behaves the same: fd00::1 returns the fc00::/7 record, and ::1 returns a 200 with no block. Filter these ranges out of your logs before you call.
| Range | Name | Defined in |
|---|---|---|
| 10.0.0.0/8 | Private use | RFC 1918 |
| 172.16.0.0/12 | Private use | RFC 1918 |
| 192.168.0.0/16 | Private use | RFC 1918 |
| 100.64.0.0/10 | Shared address space (CGNAT) | RFC 6598 |
| 127.0.0.0/8 | Loopback | RFC 1122 |
| 169.254.0.0/16 | Link-local | RFC 3927 |
To test an address first, in Python, is_global is False for all six ranges above, for fd00::1 and for ::1, and True for a public address such as 8.8.8.8.
import requestsurl = "https://api.apifreaks.com/v1.0/ip/whois/live?ip=8.8.8.8"payload = {}headers = {'X-apiKey': 'YOUR_API_KEY'}response = requests.request("GET", url, headers=headers, data=payload)print(response.text)