Skip to content

This API provides access to Ahrefs' Domain Rating (DR) and Ahrefs Rank metrics for any valid domain or URL. The Domain Rating is a metric that shows the strength of a website's backlink profile compared to others in the Ahrefs database.

Notifications You must be signed in to change notification settings

OpenDataPoint/ahrefs_api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 

Repository files navigation

Ahrefs API πŸš€

This API provides access to Ahrefs' Domain Rating (DR) and Ahrefs Rank metrics for any valid domain or URL. The Domain Rating is a metric that shows the strength of a website's backlink profile compared to others in the Ahrefs database.

πŸ’ͺ Why our API?

  • ⚑ Lightning-Fast Performance: Average response time of < 450ms.
  • πŸ”„ High Reliability: Processing 30,000+ requests everyday.
  • πŸ’° Competitive Pricing: Cost-effective access to premium SEO data.
  • πŸ›‘οΈ Secure & Stable: Enterprise-grade infrastructure.
  • 🀝 Excellent Support: Quick response to queries and issues.
  • πŸ”Œ Simple Integration: Easy-to-use endpoints with clear documentation.

πŸ€” Why Use Ahrefs API?

  • πŸ“Š Access to high-quality SEO data and SERP analysis from Ahrefs.
  • πŸ”— Comprehensive backlink information and link building opportunities.
  • πŸ“ˆ Accurate domain metrics and organic traffic estimations.
  • πŸ”„ Real-time data updates for competitive intelligence.
  • πŸ› οΈ Easy integration with your existing SEO tools and workflows.

πŸ‘₯ Who Should Use the API?

  • πŸ–₯️ SEO tool developers and content optimization platforms.
  • πŸ“± Marketing software companies and growth hackers.
  • πŸ•΅οΈ Digital marketing agencies and online reputation management firms.
  • πŸ“Š Data analysts, researchers, and SEO consultants.
  • πŸš€ SaaS platforms focused on SEO, content marketing, and website performance.

Endpoint: DR & AR 🎯

Currently, the Ahrefs API offers one powerful endpoint for search engine optimization. This endpoint allows you to retrieve the Domain Rating (DR) and Ahrefs Rank (AR) for a specified domain.

GET https://ahrefs-api.p.rapidapi.com/check-dr-ar

πŸ“Š DR & AR

This endpoint provides two essential metrics for SEO analysis:

  1. Domain Rating (DR) πŸ†

    • Measures the strength of a website's backlink profile on a 100-point scale
    • Considers the "link juice" transfer and equal distribution among linked domains
    • Scaled to a 0-100 range for easy comparison of domain authority
  2. Ahrefs Rank (AR) πŸ…

    • Ranks websites based on the size and quality of their dofollow referring domains
    • Lower AR numbers indicate higher-quality backlink profiles and better search rankings

Use this endpoint to assess the authority and backlink strength of any domain, helping you make informed decisions for your SEO strategies, link-building campaigns, and competitor analysis.

Authentication πŸ”‘

Authentication is handled through RapidAPI. Include your RapidAPI key in the request headers:

  • x-rapidapi-host: ahrefs-api.p.rapidapi.com
  • x-rapidapi-key: your_rapid_api_key

Request Formatβœ¨πŸ“Š

Request Parameters πŸ“

Name Type Required Description
domain string Yes The domain to check (required)

Example Request πŸ’‘

curl --request GET \
--url 'https://ahrefs-api.p.rapidapi.com/check-dr-ar?domain=coder.com' \
--header 'x-rapidapi-host: ahrefs-api.p.rapidapi.com' \
--header 'x-rapidapi-key: your_rapid_api_key'

Response Format βœ¨πŸ“Š

The API returns a JSON object with the following properties:

Response ParametersπŸ“

Property Type Description
domain bool Whether request was successful
domain string The domain that was checked
domain_rating integer Domain Rating (DR) score (0-100)
ahrefs_rank integer Ahrefs Rank (AR) - lower numbers indicate higher rank

Example Response ✨

{
    "success": bool,
    "domain": "string",
    "domain_rating": float,
    "ahrefs_rank": integer
}

Example πŸ’‘

base

curl --request GET \
--url 'https://ahrefs-api.p.rapidapi.com/check-dr-ar?domain=facebook.com' \
--header 'x-rapidapi-host: ahrefs-api.p.rapidapi.com' \
--header 'x-rapidapi-key: fd3f1114b1msh3d69719929fe501p1f1b72jsn2432d43bd3d1'

Response

{
  "success": true,
  "domain": "facebook.com",
  "domain_rating": 100,
  "ahrefs_rank": 1
}

Important Notes ℹ️

  • Domain Rating is domain-based, not URL-based
  • Same DR applies to all subdomains and URLs of a domain
  • DR values above 4.9 are rounded to the nearest integer by Ahrefs
  • The API returns DR as a decimal value for precision
  • We're not affiliated with Ahrefs in anyway

Error Responses ⚠️

Status Code Error Code Description
400 INVALID_URL Invalid domain/URL format
502 RELAY_SERVICE_ERROR Temporary connection issue
503 CONNECTION_ERROR Unable to connect to Ahrefs
500 INTERNAL_SERVER_ERROR Unexpected server error

Error Response Format

{
    "success": false,
    "error": "ERROR_CODE",
    "details": "Error description message"
}

This endpoint provides a quick way to assess the authority and popularity of a domain in the eyes of Ahrefs πŸ†. Use it to compare websites, evaluate link prospects, or track your own domain's progress over time!

About

This API provides access to Ahrefs' Domain Rating (DR) and Ahrefs Rank metrics for any valid domain or URL. The Domain Rating is a metric that shows the strength of a website's backlink profile compared to others in the Ahrefs database.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published