Contact Us  Affiliates  FAQ  API Docs
Domain Rank Tracker

DomainRanx helps more than 880 happy customers and counting!


Sign Up Now      Sign In


API Documentation
This page is for software and application developers who want to integrate our Domain Stats Checking services into their own software or service!

The DomainRanx API provides an easy interface for programmers to embed our Domain Stats Checking functions in their own programs or online services directly.

In case You are in need of a test API Key to test Your code implementations and integration simply register Yourself an account (it is absolutely free to register) and then Contact Us to set Your account to a developer one!


API URL
http://api.domainranx.com/


GET / POST METHOD

You may use HTTP GET or HTTP POST methods when communicating with our API.


AUTHENTICATION

Our API is available only to registered customers subscribed to any of our plans! Our API accepts only authenticated requests by API Key. Every customer can find his API Key at the Dashboard


QUERIES

BALANCE Check user's remaining credits balance. Alternatively it can be used for checking if authentication is successful

QUERY PARAMETERS
Name Type Description
key string required User's API Key. Can be found at the Dashboard
func string required Function to be executed. For this query its value is checkcredits
callback=? string optional In case You are using Javascript and/or need to do a cross domain call, You can safely add this parameter to the query and receive back a JSONP response!

EXAMPLE
http://api.domainranx.com/?key=YOUR_API_KEY_HERE&func=checkcredits


CHECK DOMAIN Retrieve domain statistics

QUERY PARAMETERS
Name Type Description
key string required User's API Key. Can be found at the Dashboard
func string required Function to be executed. For this query its value is checkdomain
domain string required Domain name to be checked. It can be a domain or full URL address. Examples: domain.com
www.domain.com
http://www.domain.com/
http://www.domain.com/page.html
http://subdomain.domain.com/
majesticresult string optional At Majestic Our service checks http://domain.com, domain.com and www.domain.com at once. With this parameter You can specify which stats You want to get from Majestic. By default the property with highest TF is returned! If You wish something else use one of the values below:

  • highest - default Returns the stats for the property with the highest TF
  • url - Returns the Majestic stats for http://domain.com
  • root - Returns the Majestic stats for domain.com
  • subdomain - Returns the Majestic stats for www.domain.com
callback=? string optional In case You are using Javascript and/or need to do a cross domain call, You can safely add this parameter to the query and receive back a JSONP response!

EXAMPLE
http://api.domainranx.com/?key=YOUR_API_KEY_HERE&func=checkdomain&domain=google.com


RESPONSES

Our API Returns all responses in JSON encoded format!

When an error occurs, our API returns JSON with a key "ERROR" and a message describing the exact error

EXAMPLE
{"ERROR":"Authentication Failed - No such API Key!"}


If everything went fine, our API returns something like the following:
{"Moz_Rank":7.84,"Moz_Trust":7.36,"Moz_PA":96.56,"Moz_DA":100,"Moz_Backlinks":8766013,"Majestic_TF":"97","Majestic_CF":"96","Majestic_Backlinks":"5139377899","Majestic_Ref_Domains":"8489076","Ahrefs_Rank":8,"Ahrefs_Page_URL_Rating":92,"Ahrefs_Page_Backlinks":97000000,"Ahrefs_Page_Ref_Domains":351000,"Ahrefs_Domain_Rating":93,"Ahrefs_Domain_Backlinks":596000000,"Ahrefs_Domain_Ref_Domains":598000,"Google_Plus_One":0,"Facebook_Total":16148203,"Facebook_Shares":9837040,"Facebook_Likes":4103262,"Facebook_Comments":2207901,"Pinterest_Pins":0,"LinkedIn":11041}


To better understand the API if You still have any confusion simply check the example source codes provided for the various programming languages. Click on the tabs on top of this screen!

Having problems implementing Your code to use Our API? You discovered a bug in our API? Don't hesitate to Contact Us

Don't forget to Contact Us once You integrated our API into Your software or online service to do some link exchanges and cross promotion of our products for even greater audience!
You can use a simple HTML web form to get domain's statistics

Simply copy the HTML code below and paste it into a file named getstats.html for example

<form method="post" action="http://api.domainranx.com/">
API Key: <input type="hidden" name="key" value="YOUR_API_KEY_HERE">
Question: <input type="hidden" name="func" value="checkdomain">
Domain: <input type="text" name="domain" value="">
<input type="submit" value="Check">
</form>
You can use cross platform command line tool cURL to get domain's statistics

Check Integration / Get Balance
curl http://api.domainranx.com/ -F key=YOUR_API_KEY_HERE -F func=checkcredits


Check Domain
curl http://api.domainranx.com/ -F key=YOUR_API_KEY_HERE -F func=checkdomain -F domain="google.com"
Check Integration (function=balance)
<?php

$postData=array();
$postData['key']='YOUR_API_KEY_HERE';
$postData['func']='checkcredits';

$ch = curl_init();
curl_setopt($ch,CURLOPT_URL,'http://api.domainranx.com/');
curl_setopt($ch,CURLOPT_HEADER,0);
curl_setopt($ch,CURLOPT_POST,1);
curl_setopt($ch,CURLOPT_POSTFIELDS,$postData);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch,CURLOPT_FOLLOWLOCATION,1);
curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,5);
curl_setopt($ch,CURLOPT_TIMEOUT,30);
$response=curl_exec($ch);
curl_close($ch);

print_r(json_decode($response,true));
?>


Check Domain
<?php

$postData=array();
$postData['key']='YOUR_API_KEY_HERE';
$postData['func']='checkdomain';
$postData['question']=rawurlencode('google.com');

$ch = curl_init();
curl_setopt($ch,CURLOPT_URL,'http://api.domainranx.com/');
curl_setopt($ch,CURLOPT_HEADER,0);
curl_setopt($ch,CURLOPT_POST,1);
curl_setopt($ch,CURLOPT_POSTFIELDS,$postData);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch,CURLOPT_FOLLOWLOCATION,1);
curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,5);
curl_setopt($ch,CURLOPT_TIMEOUT,30);
$response=curl_exec($ch);
curl_close($ch);

print_r(json_decode($response,true));
?>
The following Python example requires the Requests module which is not a built in one and You need to manually install it.

#!/usr/bin/env python

import requests

api_url="http://api.domainranx.com/"
api_key="YOUR_API_KEY_HERE"

# FUNCTION TO CHECK INTEGRATION / BALANCE
def get_balance():
        global api_url,api_key;

        data = {"key": api_key, "func" : "checkcredits" }

        request = requests.post(api_url, data)

        return request.content
# FUNCTION TO CHECK INTEGRATION / BALANCE

# FUNCTION TO CHECK DOMAIN
def check_domain(domain=""):
        global api_url,api_key;

        data = {"key": api_key,
                "func" : "checkdomain",
                "domain": domain}

        request = requests.post(api_url, data)

        return request.content
# FUNCTION TO CHECK DOMAIN

# USAGE OF THE FUNCTIONS
balance = get_balance()
print(balance)

stats=check_domain("google.com")
print(stats)
The following Perl example works on Perl 5+ and requires the libwww-perl library installed

#!/usr/bin/perl

use warnings;
use strict;
use LWP::UserAgent;
use HTTP::Request::Common;

my $api_url='http://api.domainranx.com/';
my $api_key='YOUR_API_KEY_HERE';

# FUNCTION TO CHECK INTEGRATION / BALANCE
sub get_balance
{
        my $ua = LWP::UserAgent->new();
        my $response = $ua->request(POST $api_url, Content => [
                                 key => $api_key,
                                 func => 'checkcredits',
                                ]);

        if ($response->is_error())
        {
                return $response->status_line;
        } else {
                return $response->content();
        }
}
# FUNCTION TO CHECK INTEGRATION / BALANCE

# FUNCTION TO CHECK DOMAIN
sub check_domain
{
        my $ua = LWP::UserAgent->new();

        my $response = $ua->request(POST $api_url, Content => [
                                 key => $api_key,
                                 func => 'checkdomain',
                                 domain => $_[0],
                                ]);

        if ($response->is_error())
        {
                return $response->status_line;
        } else {
                return $response->content();
        }
}
# FUNCTION TO CHECK DOMAIN

# USAGE OF THE FUNCTIONS
printf get_balance();

printf "\n";

printf check_domain("google.com");
The example provided might not work "as is" for everyone due to the different .NET frameworks and different development environment.
You may need to tweak it!

Check Integration / Get Balance
Dim API_Key As String = "YOUR_API_KEY_HERE"

Dim Qstring As String = "key=" & API_Key & "&func=checkcredits"

Try
Dim wb As WebClient = New WebClient
wb.Proxy = Nothing
wb.UploadString("http://api.domainranx.com/", "POST", Qstring)
Catch ex As WebException
End Try


Check Domain
Dim API_Key As String = "YOUR_API_KEY_HERE"
Dim Domain As String="google.com"

Dim Qstring As String = "key=" & API_Key & "&func=checkdomain&domain=" & UrlEncode(Domain)

Try
Dim wb As WebClient = New WebClient
wb.Proxy = Nothing
wb.UploadString("http://api.domainranx.com/", "POST", Qstring)
Catch ex As WebException
End Try
The example provided might not work "as is" for everyone due to the different .NET frameworks and different development environment.
You may need to tweak it!

Check Integration / Get Balance
string API_Key = "YOUR_API_KEY_HERE";

string Qstring = "key=" + UrlEncode(API_Key) + "&func=checkcredits";

try {
WebClient wb = new WebClient();
wb.Proxy = null;
wb.UploadString("http://api.domainranx.com/", "POST", Qstring);
} catch (WebException ex) {
}


Check Domain
string API_Key = "YOUR_API_KEY_HERE";
string Domain="google.com";

string Qstring = "key=" + UrlEncode(API_Key) + "&func=checkdomain&domain=" + UrlEncode(Domain);

try {
WebClient wb = new WebClient();
wb.Proxy = null;
wb.UploadString("http://api.domainranx.com/", "POST", Qstring);
} catch (WebException ex) {
}