Ahrefs API v2 has been discontinued
This documentation is for the legacy version of our API (v2), which you can no longer subscribe to. If you already have an active API v2 subscription, it will still work as before. Read about our latest API v3.
Documentation - anchors
Contains the anchor text and the number of backlinks, referring pages and referring domains that has it.
Each request to anchors costs 1 row.
Each result in the response costs 1 row.
Using 'where' costs 5 rows.
Using 'having' costs 5 rows.
• anchors
Column | Type | Where | Having | Description |
---|---|---|---|---|
anchor | string | + | + | Anchor text used in at least one backlink from the referring domain. |
backlinks | int | + | + | Number of external backlinks found that are using the anchor text. |
refpages | int | + | + | Number of pages found containing backlinks that are using the anchor text. |
refdomain | string | + | − | Referring domain that contains at least one backlink using the anchor text. |
refdomains | int | − | + | Number of referring domains that are using the anchor text when linking to the target. |
first_seen | date | + | + | Least recent date when the Ahrefs crawler was able to visit the backlink that is using the anchor text. |
last_visited | date | + | + | Most recent date when the Ahrefs crawler was able to visit the backlink that is using the anchor text. |
• stats
Column | Type | Where | Having | Description |
---|---|---|---|---|
backlinks | int | − | − | Total number of backlinks that are using the anchor. |
refpages | int | − | − | Total number of referring pages that are using the anchor. |
Examples
Request
https://apiv2.ahrefs.com?from=anchors&target=ahrefs.com&mode=domain&limit=2&output=json
Response
{ "anchors": [ { "anchor":"$11.99/month", "backlinks":2, "refpages":2, "refdomains":1, "first_seen":"2013-08-08T19:04:00Z", "last_visited":"2013-08-08T20:18:13Z" }, { "anchor":"$79/month to $499/month", "backlinks":2, "refpages":2, "refdomains":2, "first_seen":"2013-09-28T18:18:27Z", "last_visited":"2013-10-03T05:23:31Z" } ], "stats":{ "backlinks":2574830, "refpages":2560709 } }