Any API for Ahrefs DR and RD metrics for bulk domain checks?

There exists plenty DR/PA checker online also bulk option available for free!
Just google it.
 
There exists plenty DR/PA checker online also bulk option available for free!
Just google it.
There are not plenty for sure as far as DR is concern. whatever available are not good for parallel requests. Perhaps you have tested any good?
 
Here's a simple Python script for v3 API (Python 3.11) that we wrote.

Loads the URLs from a text file and then checks for domain rating and metrical baselines - once done it exports URL, DR, Traffic and organic Keywords into a csv / txt.

You need Ahrefs API V3 access (Enterprise Plan only). So not really feasible for most, but still wanted to share.

Sample Response:

Code:
Domain Rating for wordcount.com: {'domain_rating': {'domain_rating': 47.0, 'ahrefs_rank': 916071}}
Traffic / Keywords for wordcount.com: {'metrics': {'org_keywords': 7822, 'paid_keywords': 0, 'org_keywords_1_3': 774, 'org_traffic': 323520, 'org_cost': 1349248, 'paid_traffic': 0, 'paid_cost': None, 'paid_pages': 0}}
Domain Rating for ahrefs.com: {'domain_rating': {'domain_rating': 91.0, 'ahrefs_rank': 940}}
Traffic / Keywords for ahrefs.com: {'metrics': {'org_keywords': 241199, 'paid_keywords': 374, 'org_keywords_1_3': 14969, 'org_traffic': 2934674, 'org_cost': 261697237, 'paid_traffic': 1319, 'paid_cost': 193120, 'paid_pages': 4}}

Script

Python:
import http.client
import json
import csv
import logging
from datetime import datetime

# Set up logging
logging.basicConfig(filename='error.log', level=logging.ERROR)

# Define Ahrefs API key
API_KEY = 'api key here'

headers = {
'Accept': "application/json, application/xml",
'Authorization': f"Bearer {API_KEY}"
}

# Get current date
current_date = datetime.now().strftime('%Y-%m-%d')

# Open URLs file
with open('sites.txt', 'r') as f:
urls = [line.strip() for line in f.readlines()]

# Define the output data
data = [['site', 'DR', 'Traffic', 'Keywords']]

# For each URL, get data from Ahrefs API
for url in urls:
 try:
conn = http.client.HTTPSConnection("api.ahrefs.com")

# Get domain rating
        conn.request("GET", f"/v3/site-explorer/domain-rating?target={url}&date={current_date}", headers=headers)
        res = conn.getresponse()
        domain_rating_data = json.loads(res.read())
domain_rating = domain_rating_data.get('domain_rating', {}).get('domain_rating', 0)

print(f"Domain Rating for {url}: {domain_rating_data}")

# Get traffic
        conn.request("GET", f"/v3/site-explorer/metrics?target={url}&date={current_date}", headers=headers)
        res = conn.getresponse()
        traffic_data = json.loads(res.read())
traffic = traffic_data.get('metrics', {}).get('org_traffic', 0)

# Get keywords
        conn.request("GET", f"/v3/site-explorer/metrics?target={url}&date={current_date}", headers=headers)
        res = conn.getresponse()
        keywords_data = json.loads(res.read())
keywords = keywords_data.get('metrics', {}).get('org_keywords', 0)

print(f"Traffic / Keywords for {url}: {traffic_data}")

        data.append([url, domain_rating, traffic, keywords])

except Exception as e:
logging.error(f"Error processing URL {url}: {str(e)}")

# Save data to csv file
try:
with open('output.csv', 'w', newline='') as f:
        writer = csv.writer(f)
        writer.writerows(data)
except Exception as e:
logging.error(f"Error while writing to csv file: {str(e)}")

# Save data to txt file
try:
with open('output.txt', 'w') as f:
writer = csv.writer(f, delimiter='\t')
        writer.writerows(data)
except Exception as e:
logging.error(f"Error while writing to txt file: {str(e)}")
 
I guess this is the one: https://rapidapi.com/ayushsomanime/api/ahrefs-dr-rank-checker

Still seems pretty stable, but rapidapi offerings can disappear pretty quickly.
Thanks!

maximum stealth )
better give a different name so you don't get banned by ahrefs
 
Yes, Ahrefs provides a Bulk Domain Rating (DR) and Referring Domains (RD) API for bulk domain checks.
 
Hi any API more cheap than Ahref or Semrush to fetch the tf/cf/RD ?
 
Hi any API more cheap than Ahref or Semrush to fetch the tf/cf/RD ?
Trying to build an API as a Service to get Moz, Ahref, Majestic & Semrush data for 100K credits for $49/month.

Let me know your credit consumption and I can share you the link....
 
We are trying to provide all the data in one go (Moz, Ahref, Majestic & Semrush)...
Good luck then. There are plenty of vendors on pay per use rather than on a subscription.
 
Good luck then. There are plenty of vendors on pay per use rather than on a subscription.
We can also do pay per use with 100k credit for $49, just starting API as a Service and would love to get all the help possible...
 
We can also do pay per use with 100k credit for $49, just starting API as a Service and would love to get all the help possible...
I am paying $3.5 for 100k today. Guess you need to work on your service offer.
 
I am paying $3.5 for 100k today. Guess you need to work on your service offer.
If you are talking about my-addr.com, you only get Semrush API for $3.5, Ahref is for $52, Plus they don't have Majestic data and suspending Moz data.
 
Last edited:
Back
Top