Back

Ahrefs API Essential Guide

Aug 7, 20246 minute read

What type of API does Ahrefs provide?

Based on the search results provided, there is no specific information about what type of API Ahrefs uses. The search results contain general information about different API types like REST, GraphQL, and SOAP, but do not mention Ahrefs specifically.

Without more specific information about Ahrefs' API, it is not possible to definitively state what type of API they use. However, some general context can be provided:

Key Points to Consider

  • REST APIs are very common for web services and are often the default choice for many companies due to their simplicity and wide support.
  • GraphQL APIs have been gaining popularity in recent years, especially for services that need more flexible data querying.
  • SOAP APIs are older and less common for newer web services, but are still used in some enterprise environments.

Best Practices

To determine what type of API Ahrefs uses, the best approach would be to:

  1. Check Ahrefs' official API documentation, if available.
  2. Look for any developer resources or guides provided by Ahrefs.
  3. Contact Ahrefs' support or developer relations team directly to inquire about their API type.

Without specific information from Ahrefs, it is not possible to definitively state what type of API they use. If you need this information for a project or integration, it is recommended to reach out to Ahrefs directly for the most accurate and up-to-date details about their API.

Does the Ahrefs API have webhooks?

Based on the search results provided, the Ahrefs API does not appear to have webhooks. The key points are:

  1. The search results do not contain any information about webhooks in the Ahrefs API.

  2. Ahrefs offers API v2 (legacy) and API v3 (for Enterprise plans).

  3. The API documentation primarily covers various endpoints for retrieving data such as backlinks, metrics, domain ratings, etc.

  4. The API is accessed through HTTP GET requests to specific endpoints.

  5. There is information about API subscription plans and pricing, but no mention of webhook functionality.

Given the lack of information about webhooks in the official Ahrefs API documentation, it appears that the Ahrefs API does not currently offer webhook functionality. If you need real-time updates or event-based notifications from Ahrefs, you may need to implement polling mechanisms using the available API endpoints.

However, to get a definitive answer, it would be best to contact Ahrefs support directly or check their most up-to-date documentation, as the search results may not cover all aspects of their API offerings.

Rate Limits and other limitations

Based on the search results provided, here are the key points about the API rate limits for the Ahrefs API:

Rate Limits

  • The Ahrefs API has a rate limit of 300 requests per second across all their plans.

  • This 300 requests per second limit applies to their Free, Lite, Standard, Advanced, and Agency plans.

Credit System

  • Ahrefs uses a credit system for API usage:

    • Each Domain request costs 3 credits
    • Each URL request costs 4 credits

Monthly Credit Allocations

The monthly credit allocations for different plans are:

  • Free: 0 credits
  • Lite: 50,000 credits
  • Standard: 300,000 credits
  • Advanced: 1,000,000 credits
  • Agency: 5,000,000 credits

Key Considerations

  • The rate limit is quite high at 300 requests per second, which allows for significant usage even on lower tier plans.

  • The credit system means users need to be mindful of how many domain vs URL requests they make, as URL requests consume more credits.

  • Higher tier plans provide substantially more monthly credits, with the Agency plan offering 100x more credits than the Lite plan.

  • There is no free tier for API access - even the "Free" plan has 0 allocated credits.

Best Practices

  • Monitor credit usage closely to avoid unexpected overages.

  • Optimize requests to use domain-level queries where possible, as they consume fewer credits.

  • Consider upgrading plans if consistently hitting credit limits.

  • Implement rate limiting in your application to stay within the 300 requests/second limit.

It's worth noting that this information is for the legacy v2 API. Ahrefs has a newer v3 API, but details on its rate limits were not provided in the search results. For the most up-to-date and accurate information, it's recommended to check the official Ahrefs API documentation or contact their support team directly.

Latest API Version

The most recent version of the Ahrefs API is version 3 (v3). Here are the key points:

Latest API Version

  • The newest API version (v3) was released on September 7, 2022 [1].

  • It is available for Enterprise users only [1].

Legacy API Status

  • The legacy API (v2) was discontinued on March 1, 2024 [1][4].

  • Existing v2 integration apps continue to work, but new submissions are no longer accepted [4].

Switching to v3

  • To switch to API v3, users need to contact the Ahrefs Enterprise team [4].

Key Considerations

  • The information provided is for the legacy v2 API, which is no longer available for new users.

  • Enterprise users should reach out to Ahrefs to access the latest v3 API.

  • Existing v2 integrations continue to function, but no new integrations can be created using v2.

In summary, the most recent and currently supported version of the Ahrefs API is v3, available only to Enterprise users. The legacy v2 API has been discontinued for new users as of March 1, 2024.

How to get a Ahrefs developer account and API Keys?

To get a developer account for Ahrefs and create an API integration, you need to follow these steps:

Submitting an Application

  1. Visit the Ahrefs API Integrations page.

  2. Submit an application with a detailed description of your proposed app using the Submit Application Form.

  3. Wait for your application to be processed. Ahrefs may contact you if they need to clarify any details.

Integrating Authorization

Once your app is approved, you need to integrate authorization into your application:

  1. Use OAuth2 to integrate authorization into your application.

  2. There are two variants for integrating authorization, depending on whether you're building a web application or a desktop application.

  3. For web applications, you'll need to implement a multi-step process involving generating a state parameter, redirecting users, handling callbacks, and exchanging authorization codes for access tokens.

  4. For desktop applications, the process is similar but simplified, with the access token provided directly in the callback.

Setting Up the API

After authorization is integrated:

  1. Set up your application to use Ahrefs API data.

  2. Refer to the API Documentation for detailed information on how to make API calls and use the data.

What can you do with the Ahrefs API?

Based on the search results provided, here is a summary of the data models you can interact with using the Ahrefs API, along with what is possible for each:

Keyword Data

  • Pull metrics like search volume and Keyword Difficulty (KD) for individual keywords or lists of keywords
  • Retrieve the top 100 search results for keywords
  • Access granular keyword data with 77 response fields available
  • Pull metrics like referring domains and anchor text
  • Programmatically discover the best pages by links for any domain
  • Access very detailed backlink data with 77 response fields available in the Backlinks endpoint

Search Performance Data

  • Pull metrics like estimated organic traffic, Traffic Value, and paid search traffic
  • Retrieve a site's best pages by traffic
  • Access granular performance data

Site Explorer Data

  • Access data from Ahrefs' Site Explorer tool via API
  • Retrieve backlink profiles, keyword rankings, and SEO health metrics for domains

Subscription Information

  • Retrieve information about your Ahrefs API subscription

PageSpeed Insights Data (via integration)

  • Pull performance metrics like Core Web Vitals, Lighthouse metrics, and mobile issues when integrated with Ahrefs Site Audit

Google Search Console Data (via integration)

  • Access historical Google Search Console data beyond the 16-month limit when integrated with Ahrefs Rank Tracker

Key Capabilities

  • Powered by Ahrefs' large web crawler, providing extensive data
  • Offers more granular data compared to competitors
  • Easy to use with API button to instantly convert reports to API requests
  • Well-documented API with requests available in multiple languages
  • Can be integrated with other APIs and tools for expanded functionality

The Ahrefs API provides access to a wide range of SEO and website performance data, with a focus on keywords, backlinks, and search metrics. Its strength lies in the granularity and breadth of data available, powered by Ahrefs' extensive web crawler.