Ahrefs API taps into the vast data reserves of Ahrefs, a robust SEO tool, to programmatically access insights into backlink profiles, keyword rankings, and SEO health. With Pipedream's capabilities, you can automate SEO monitoring, integrate with content management systems, trigger alerts for new or lost backlinks, or gather intelligence for keyword research—all without manual intervention. This unlocks the potential for real-time SEO strategy adjustments and the integration of SEO data into broader business processes or analytics platforms.
import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
ahrefs: {
type: "app",
app: "ahrefs",
}
},
async run({steps, $}) {
return await axios($, {
url: `https://apiv2.ahrefs.com`,
params: {
output: `json`,
token: `${this.ahrefs.$auth.oauth_access_token}`,
from: `subscription_info`,
},
})
},
})
Automated Backlink Monitoring: Set up a Pipedream workflow to monitor your site's backlink profile. Whenever Ahrefs detects new backlinks or lost links, Pipedream can trigger an event that updates a Google Sheet or sends a Slack message to your marketing team, keeping them informed and responsive to changes in your backlink landscape.
Content Strategy Optimization: Create a workflow where Pipedream regularly fetches keyword rankings for your target keywords from Ahrefs. Use this data to feed into a content management system, like WordPress, to suggest updates to existing content or ideas for new content based on current SEO performance and keyword opportunities.
Competitor Analysis Alerts: Leverage Ahrefs to keep an eye on competitors' SEO activities. Set up a Pipedream workflow to alert you via email or a messaging app such as Telegram when there are significant changes in your competitors' backlink profiles or keyword rankings. This instant intel can inform strategic decisions and help you maintain a competitive edge.
Get the backlinks for a domain or URL with details for the referring pages (e.g., anchor and page title).
Get one backlink with the highest ahrefs_rank
per referring domain for a target URL or domain (with details for the referring pages including anchor and page title).
Get the referring domains that contain backlinks to the target URL or domain.
Ahrefs uses OAuth authentication. When you connect your Ahrefs account, Pipedream will open a popup window where you can sign into Ahrefs and grant Pipedream permission to connect to your account. Pipedream securely stores and automatically refreshes the OAuth tokens so you can easily authenticate any Ahrefs API.
Pipedream requests the following authorization scopes when you connect your account:
api
GET
https://ahrefs.com/oauth2/authorize.php
?
client_id={{oauth.client_id}}
&
redirect_uri={{oauth.redirect_uri}}
&
state={{oauth.state}}
&
response_type=code
&
scope={{oauth.space_separated_scopes}}
POST
https://ahrefs.com/oauth2/token.php
accept: application/json
client_id={{oauth.client_id}}
&
client_secret={{oauth.client_secret}}
&
redirect_uri={{oauth.redirect_uri}}
&
grant_type=authorization_code
&
code={{oauth.code}}