Integrations / Ahrefs
Ahrefs
SEO data from Ahrefs: domain rating, backlinks, organic keywords, top pages and API usage.
8 actions
API key
8 read0 write
Calls api.ahrefs.com
Connect
const conn = await setu.connections.initiate({ userId: "user_1", toolkit: "ahrefs" });
console.log(conn.connectUrl); // show this to your user
await conn.waitUntilActive();Permissions requested
This toolkit uses a single credential and requests no scopes.
Actions
Get backlinks statsreadahrefs.backlinks_statsGet live and all-time counts of backlinks and referring domains for a target on a date.
| Input | Type | Description | |
|---|---|---|---|
target | string | Required | Domain or URL to analyse, e.g. ahrefs.com |
date | string | Required | Date to report on, YYYY-MM-DD |
mode | string | Optional | Scope of the target (default subdomains) |
await setu.execute({
userId: "user_1",
action: "ahrefs.backlinks_stats",
input: {
"target": "<target>",
"date": "<date>"
},
});Get domain ratingreadahrefs.domain_ratingGet the Ahrefs Domain Rating and Ahrefs Rank of a domain or URL on a date.
| Input | Type | Description | |
|---|---|---|---|
target | string | Required | Domain or URL to analyse, e.g. ahrefs.com |
date | string | Required | Date to report on, YYYY-MM-DD |
await setu.execute({
userId: "user_1",
action: "ahrefs.domain_rating",
input: {
"target": "<target>",
"date": "<date>"
},
});Get subscription limits and usagereadahrefs.limits_and_usageGet the Ahrefs subscription plan, API unit limits and usage this month, and the API key expiry.
No input.
await setu.execute({
userId: "user_1",
action: "ahrefs.limits_and_usage",
input: {},
});List backlinksreadahrefs.list_backlinksList backlinks to a target. Choose columns with select, e.g. url_from,url_to,anchor,domain_rating_source.
| Input | Type | Description | |
|---|---|---|---|
target | string | Required | Domain or URL to analyse, e.g. ahrefs.com |
select | string | Required | Comma-separated columns to return |
limit | integer | Optional | Number of rows (default 1000) |
order_by | string | Optional | Column to order by, e.g. sum_traffic:desc |
mode | string | Optional | Scope of the target (default subdomains) |
aggregation | string | Optional | Grouping mode |
history | string | Optional | live, since:<date> or all_time (default all_time) |
await setu.execute({
userId: "user_1",
action: "ahrefs.list_backlinks",
input: {
"target": "<target>",
"select": "<select>"
},
});List organic keywordsreadahrefs.organic_keywordsList the keywords a target ranks for in organic search on a date, with positions, volumes and traffic.
| Input | Type | Description | |
|---|---|---|---|
target | string | Required | Domain or URL to analyse, e.g. ahrefs.com |
select | string | Required | Comma-separated columns to return |
limit | integer | Optional | Number of rows (default 1000) |
order_by | string | Optional | Column to order by, e.g. sum_traffic:desc |
mode | string | Optional | Scope of the target (default subdomains) |
date | string | Required | Date to report on, YYYY-MM-DD |
country | string | Optional | Two-letter country code to limit to |
await setu.execute({
userId: "user_1",
action: "ahrefs.organic_keywords",
input: {
"target": "<target>",
"select": "<select>",
"date": "<date>"
},
});List referring domainsreadahrefs.referring_domainsList domains that link to a target, with their Domain Rating and number of links.
| Input | Type | Description | |
|---|---|---|---|
target | string | Required | Domain or URL to analyse, e.g. ahrefs.com |
select | string | Required | Comma-separated columns to return |
limit | integer | Optional | Number of rows (default 1000) |
order_by | string | Optional | Column to order by, e.g. sum_traffic:desc |
mode | string | Optional | Scope of the target (default subdomains) |
history | string | Optional | live, since:<date> or all_time (default all_time) |
await setu.execute({
userId: "user_1",
action: "ahrefs.referring_domains",
input: {
"target": "<target>",
"select": "<select>"
},
});Get site metricsreadahrefs.site_metricsGet organic and paid search metrics for a target on a date: estimated traffic, keywords and traffic cost.
| Input | Type | Description | |
|---|---|---|---|
target | string | Required | Domain or URL to analyse, e.g. ahrefs.com |
date | string | Required | Date to report on, YYYY-MM-DD |
mode | string | Optional | Scope of the target (default subdomains) |
country | string | Optional | Two-letter country code to limit to |
await setu.execute({
userId: "user_1",
action: "ahrefs.site_metrics",
input: {
"target": "<target>",
"date": "<date>"
},
});List top pagesreadahrefs.top_pagesList a target's top pages by organic traffic on a date, with keyword counts and top keyword.
| Input | Type | Description | |
|---|---|---|---|
target | string | Required | Domain or URL to analyse, e.g. ahrefs.com |
select | string | Required | Comma-separated columns to return |
limit | integer | Optional | Number of rows (default 1000) |
order_by | string | Optional | Column to order by, e.g. sum_traffic:desc |
mode | string | Optional | Scope of the target (default subdomains) |
date | string | Required | Date to report on, YYYY-MM-DD |
country | string | Optional | Two-letter country code to limit to |
await setu.execute({
userId: "user_1",
action: "ahrefs.top_pages",
input: {
"target": "<target>",
"select": "<select>",
"date": "<date>"
},
});