refdomains_by_type - Ahrefs API

Ahrefs API v2 will stop working on March 1st, 2024

This documentation is for the legacy version of our API (v2), which has been discontinued. All active API v2 subscriptions will stop working on March 1st, 2024. Existing Integration apps will continue to work as before until further notice, but new submissions are no longer accepted.

To switch from API v2 to v3, please contact our Enterprise team. Read about API v3.

Documentation - refdomains_by_type

Contains the referring domains that contain backlinks to the target.

Each request to refdomains_by_type costs 10 rows.
Each result in the response costs 1 row.
Using 'where' costs 10 rows.
Using 'having' costs 10 rows.

refdomains

Column Type Where Having Description
url string + Target of the request.
ip string + IP address of the referring domain that links to the target.
refdomain string + + The referring domain that contains at least one link to the target.
all bool + Set to true for referring domains that contain at least one backlink to the target.
text bool + Set to true for referring domains that contain at least one text backlink to the target.
image bool + Set to true for referring domains that contain at least one image backlink to the target.
nofollow bool + Set to true for referring domains that contain at least one nofollow backlink to the target.
dofollow bool + Set to true for referring domains that contain at least one dofollow backlink to the target.
redirect bool + Set to true for referring domains that contain at least one redirect backlink to the target.
canonical bool + Set to true for referring domains that contain at least one canonical backlink to the target.
gov bool + Set to true for referring domains that contain at least one backlink to the target from a governmental refdomain.
edu bool + Set to true for referring domains that contain at least one backlink to the target from an educational refdomain.
backlinks int + + Number of backlinks found in the referring domain that link to the target.
backlinks_dofollow int + + Number of dofollow backlinks found in the referring domain that link to the target.
refpages int + + Number of referring pages found in the referring domain that link to the target.
first_seen date + + Least recent date when the Ahrefs crawler was able to visit the backlinks in the referring domain.
last_visited date + + Most recent date when the Ahrefs crawler was able to visit the backlinks in the referring domain.
domain_rating int + Domain Rating of the referring domain.

stats

Column Type Where Having Description
refdomains int Total number of referring domains that contain at least one link to the target.
ips int Total number of IP addresses that link to the target.
class_c int Total number of referring class C networks that link to the target.
max_backlinks int Maximum number of backlinks that link to the target, among all of the targets.
max_refpages int Maximum number of refpages that link to the target, among all of the targets.
total_backlinks int Total number of backlinks that link to the target, among all of the targets.
total_backlinks_dofollow int Total number of dofollow backlinks that link to the target, among all of the targets.
all int Total amount of referring domains that contain at least one backlink to the target.
text int Total amount of referring domains that contain at least one text backlink to the target.
image int Total amount of referring domains that contain at least one image backlink to the target.
nofollow int Total amount of referring domains that contain at least one nofollow backlink to the target.
dofollow int Total amount of referring domains that contain at least one dofollow backlink to the target.
redirect int Total amount of referring domains that contain at least one redirect backlink to the target.
canonical int Total amount of referring domains that contain at least one canonical backlink to the target.
gov int Total amount of referring domains that contain at least one backlink to the target from a governmental refdomain.
edu int Total amount of referring domains that contain at least one backlink to the target from an educational refdomain.

tlds

Column Type Where Having Description
tld string Top-level domain name for which TLD statistics are provided.
count int Total amount of referring domains under the given TLD.

Examples



Request

https://apiv2.ahrefs.com?from=refdomains_by_type&target=ahrefs.com&mode=domain&limit=3&where=gov%3Dtrue&output=json

Response

{
  "refdomains":[
    {
      "refdomain":"anbg.gov.au",
      "refdomain_top":"anbg.gov.au",
      "backlinks":16,
      "backlinks_dofollow":8,
      "refpages":14,
      "first_seen":"2013-05-03T17:34:57Z",
      "last_visited":"2013-05-03T17:37:25Z",
      "domain_rating":64
    },
    {
      "refdomain":"bhgtj.gov.cn",
      "refdomain_top":"bhgtj.gov.cn",
      "backlinks":1,
      "backlinks_dofollow":0,
      "refpages":1,
      "first_seen":"2014-07-01T13:41:03Z",
      "last_visited":"2014-07-01T13:41:03Z",
      "domain_rating":46
    },
    {
      "refdomain":"bjfsh.gov.cn",
      "refdomain_top":"bjfsh.gov.cn",
      "backlinks":4,
      "backlinks_dofollow":1,
      "refpages":4,
      "first_seen":"2013-05-08T01:13:29Z",
      "last_visited":"2013-05-08T01:24:43Z",
      "domain_rating":61
    }
  ],
  "stats":{
    "refdomains":5,
    "ips":5960,
    "class_c":4293,
    "max_backlinks":16,
    "max_refpages":14,
    "total_backlinks":21,
    "total_backlinks_dofollow":9,
    "all":6502,
    "text":6127,
    "image":231,
    "nofollow":1927,
    "dofollow":4515,
    "redirect":220,
    "canonical":0,
    "gov":5,
    "edu":70
  },
  "tlds":[
    {
      "tld":"cn",
      "count":2
    },
    {
      "tld":"au",
      "count":1
    },
    {
      "tld":"ph",
      "count":1
    },
    {
      "tld":"vn",
      "count":1
    }
  ]
}