This API allows you to check the availability of a domain name. The API supports both
GET
and POST
methods for making requests. Below is the documentation, including endpoints, parameters, and code examples in PHP and Python. Note: the apikey in this document will stop working. Replace the key with key found on your profile.
Base URL
- GET Method:
https://us.domainsduck.com/api/get/
- POST Method:
https://us.domainsduck.com/api/post/
Example
Visit this URL to see if the domain “example.com” is available:
https://us.domainsduck.com/api/get/?domain=example.com&apikey=///testkey///
Example response:
{"domain":"example.com", "availability":"false"}
Response Values
The API will return one of the following responses.
Successful response values
true
: The domain is available.false
: The domain is not available.premium domain
: This means the domain name is reserved by the registry but is available for registration at a premium price. Premium domains are often short or consists of some commercial highly competitive keyword.reserved
: This means the domain name has been blocked/reserved by the domain registry, you might not be able to register reserved domains, but in some cases you might be able to buy the domain from the registry.
Errors
rate limit exceeded
: The number of allowed API requests has been exceeded.bad tld
: The TLD is invalid or not supported.key invalid
: The API key is invalid.no permissions
: You are trying to access some functionality that your current plan does not support.out of credits
: You’ve used up all your available API requests.unknown error
: Unknown error.
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
domain |
string | Yes | The domain name to check (e.g., example.com ). |
apikey |
string | Yes | Your unique API key. |
whois |
bool | No | Include this parameter if you want to see WHOIS instead of availability. |
Usage
1. Using the GET Method
<?php
// PHP Example: GET Method
$domain = 'google.agency';
$apikey = '///testkey///';
$url = "https://us.domainsduck.com/api/get/?domain=$domain&apikey=$apikey";
$response = file_get_contents($url);
if ($response === false) {
die('Error occurred');
}
echo "API Response: " . $response;
# Python Example: GET Method
import requests
domain = 'google.agency'
apikey = '///testkey///'
url = f"https://us.domainsduck.com/api/get/?domain={domain}&apikey={apikey}"
response = requests.get(url)
if response.status_code == 200:
print(f"API Response: {response.text}")
else:
print(f"Error: {response.status_code}")
2. Using the POST Method (recommended)
<?php
$domain = 'ai90ege90ieg.com';
$apikey = '///testkey///';
$url = 'https://domankollen.se/api/post/';
$data = [
'domain' => $domain,
'apikey' => $apikey,
'rand' => rand(1000000000, 9999999999),
];
// Init curl
$ch = curl_init();
// Set curl options
curl_setopt_array($ch, [
CURLOPT_URL => $url,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => http_build_query($data),
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Content-Type: application/x-www-form-urlencoded',
],
]);
// Execute and fetch response
$response = curl_exec($ch);
// Check for errors
if ($response === false) {
die('Curl error: ' . curl_error($ch));
}
curl_close($ch);
echo "API Response: " . $response;
Notes
- Ensure your API key (
apikey
) is valid and active. - Random values like
rand
in the POST example are not required but can avoid caching issues. - If you encounter
"rate limit exceeded"
, consider reducing your request frequency.
For further questions or issues, contact support at [email protected].
WHOIS data
Include the GET/POST parameter “whois” to see the whois data. Example:
$url = "https://us.domainsduck.com/api/get/?domain=$domain&apikey=$apikey&whois=1";
Example response:
{ "DomainName": "GOOGLE.XYZ", "UpdatedDate": "2024-11-08T12:01:52+00:00", "CreationDate": "2014-05-20T12:04:51+00:00", "ExpiryDate": "2025-11-26T23:59:59+00:00", "Registrar": "MarkMonitor, Inc (TLDs)", "RegistrarAbuseEmail": "[email protected]", "RegistrarAbusePhone": "+1.2083895740", "NameServer": [ "NS1.GOOGLE.COM", "NS2.GOOGLE.COM", "NS3.GOOGLE.COM", "NS4.GOOGLE.COM" ], "Contacts": { "Registrant": { "Name": null, "Organization": "Google LLC", "Address": [], "City": null, "State": "CA", "PostalCode": null, "Country": "US", "Phone": null, "Fax": null, "Email": "Please query the RDDS service of the Registrar of Record identified in this output for information on how to contact the Registrant, Admin, or Tech contact of the queried domain name." }, "Admin": { "Name": null, "Organization": null, "Address": [], "City": null, "State": null, "PostalCode": null, "Country": null, "Phone": null, "Fax": null, "Email": "Please query the RDDS service of the Registrar of Record identified in this output for information on how to contact the Registrant, Admin, or Tech contact of the queried domain name." }, "Tech": { "Name": null, "Organization": null, "Address": [], "City": null, "State": null, "PostalCode": null, "Country": null, "Phone": null, "Fax": null, "Email": "Please query the RDDS service of the Registrar of Record identified in this output for information on how to contact the Registrant, Admin, or Tech contact of the queried domain name." }, "Billing": { "Name": null, "Organization": null, "Address": [], "City": null, "State": null, "PostalCode": null, "Country": null, "Phone": null, "Fax": null, "Email": "Please query the RDDS service of the Registrar of Record identified in this output for information on how to contact the Registrant, Admin, or Tech contact of the queried domain name." } }, "RawWhois": "Domain Name: GOOGLE.XYZ\r\nRegistry Domain ID: D2689447-CNIC\r\nRegistrar WHOIS Server: whois.markmonitor.com\r\nRegistrar URL:\r\nUpdated Date: 2024-11-08T12:01:52.0Z\r\nCreation Date: 2014-05-20T12:04:51.0Z\r\nRegistry Expiry Date: 2025-11-26T23:59:59.0Z\r\nRegistrar: MarkMonitor, Inc (TLDs)\r\nRegistrar IANA ID: 292\r\nDomain Status: clientTransferProhibited https://icann.org/epp#clientTransferProhibited\r\nDomain Status: clientUpdateProhibited https://icann.org/epp#clientUpdateProhibited\r\nDomain Status: clientDeleteProhibited https://icann.org/epp#clientDeleteProhibited\r\nRegistrant Organization: Google LLC\r\nRegistrant State/Province: CA\r\nRegistrant Country: US\r\nRegistrant Email: Please query the RDDS service of the Registrar of Record identified in this output for information on how to contact the Registrant, Admin, or Tech contact of the queried domain name.\r\nAdmin Email: Please query the RDDS service of the Registrar of Record identified in this output for information on how to contact the Registrant, Admin, or Tech contact of the queried domain name.\r\nTech Email: Please query the RDDS service of the Registrar of Record identified in this output for information on how to contact the Registrant, Admin, or Tech contact of the queried domain name.\r\nName Server: NS1.GOOGLE.COM\r\nName Server: NS2.GOOGLE.COM\r\nName Server: NS3.GOOGLE.COM\r\nName Server: NS4.GOOGLE.COM\r\nDNSSEC: unsigned\r\nBilling Email: Please query the RDDS service of the Registrar of Record identified in this output for information on how to contact the Registrant, Admin, or Tech contact of the queried domain name.\r\nRegistrar Abuse Contact Email: [email protected]\r\nRegistrar Abuse Contact Phone: +1.2083895740\r\nURL of the ICANN Whois Inaccuracy Complaint Form: https://www.icann.org/wicf/\r\n>>> Last update of WHOIS database: 2025-04-21T00:43:42.0Z > IMPORTANT INFORMATION ABOUT THE DEPLOYMENT OF RDAP: please visit\r\nhttps://www.centralnicregistry.com/support/information/rdap " }
RDAP data
For TLDs that have discontinued WHOIS support and transitioned to RDAP, this API will return RDAP data in the standard format (see example above). In such cases, the key “RawWhois” will be replaced by “RawRdap”.