Sample code for 30+ languages & platforms
AutoIt

RDAP Domain Lookup using rdap.org

See more HTTP Misc Examples

Demonstrates doing an RDAP domain lookup using the rdap.org public RDAP server.

Chilkat AutoIt Downloads

AutoIt
Local $bSuccess = False

; This example requires the Chilkat API to have been previously unlocked.
; See Global Unlock Sample for sample code.

$oHttp = ObjCreate("Chilkat.Http")

; Send HTTP requests to https://rdap.org/<type>/<object>, where <type> is the object type (one of domain, ip, autnum, entity etc)
; and <object> is the object identifier (eg example.com, 192.168.0.1, 64496, etc).

; For example, here's a lookup for "oracle.com"
$oSbResponse = ObjCreate("Chilkat.StringBuilder")
$bSuccess = $oHttp.QuickGetSb("https://rdap.org/domain/oracle.com",$oSbResponse)
If ($bSuccess = False) Then
    ConsoleWrite($oHttp.LastErrorText & @CRLF)
    Exit
EndIf

Local $iStatusCode = $oHttp.LastStatus
If ($iStatusCode <> 200) Then
    ConsoleWrite("Error response:" & @CRLF)
    ConsoleWrite($oSbResponse.GetAsString() & @CRLF)
    ConsoleWrite("status code: " & $iStatusCode & @CRLF)
    Exit
EndIf

; Load the JSON response and examine..

; Use this online tool to generate parsing code from sample JSON: 
; Generate Parsing Code from JSON

$oJson = ObjCreate("Chilkat.JsonObject")
$oJson.LoadSb($oSbResponse)
$oJson.EmitCompact = False
ConsoleWrite($oJson.Emit() & @CRLF)

; Here's a sample response, and the parsing code generated from the above online tool follows..

; {
;   "objectClassName": "domain",
;   "handle": "607513_DOMAIN_COM-VRSN",
;   "ldhName": "ORACLE.COM",
;   "links": [
;     {
;       "value": "https:\/\/rdap.verisign.com\/com\/v1\/domain\/ORACLE.COM",
;       "rel": "self",
;       "href": "https:\/\/rdap.verisign.com\/com\/v1\/domain\/ORACLE.COM",
;       "type": "application\/rdap+json"
;     },
;     {
;       "value": "https:\/\/rdap.markmonitor.com\/rdap\/domain\/ORACLE.COM",
;       "rel": "related",
;       "href": "https:\/\/rdap.markmonitor.com\/rdap\/domain\/ORACLE.COM",
;       "type": "application\/rdap+json"
;     }
;   ],
;   "status": [
;     "client delete prohibited",
;     "client transfer prohibited",
;     "client update prohibited",
;     "server delete prohibited",
;     "server transfer prohibited",
;     "server update prohibited"
;   ],
;   "entities": [
;     {
;       "objectClassName": "entity",
;       "handle": "292",
;       "roles": [
;         "registrar"
;       ],
;       "publicIds": [
;         {
;           "type": "IANA Registrar ID",
;           "identifier": "292"
;         }
;       ],
;       "vcardArray": [
;         "vcard",
;         [
;           [
;             "version",
;             {},
;             "text",
;             "4.0"
;           ],
;           [
;             "fn",
;             {},
;             "text",
;             "MarkMonitor Inc."
;           ]
;         ]
;       ],
;       "entities": [
;         {
;           "objectClassName": "entity",
;           "roles": [
;             "abuse"
;           ],
;           "vcardArray": [
;             "vcard",
;             [
;               [
;                 "version",
;                 {},
;                 "text",
;                 "4.0"
;               ],
;               [
;                 "fn",
;                 {},
;                 "text",
;                 ""
;               ],
;               [
;                 "tel",
;                 {
;                   "type": "voice"
;                 },
;                 "uri",
;                 "tel:+1.2086851750"
;               ],
;               [
;                 "email",
;                 {},
;                 "text",
;                 "abusecomplaints@markmonitor.com"
;               ]
;             ]
;           ]
;         }
;       ]
;     }
;   ],
;   "events": [
;     {
;       "eventAction": "registration",
;       "eventDate": "1988-12-02T05:00:00Z"
;     },
;     {
;       "eventAction": "expiration",
;       "eventDate": "2025-12-01T05:00:00Z"
;     },
;     {
;       "eventAction": "last changed",
;       "eventDate": "2024-10-30T09:32:52Z"
;     },
;     {
;       "eventAction": "last update of RDAP database",
;       "eventDate": "2024-11-26T14:11:14Z"
;     }
;   ],
;   "secureDNS": {
;     "delegationSigned": false
;   },
;   "nameservers": [
;     {
;       "objectClassName": "nameserver",
;       "ldhName": "A1-160.AKAM.NET"
;     },
;     {
;       "objectClassName": "nameserver",
;       "ldhName": "A11-66.AKAM.NET"
;     },
;     {
;       "objectClassName": "nameserver",
;       "ldhName": "A13-65.AKAM.NET"
;     },
;     {
;       "objectClassName": "nameserver",
;       "ldhName": "A18-67.AKAM.NET"
;     },
;     {
;       "objectClassName": "nameserver",
;       "ldhName": "NS1.P201.DNS.ORACLECLOUD.NET"
;     },
;     {
;       "objectClassName": "nameserver",
;       "ldhName": "NS2.P201.DNS.ORACLECLOUD.NET"
;     },
;     {
;       "objectClassName": "nameserver",
;       "ldhName": "NS3.P201.DNS.ORACLECLOUD.NET"
;     },
;     {
;       "objectClassName": "nameserver",
;       "ldhName": "NS4.P201.DNS.ORACLECLOUD.NET"
;     }
;   ],
;   "rdapConformance": [
;     "rdap_level_0",
;     "icann_rdap_technical_implementation_guide_0",
;     "icann_rdap_response_profile_0"
;   ],
;   "notices": [
;     {
;       "title": "Terms of Use",
;       "description": [
;         "Service subject to Terms of Use."
;       ],
;       "links": [
;         {
;           "href": "https:\/\/www.verisign.com\/domain-names\/registration-data-access-protocol\/terms-service\/index.xhtml",
;           "type": "text\/html"
;         }
;       ]
;     },
;     {
;       "title": "Status Codes",
;       "description": [
;         "For more information on domain status codes, please visit https:\/\/icann.org\/epp"
;       ],
;       "links": [
;         {
;           "href": "https:\/\/icann.org\/epp",
;           "type": "text\/html"
;         }
;       ]
;     },
;     {
;       "title": "RDDS Inaccuracy Complaint Form",
;       "description": [
;         "URL of the ICANN RDDS Inaccuracy Complaint Form: https:\/\/icann.org\/wicf"
;       ],
;       "links": [
;         {
;           "href": "https:\/\/icann.org\/wicf",
;           "type": "text\/html"
;         }
;       ]
;     }
;   ]
; }

Local $sValue
Local $sRel
Local $sHref
Local $sV_type
Local $strVal
Local $iJ
Local $iCount_j
Local $sIdentifier
Local $iK
Local $iCount_k
$oJson1 = ObjCreate("Chilkat.JsonObject")
Local $i1
Local $iCount_i1
Local $iJ1
Local $iCount_j1
Local $sEventAction
Local $sEventDate
Local $sTitle

Local $sObjectClassName = $oJson.StringOf("objectClassName")
Local $sHandle = $oJson.StringOf("handle")
Local $sLdhName = $oJson.StringOf("ldhName")
Local $bDelegationSigned = $oJson.BoolOf("secureDNS.delegationSigned")
Local $i = 0
Local $iCount_i = $oJson.SizeOfArray("links")
While $i < $iCount_i
    $oJson.I = $i
    $sValue = $oJson.StringOf("links[i].value")
    $sRel = $oJson.StringOf("links[i].rel")
    $sHref = $oJson.StringOf("links[i].href")
    $sV_type = $oJson.StringOf("links[i].type")
    $i = $i + 1
Wend
$i = 0
$iCount_i = $oJson.SizeOfArray("status")
While $i < $iCount_i
    $oJson.I = $i
    $strVal = $oJson.StringOf("status[i]")
    $i = $i + 1
Wend
$i = 0
$iCount_i = $oJson.SizeOfArray("entities")
While $i < $iCount_i
    $oJson.I = $i
    $sObjectClassName = $oJson.StringOf("entities[i].objectClassName")
    $sHandle = $oJson.StringOf("entities[i].handle")
    $iJ = 0
    $iCount_j = $oJson.SizeOfArray("entities[i].roles")
    While $iJ < $iCount_j
        $oJson.J = $iJ
        $strVal = $oJson.StringOf("entities[i].roles[j]")
        $iJ = $iJ + 1
    Wend
    $iJ = 0
    $iCount_j = $oJson.SizeOfArray("entities[i].publicIds")
    While $iJ < $iCount_j
        $oJson.J = $iJ
        $sV_type = $oJson.StringOf("entities[i].publicIds[j].type")
        $sIdentifier = $oJson.StringOf("entities[i].publicIds[j].identifier")
        $iJ = $iJ + 1
    Wend
    $iJ = 0
    $iCount_j = $oJson.SizeOfArray("entities[i].vcardArray")
    While $iJ < $iCount_j
        $oJson.J = $iJ
        $strVal = $oJson.StringOf("entities[i].vcardArray[j]")
        $iK = 0
        $iCount_k = $oJson.SizeOfArray("entities[i].vcardArray[j]")
        While $iK < $iCount_k
            $oJson.K = $iK
            $oJson.ObjectOf2("entities[i].vcardArray[j][k]",$oJson1)

            $i1 = 0
            $iCount_i1 = $oJson1.SizeOfArray("")
            While $i1 < $iCount_i1
                $oJson1.I = $i1
                $strVal = $oJson1.StringOf("[i]")
                $i1 = $i1 + 1
            Wend
            $iK = $iK + 1
        Wend
        $iJ = $iJ + 1
    Wend
    $iJ = 0
    $iCount_j = $oJson.SizeOfArray("entities[i].entities")
    While $iJ < $iCount_j
        $oJson.J = $iJ
        $sObjectClassName = $oJson.StringOf("entities[i].entities[j].objectClassName")
        $iK = 0
        $iCount_k = $oJson.SizeOfArray("entities[i].entities[j].roles")
        While $iK < $iCount_k
            $oJson.K = $iK
            $strVal = $oJson.StringOf("entities[i].entities[j].roles[k]")
            $iK = $iK + 1
        Wend
        $iK = 0
        $iCount_k = $oJson.SizeOfArray("entities[i].entities[j].vcardArray")
        While $iK < $iCount_k
            $oJson.K = $iK
            $strVal = $oJson.StringOf("entities[i].entities[j].vcardArray[k]")
            $oJson.ObjectOf2("entities[i].entities[j].vcardArray[k]",$oJson1)

            $i1 = 0
            $iCount_i1 = $oJson1.SizeOfArray("")
            While $i1 < $iCount_i1
                $oJson1.I = $i1
                $iJ1 = 0
                $iCount_j1 = $oJson1.SizeOfArray("[i]")
                While $iJ1 < $iCount_j1
                    $oJson1.J = $iJ1
                    $strVal = $oJson1.StringOf("[i][j]")
                    $iJ1 = $iJ1 + 1
                Wend
                $i1 = $i1 + 1
            Wend
            $iK = $iK + 1
        Wend
        $iJ = $iJ + 1
    Wend
    $i = $i + 1
Wend
$i = 0
$iCount_i = $oJson.SizeOfArray("events")
While $i < $iCount_i
    $oJson.I = $i
    $sEventAction = $oJson.StringOf("events[i].eventAction")
    $sEventDate = $oJson.StringOf("events[i].eventDate")
    $i = $i + 1
Wend
$i = 0
$iCount_i = $oJson.SizeOfArray("nameservers")
While $i < $iCount_i
    $oJson.I = $i
    $sObjectClassName = $oJson.StringOf("nameservers[i].objectClassName")
    $sLdhName = $oJson.StringOf("nameservers[i].ldhName")
    $i = $i + 1
Wend
$i = 0
$iCount_i = $oJson.SizeOfArray("rdapConformance")
While $i < $iCount_i
    $oJson.I = $i
    $strVal = $oJson.StringOf("rdapConformance[i]")
    $i = $i + 1
Wend
$i = 0
$iCount_i = $oJson.SizeOfArray("notices")
While $i < $iCount_i
    $oJson.I = $i
    $sTitle = $oJson.StringOf("notices[i].title")
    $iJ = 0
    $iCount_j = $oJson.SizeOfArray("notices[i].description")
    While $iJ < $iCount_j
        $oJson.J = $iJ
        $strVal = $oJson.StringOf("notices[i].description[j]")
        $iJ = $iJ + 1
    Wend
    $iJ = 0
    $iCount_j = $oJson.SizeOfArray("notices[i].links")
    While $iJ < $iCount_j
        $oJson.J = $iJ
        $sHref = $oJson.StringOf("notices[i].links[j].href")
        $sV_type = $oJson.StringOf("notices[i].links[j].type")
        $iJ = $iJ + 1
    Wend
    $i = $i + 1
Wend