Hosted Domain API allowing users to get the list of hosted domain names by IP address in real time. The REST API supports both IPv4 and IPv6 address lookup.
Note: IP2WHOIS Free API allows you to query up to 50 hosted domains per month.

WHOIS lookup REST API

GET https://domains.ip2whois.com/domains

Request Parameter

Parameter Description
key (required) API license key.
ip (required) IP address (IPv4 or IPv6) for hosted domain lookup purposes.
format (optional) Returns the API response in json (default) or xml format. Valid values: json | xml
page (optional) Pagination result returns of the hosted domains. If unspecified, 1st page will be used.

Response Parameter

Parameter Description
ip IP Address.
total_domains Total number of hosted domains found.
page Current lookup page.
per_page Number of domains displayed in the page.
total_pages Total pages of the hosted domains.
domains Hosted domains of the lookup IP Address.
GET /domains
curl "https://domains.ip2whois.com/domains?key={your_license_key}&ip={ip_address}"

Sample codes for other languages

Response
{
    "ip": "8.8.8.8",
    "total_domains": 3857,
    "page": 1,
    "per_page": 100,
    "total_pages": 39,
    "domains": [
        "000180.top",
        "00100tet.xyz",
        "001hash.vip",
        "002hash.com",
        "0050500.xyz",
        "007515.com",
        "023mm.net",
        "023mt.net",
        "023sn.net",
        "031000.xyz",
        "0515smw.com",
        "058637.com",
        "0798907.xyz",
        "07capital.com",
        "07osrs.com",
        "07sh2wv.bar",
        "0857.site",
        "0931seo.com",
        "0lzh.com",
        "0x4f.com",
        "0x57696c6c.com",
        "0xb055.com",
        "1-189tais.com",
        "10askfcwebkvh.top",
        "1102halfhowehbao1.com",
        "1102hdfkeuwuhfubao2.com",
        "1102hdukefjkf2.com",
        "1102sdbkwuoubao3.com",
        "11107hdkjhguk.com",
        "111km.xyz",
        "1130kfhuhw.com",
        "11eqlhon.top",
        "1206m.site",
        "125ap.com",
        "12la21wn31da40le6.com",
        "12safhoie.top",
        "12tivi.com",
        "1333limited.com",
        "1333yyh.com",
        "135493.com",
        "136668.xyz",
        "13shkuwq.top",
        "142937440.site",
        "144888.xyz",
        "14whoduhw.top",
        "1562yjargm.xyz",
        "15sdkwb.top",
        "167853.xyz",
        "168.one",
        "168km.xyz",
        "16uhwfuhe.cyou",
        "176274.com",
        "17diqwehfoi.cyou",
        "17jule.com",
        "18uhefoh.cyou",
        "191095211.xyz",
        "19931006.xyz",
        "19g.vip",
        "19wuji.cyou",
        "1huofhoehfogakfwqqq.com",
        "1ine1.com",
        "1master-fitness.com",
        "1rf3k.com",
        "1s1s.app",
        "1visualizer.app",
        "200250.xyz",
        "20070217.xyz",
        "20088888.xyz",
        "20230406.mov",
        "205566.com",
        "205artemisbet.com",
        "20iiij.cyou",
        "21107ahsfukhweo.com",
        "21hodheoh.cyou",
        "22bahman.space",
        "22howhw.cyou",
        "231q.top",
        "234n.top",
        "236j.top",
        "23hw.cyou",
        "24asfbkhb.cyou",
        "24ihhcorp.com",
        "25dgfu.cyou",
        "26asfhku.cyou",
        "277210.shop",
        "27adfljn.cyou",
        "28dshkf.cyou",
        "29583.biz",
        "29dakfb.cyou",
        "2ashdowehofhweohfo.com",
        "2c.com",
        "2qdrap.com",
        "2s1c.com",
        "304065117.xyz",
        "30fwhdfkb.cyou",
        "3101r.space",
        "31107abskjfbekb.com",
        "315sx.com",
        "31dfhkjsdb.cyou",
        "325965.com"
    ]
}

WHOIS lookup Sample Code

<?php
$apiKey = 'Enter_License_Key';
$params['ip'] = 'Enter_IP_Address';
$params['format'] = 'json';

$query = '';

foreach($params as $key=>$value){
    $query .= '&' . $key . '=' . rawurlencode($value);
}

$result = file_get_contents('https://domains.ip2whois.com/domains?key=' . $apiKey . $query);

$data = json_decode($result);

print_r($data);
?>
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLEncoder;
import java.util.Hashtable;
import java.util.Map;

public class test {
    public static void main(String[] args) {
        try {
            String key = "Enter_License_Key";
            Hashtable<String, String> data = new Hashtable<String, String>();
            data.put("ip", "Enter_IP_Address");
            data.put("format", "json");
            
            String datastr = "";
            for (Map.Entry<String,String> entry : data.entrySet()) {
                datastr += "&" + entry.getKey() + "=" + URLEncoder.encode(entry.getValue(), "UTF-8");
            }
            URL url = new URL("https://domains.ip2whois.com/domains?key=" + key + datastr);
            HttpURLConnection conn = (HttpURLConnection) url.openConnection();
            conn.setRequestMethod("GET");
            conn.setRequestProperty("Accept", "application/json");
            
            if (conn.getResponseCode() != 200) {
                throw new RuntimeException("Failed : HTTP error code : " + conn.getResponseCode());
            }
            
            BufferedReader br = new BufferedReader(new InputStreamReader((conn.getInputStream())));
            
            String output;
            
            while ((output = br.readLine()) != null) {
                System.out.println(output);
            }
            conn.disconnect();
        }
        catch (MalformedURLException e) {
            e.printStackTrace();
        }
        catch (IOException e) {
            e.printStackTrace();
        }
    }
}
Imports System.Net
Imports System.IO
Imports System.Uri

Public Class _Default
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim request As HttpWebRequest = Nothing
        Dim response As HttpWebResponse = Nothing

        Dim apiKey As String = "Enter_License_Key"
        Dim data As New Dictionary(Of String, String)

        data.Add("ip", "Enter_IP_Address")
        data.Add("format", "json")
        Dim datastr As String = String.Join("&", data.[Select](Function(x) x.Key & "=" & EscapeDataString(x.Value)).ToArray())

        request = Net.WebRequest.Create("https://domains.ip2whois.com/domains?key=" & apiKey & "&" & datastr)

        request.Method = "GET"
        response = request.GetResponse()

        Dim reader As System.IO.StreamReader = New IO.StreamReader(response.GetResponseStream())

        Page.Response.Write(reader.ReadToEnd)

    End Sub

End Class
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Net;
using System.IO;

namespace WebApplication1
{
    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            WebRequest request = null;
            WebResponse response = null;

            string apiKey = "Enter_License_Key";
            Dictionary<string, string> data = new Dictionary<string, string>();

            data.Add("ip", "Enter_IP_Address");
            data.Add("format", "json");
            string datastr = string.Join("&", data.Select(x => x.Key + "=" + System.Uri.EscapeDataString(x.Value)).ToArray());

            request = System.Net.WebRequest.Create("https://domains.ip2whois.com/domains?key=" + apiKey + "&" + datastr);

            request.Method = "GET";
            response = request.GetResponse();

            System.IO.StreamReader reader = new System.IO.StreamReader(response.GetResponseStream());

            Page.Response.Write(reader.ReadToEnd());
        }
    }
}
import urllib.parse, http.client

p = { 'key': 'Enter_License_Key', 'ip': 'Enter_IP_Address', 'format': 'json' }

conn = http.client.HTTPSConnection("domains.ip2whois.com")
conn.request("GET", "/domains?" + urllib.parse.urlencode(p))
res = conn.getresponse()
print res.read()
require 'uri'
require 'net/http'

uri = URI.parse("https://domains.ip2whois.com/domains")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri.request_uri)
request.set_form_data({
  'key' => 'Enter_License_Key',
  'ip' => 'Enter_IP_Address',
  'format' => 'json'
})

response = http.request(request)

if response == nil
  return false
else
  return response
end
var https = require('https');
let data = {
    key: 'Enter_License_Key',
    ip: 'Enter_IP_Address',
    format: 'json',
};

let urlStr = 'https://domains.ip2whois.com/domains?';

Object.keys(data).forEach(function (key, index) {
    if (this[key] != '') {
        urlStr += key + '=' + encodeURIComponent(this[key]) + '&';
    }
}, data);

urlStr = urlStr.substring(0, urlStr.length - 1);

let d = '';
let req = https.get(urlStr, function (res) {
    res.on('data', (chunk) => (d = d + chunk));
    res.on('end', function () {
        console.log(JSON.parse(d));
    });
});

req.on('error', function (e) {
    console.log(e);
});

Error Codes

error_code error_message
10000 Missing parameter.
10001 API key not found.
10002 API key disabled.
10003 API key expired.
10004 Insufficient credits.
10005 Internal server error.
10006 Invalid IP address.
10007 Invalid format.
10008 Invalid page value.
Error Object Response
{
    "error": {
        "error_code": 10000,
        "error_message": "Missing parameter."
    }
}

Try WHOIS Domain REST API to lookup domain information for FREE.