Domain (gTLD) Data Feed
This data feed is meant only for trademark and malware analysis. Use of this feed data for any marketing purposes is fully prohibited. Please contact us for obtaining access to the data feed (requires a paid monthly subscription).
You can use the demo interface to better understand the API. This requires two keys that are provided to you after purchase.
Please send only one request to the server at a time. Your requests will fail if you send multiple simultaneous API calls.
API URL
Requests to our Domain API are sent to the following URL:
https://api.codepunch.com/dnfeed.php
Note that requests should be sent over https (secure socket) for security.
Authorization
To get started with the API you need to first send the access and secret keys. These are provided to you after purchase. After successful authentication you will receive a token key that can be used for further API calls.
https://api.codepunch.com/dnfeed.php?c=auth&k=xxxxxx&s=yyyyyy
xxxxxxx is your access key and yyyyyy is your secret key
If the authentication is successful, you should see...
OK: zzzzzzzzzz
Otherwise you will get...
Error: Access Denied
zzzzzzzz is the token you would use to make the rest of your API calls. You should make further calls only from the same IP address that was used for authorization.
Obtaining Domain Data
https://api.codepunch.com/dnfeed.php?t=zzzzzzz&d=20171215&f=text
The above will dump the domain names that were added on 2017-12-15 as a simple text list. Use the token obtained
after authorization as the t
parameter.
Output Formats
Use the f
parameter to specify the output format. The options are...
text,xml,raw and json
The default is json
Specifying the date
Use the d
parameter to specify the date in yyyymmdd format (20171218, 20180123, etc.)
If the d
parameter is absent, the current date will be applied. You can obtain the data
for up to 30 previous days.
Specifying Keywords
Use the kw
parameter to specify a keyword to search for. You can use % to find domains that start with, end with or contain keywords. For example,
&kw=apple% &kw=%apple &kw=%apple%
Important: Remember to URL encode the keywords that contain % (The % should be sent as %25).
Data Limits
The API will return only 2000 results at a time. You can use the start
and limit
parameters and multiple calls to obtain the full data.
https://api.codepunch.com/dnfeed.php?t=zzzzzzz&d=20171215&start=2000&limit=3000
The maximum allowable value for limit
parameter is 5000. Use the m=stats
parameter to obtain the total count first and the use multiple calls with different start
values to obtain the full data.
Obtaining Domain Counts
You can use the m
parameter set to stats
obtain only the domain counts.
https://api.codepunch.com/dnfeed.php?t=zzzzzz&d=20171217&m=stats
TLDs
Use z=xxx
to restrict results to a specific TLD. TLD should be in ASCII encoded format and not UNICODE. For example...
https://api.codepunch.com/dnfeed.php?t=zzzzzz&d=20171217&z=com
https://api.codepunch.com/dnfeed.php?t=zzzzzz&d=20171217&z=net
https://api.codepunch.com/dnfeed.php?t=zzzzzz&d=20171217&z=xn--czru2d
International Domain Names
Use idn=n
to restrict results based on IDN. For example...
https://api.codepunch.com/dnfeed.php?t=zzzzzz&d=20171217&idn=0
will return only non IDNs
https://api.codepunch.com/dnfeed.php?t=zzzzzz&d=20171217&idn=1
will return only IDNs
Latest ZIP files
Use c=latestzip
to download the latest ZIP file containing the domain names.
https://api.codepunch.com/dnfeed.php?t=zzzzzz&c=latestzip&src=added
will return the added domains
https://api.codepunch.com/dnfeed.php?t=zzzzzz&c=latestzip&src=deleted
will return the deleted domains
Use d=YYYYmmdd
to obtain the ZIP file for a specific date (up to 30 days prior). For example...
https://api.codepunch.com/dnfeed.php?t=zzzzzz&c=latestzip&src=added&d=20200712
Sample PHP Script-1
Here is a sample PHP script to download ZIP files.
<?php $accesskey = "paste_your_key_here"; $secretkey = "paste_your_secret_here"; // Authenticate and get token $url = "https://api.codepunch.com/dnfeed.php?c=auth&k=$accesskey&s=$secretkey"; $contents = file_get_contents($url); if($contents !== false) { if(substr($contents, 0, 3) == "OK:") { $token = trim(substr($contents,3)); // Construct URL and redirect $url = "https://api.codepunch.com/dnfeed.php?t=$token&c=latestzip"; if(isset($_REQUEST['deleted'])) $url .= "&src=deleted"; else $url .= "&src=added"; header("Location: $url"); } } ?>
Sample PHP Script-2
Find domains that contain the word 'paypal'
<?php ////////////////////////////////////////////////////////////////////////////// $accesskey = "your_api_key_here"; $secretkey = "your_secret_key_here"; ////////////////////////////////////////////////////////////////////////////// $dnfeedurl = "https://api.codepunch.com/dnfeed.php"; // Find domains that contain the word 'paypal' $keywords = "%paypal%"; ////////////////////////////////////////////////////////////////////////////// // Authenticate and get token $token = ""; $url = "$dnfeedurl?c=auth&k=$accesskey&s=$secretkey"; $contents = file_get_contents($url); if($contents !== false) { if(substr($contents, 0, 3) == "OK:") { $token = trim(substr($contents,3)); } } ////////////////////////////////////////////////////////////////////////////// // Get data $url = "$dnfeedurl?t=$token&kw={$keywords}&f=text"; $contents = file_get_contents($url); $domains = array_filter(explode("\n", $contents)); $count = 1; foreach($domains as $domain) echo $count++ . "] $domain<br>"; //////////////////////////////////////////////////////////////////////////////