Ahrefs API v2 has been deprecated
This documentation is for the legacy version of our API (v2), which was discontinued on March 1st, 2024. Existing API v2 integration apps are not affected and continue to work as before, but new submissions are no longer accepted.
To switch to API v3, please contact our Enterprise team. Read about API v3.
Documentation - linked_domains_by_type
Contains the external domains that the target has links to.
Each request to linked_domains_by_type costs 10 rows.
Each result in the response costs 1 row.
Using 'where' costs 10 rows.
Using 'having' costs 10 rows.
• domains
Column | Type | Where | Having | Description |
---|---|---|---|---|
domain_from | string | + | + | Target of the request. |
domain_to | string | + | + | Root of external domain that has links from the target. |
links | int | − | + | Number of external links from the target that link to the external domain. |
all | int | − | + | Number of external links from the target that link to the external domain. |
text | int | − | + | Number of text external links from the target. |
image | int | − | + | Number of image external links from the target. |
nofollow | int | − | + | Number of NoFollow external links from the target. |
dofollow | int | − | + | Number of DoFollow external links from the target. |
redirect | int | − | + | Number of redirection external links from the target. |
canonical | int | − | + | Number of canonical external links from the target. |
gov | int | − | + | Number of external links from the target to governmental domain. |
edu | int | − | + | Number of external links from the target to educational domain. |
rss | int | − | + | Number of RSS external links from the target. |
alternate | int | − | + | Number of alternate external links from the target. |
first_seen | date | + | + | Least recent date when the Ahrefs crawler was able to see the link on the target. |
last_visited | date | + | + | Most recent date when the Ahrefs crawler was able to see the link on the target. |
domain_to_rating | int | − | + | Domain Rating of the external domain. |
domain_to_ahrefs_top | int | − | + | Ahrefs rank of the external domain. |
Examples
Request
https://apiv2.ahrefs.com?from=linked_domains_by_type&target=ahrefs.com&mode=domain&limit=3&where=gov%3E0&output=json
Response
{ "domains": [{ "domain_from": "ahrefs.com", "domain_to": "fightspam.gc.ca", "domain_to_top": "fightspam.gc.ca", "links": 1, "all": 1, "text": 1, "image": 0, "nofollow": 0, "dofollow": 1, "redirect": 0, "canonical": 0, "gov": 1, "edu": 0, "rss": 0, "alternate": 0, "first_seen": "2015-12-20T03:07:25Z", "last_visited": "2016-07-17T23:48:13Z", "domain_to_rating": 63, "domain_to_ahrefs_top": 20041 }, { "domain_from": "ahrefs.com", "domain_to": "uspto.gov", "domain_to_top": "uspto.gov", "links": 3, "all": 3, "text": 3, "image": 0, "nofollow": 0, "dofollow": 3, "redirect": 0, "canonical": 0, "gov": 3, "edu": 0, "rss": 0, "alternate": 0, "first_seen": "2015-12-10T09:08:49Z", "last_visited": "2016-07-31T09:15:14Z", "domain_to_rating": 74, "domain_to_ahrefs_top": 747 }, { "domain_from": "ahrefs.com", "domain_to": "irs.gov", "domain_to_top": "irs.gov", "links": 2, "all": 2, "text": 2, "image": 0, "nofollow": 0, "dofollow": 2, "redirect": 0, "canonical": 0, "gov": 2, "edu": 0, "rss": 0, "alternate": 0, "first_seen": "2015-11-29T16:54:24Z", "last_visited": "2016-07-31T07:00:59Z", "domain_to_rating": 78, "domain_to_ahrefs_top": 225 }], "stats": { "linked_domains": 5, "all": 5, "text": 5, "image": 0, "nofollow": 2, "dofollow": 3, "redirect": 0, "canonical": 0, "gov": 5, "edu": 0, "rss": 0, "alternate": 0, "max_links": 3, "max_links_dofollow": 3, "total_links": 9, "total_links_dofollow": 6 }, "tlds": [{ "tld": "gov", "count": 3 }, { "tld": "ca", "count": 1 }, { "tld": "cn", "count": 1 }] }