### GET /v3/keywords-explorer/overview Source: https://docs.ahrefs.com/api/docs/free-test-queries Provides an overview of keyword metrics. Requests are free when using only 'ahrefs' or 'wordcount' as keywords. ```APIDOC ## GET /v3/keywords-explorer/overview ### Description Provides metrics such as volume and difficulty for a keyword. Free if the keyword is exactly 'ahrefs' or 'wordcount'. ### Method GET ### Endpoint https://api.ahrefs.com/v3/keywords-explorer/overview ### Parameters #### Query Parameters - **keywords** (string) - Required - The keyword to analyze - **country** (string) - Required - The country code - **select** (string) - Optional - Fields to return ### Request Example https://api.ahrefs.com/v3/keywords-explorer/overview?country=us&keywords=ahrefs&select=keyword,volume,traffic_potential,difficulty ### Response #### Success Response (200) - **keyword** (string) - The keyword analyzed - **volume** (integer) - Search volume ``` -------------------------------- ### Keywords Explorer/SERP Overview Paid Queries (Mixed/List ID) Source: https://docs.ahrefs.com/api/docs/free-test-queries Shows examples of requests to Keywords Explorer and SERP Overview endpoints that will consume API units. This includes queries with multiple keywords (e.g., 'ahrefs,yep') or when a 'keyword_list_id' is specified, regardless of the keywords used. ```http https://api.ahrefs.com/v3/keywords-explorer/overview?country=us&keywords=ahrefs,yep&select=keyword,volume,traffic_potential,difficulty https://api.ahrefs.com/v3/keywords-explorer/overview?country=us&keywords=ahrefs&keywords_list_id=123&select=keyword,volume,traffic_potential,difficulty ``` -------------------------------- ### Basic Field Filtering Examples Source: https://docs.ahrefs.com/api/docs/filter-syntax Demonstrates how to apply simple equality filters and access nested fields using dot notation within the Ahrefs API 'where' parameter. ```json { "field": "foo", "is": ["eq", 3] } { "field": "foo.bar", "is": ["eq", 3] } ``` -------------------------------- ### API Filter Syntax Reference Source: https://docs.ahrefs.com/api/docs/filter-syntax Comprehensive guide on using the 'where' parameter to filter API result sets using logical operators and field conditions. ```APIDOC ## Filter Syntax for API v3 ### Description Many Ahrefs API endpoints support a `where` parameter to filter result sets. This syntax allows for complex boolean logic, nested field access, and various comparison operators. ### Method GET/POST (as part of query parameters or request body) ### Parameters #### Query Parameters - **where** (object) - Optional - A JSON object defining the filter criteria based on the provided grammar. ### Request Example { "field": "foo", "is": ["eq", 3] } ### Grammar Reference - ``: Logical grouping using "and", "or", or "not". - ``: A filter expression containing a `field` and a condition (`is` or `list_is`). - ``: Comparison operators such as "eq", "gt", "lt", "regex", etc. - ``: Operations for array fields using "any" or "all" logic. ### Response #### Success Response (200) - **data** (array) - The filtered list of results matching the criteria. ``` -------------------------------- ### GET /v3/batch-analysis Source: https://docs.ahrefs.com/api/docs/introduction Retrieves metrics for multiple targets in a single request, supporting up to 100 targets per call. ```APIDOC ## GET /v3/batch-analysis ### Description Retrieves performance metrics and data for up to 100 targets simultaneously. ### Method GET ### Endpoint /v3/batch-analysis ### Parameters #### Query Parameters - **targets** (string) - Required - Comma-separated list of URLs or domains to analyze. - **fields** (string) - Optional - Specific metrics to return in the response. ### Request Example GET /v3/batch-analysis?targets=ahrefs.com,google.com&fields=domain_rating,backlinks ### Response #### Success Response (200) - **results** (array) - List of objects containing metrics for each requested target. #### Response Example { "results": [ {"target": "ahrefs.com", "domain_rating": 92, "backlinks": 150000000} ] } ``` -------------------------------- ### GET /v3/site-explorer/domain-rating Source: https://docs.ahrefs.com/api/docs/free-test-queries Retrieves the domain rating for a target domain. Requests are free when targeting ahrefs.com or wordcount.com. ```APIDOC ## GET /v3/site-explorer/domain-rating ### Description Retrieves the domain rating for a specified target. This request is free if the target is ahrefs.com or wordcount.com. ### Method GET ### Endpoint https://api.ahrefs.com/v3/site-explorer/domain-rating ### Parameters #### Query Parameters - **target** (string) - Required - The domain to analyze (e.g., wordcount.com) - **date** (string) - Optional - The date for the data snapshot ### Request Example https://api.ahrefs.com/v3/site-explorer/domain-rating?date=2023-05-18&target=wordcount.com ### Response #### Success Response (200) - **domain_rating** (integer) - The domain rating value ``` -------------------------------- ### Keywords Explorer/SERP Overview Free Queries ('ahrefs'/'wordcount') Source: https://docs.ahrefs.com/api/docs/free-test-queries Illustrates how to perform free test queries for Keywords Explorer and SERP Overview endpoints by using 'ahrefs' or 'wordcount' in the 'keywords' or 'keyword' parameters. Requests with these specific keywords do not consume API units, provided no 'keyword_list_id' is specified. The 'limit' parameter is capped at 100 results for free requests. ```http https://api.ahrefs.com/v3/keywords-explorer/overview?country=us&keywords=ahrefs&select=keyword,volume,traffic_potential,difficulty https://api.ahrefs.com/v3/serp-overview/serp-overview?country=us&date=2023-05-16&keyword=wordcount&select=url,position,url_rating,backlinks,traffic&top_positions=3 ``` -------------------------------- ### Site Explorer Free Queries (ahrefs.com/wordcount.com) Source: https://docs.ahrefs.com/api/docs/free-test-queries Demonstrates how to make free test queries for Site Explorer endpoints by using 'ahrefs.com' or 'wordcount.com' domains in the 'target' parameter. These requests do not consume API units. The 'limit' parameter is capped at 100 results for free requests. ```http https://api.ahrefs.com/v3/site-explorer/domain-rating?date=2023-05-18&target=wordcount.com https://api.ahrefs.com/v3/site-explorer/all-backlinks?limit=3&mode=prefix&target=ahrefs.com/blog&select=url_from,url_rating_source,traffic,url_to ``` -------------------------------- ### APIv3 - Site Explorer Overview Source: https://docs.ahrefs.com/api/docs/changelog Provides an overview of a website's SEO metrics using APIv3. ```APIDOC ## GET /site-explorer/overview ### Description This endpoint provides a high-level overview of a website's SEO performance, including metrics like Domain Rating, URL Rating, and estimated traffic. ### Method GET ### Endpoint /site-explorer/overview ### Parameters #### Query Parameters - **url** (string) - Required - The URL of the website to analyze. ### Request Example ```json { "url": "https://example.com" } ``` ### Response #### Success Response (200) - **domain_rating** (integer) - The Domain Rating of the website. - **url_rating** (integer) - The URL Rating of the homepage. - **estimated_monthly_traffic** (integer) - Estimated monthly organic traffic. #### Response Example ```json { "domain_rating": 92, "url_rating": 75, "estimated_monthly_traffic": 150000 } ``` ``` -------------------------------- ### Creating and Managing API Keys Source: https://docs.ahrefs.com/api/docs/api-keys-creation-and-management API keys can be created and managed within the Account settings under the 'API keys' section. Only workspace owners and admins have access to this functionality. ```APIDOC ## Creating and Managing API Keys ### Description API keys are created and managed in the Account settings / API keys section. Each key has a 1-year lifetime and can be invalidated if the user who created it is removed from the workspace. Up to 1,000 API keys can be created per workspace. ### Access Workspace owners and admins only. ### Key Lifetime 1 year ### Key Limit 1,000 per workspace ``` -------------------------------- ### Keyword Explorer - KE Overview and Keyword Ideas Enhancements Source: https://docs.ahrefs.com/api/docs/changelog Updates to KE Overview and Keyword Ideas endpoints, including new filtering and data fields. ```APIDOC ## GET /keyword-explorer/overview ## GET /keyword-explorer/ideas ### Description These endpoints have been enhanced with new features for more granular keyword analysis. You can now filter by target ranking position, utilize empty keywords parameter for target-based queries, and access mobile/desktop search volume distribution and monthly volumes. ### Method GET ### Endpoint /keyword-explorer/overview /keyword-explorer/ideas ### Parameters #### Query Parameters - **keywords** (string[]) - Optional - List of keywords to analyze. Can be empty if `target_position` is specified. - **target** (string) - Optional - The target domain to analyze keywords for. - **target_mode** (string) - Optional - Mode for target filtering (e.g., 'ranking'). - **target_position** (integer) - Optional - The ranking position to filter keywords by. - **volume_desktop_pct** (boolean) - Optional - Include desktop search volume percentage. - **volume_mobile_pct** (boolean) - Optional - Include mobile search volume percentage. - **volume_monthly** (boolean) - Optional - Include monthly search volume. ### Request Example ```json { "keywords": ["seo audit checklist"], "target": "example.com", "target_mode": "ranking", "target_position": 10, "volume_monthly": true } ``` ### Response #### Success Response (200) - **keyword** (string) - The keyword. - **volume_monthly** (integer) - Monthly search volume. - **volume_desktop_pct** (float) - Percentage of searches from desktop. - **volume_mobile_pct** (float) - Percentage of searches from mobile. - **intents** (string[]) - Search intents for the keyword. #### Response Example ```json [ { "keyword": "seo audit checklist", "volume_monthly": 500, "volume_desktop_pct": 60.5, "volume_mobile_pct": 39.5, "intents": ["informational", "navigational"] } ] ``` ``` -------------------------------- ### Rank Tracker API - Competitors Overview Source: https://docs.ahrefs.com/api/docs/changelog Provides rankings and estimated traffic for competitors based on tracked keywords. ```APIDOC ## GET /rank-tracker/competitors-overview ### Description Retrieves rankings and estimated traffic for competitors based on the keywords you track, similar to the Competitors Overview report in Rank Tracker. ### Method GET ### Endpoint /rank-tracker/competitors-overview ### Parameters #### Query Parameters - **keywords** (string[]) - Required - List of keywords to track. - **competitors** (string[]) - Required - List of competitor domains. ### Request Example ```json { "keywords": ["example.com", "another.com"], "competitors": ["competitor1.com", "competitor2.com"] } ``` ### Response #### Success Response (200) - **keyword** (string) - The tracked keyword. - **competitor** (string) - The competitor domain. - **rank** (integer) - The competitor's ranking for the keyword. - **estimated_traffic** (float) - Estimated monthly traffic from the keyword. #### Response Example ```json [ { "keyword": "best seo tools", "competitor": "competitor1.com", "rank": 3, "estimated_traffic": 1500.50 } ] ``` ``` -------------------------------- ### Authentication and Rate Limiting Source: https://docs.ahrefs.com/api/docs/introduction Information on how to authenticate requests and handle rate limits. ```APIDOC ## Authentication and Rate Limiting ### Description Details on how to authenticate using API keys and manage API request limits. ### Authentication - **Header**: Authorization: Bearer ### Rate Limiting - **Default Limit**: 60 requests per minute. - **Status Code**: 429 (Too Many Requests) is returned when limits are exceeded or throttling occurs. ### Best Practices - Use test queries for development to avoid consuming paid API units. - Set limits on API keys within the Account settings. ``` -------------------------------- ### APIv3 - Referring Domains Source: https://docs.ahrefs.com/api/docs/changelog Retrieves a list of referring domains for a specified URL using API -------------------------------- ### Rank Tracker Overview API Source: https://docs.ahrefs.com/api/docs/changelog Provides an overview of rankings for the Rank Tracker report. ```APIDOC ## GET /rank-tracker/overview ### Description This endpoint provides an overview of rankings within the Rank Tracker report. ### Method GET ### Endpoint /rank-tracker/overview ### Parameters #### Query Parameters - **project_id** (string) - Required - The ID of the Rank Tracker project. - **keywords** (string[]) - Optional - Filter by specific keywords. ### Request Example ```json { "project_id": "your_project_id", "keywords": ["keyword1", "keyword2"] } ``` ### Response #### Success Response (200) - **keyword** (string) - The keyword. - **rank** (integer) - The current rank for the keyword. - **previous_rank** (integer) - The previous rank for the keyword. - **change** (integer) - The change in rank. #### Response Example ```json [ { "keyword": "example keyword", "rank": 5, "previous_rank": 7, "change": 2 } ] ``` ``` -------------------------------- ### SERP Overview API Source: https://docs.ahrefs.com/api/docs/changelog Provides an overview of the Search Engine Results Page (SERP) for a given keyword. ```APIDOC ## GET /serp/overview ### Description This endpoint returns an overview of the SERP for a specified keyword, including top-ranking pages and their metrics. ### Method GET ### Endpoint /serp/overview ### Parameters #### Query Parameters - **keyword** (string) - Required - The keyword to get SERP overview for. ### Request Example ```json { "keyword": "best seo tools" } ``` ### Response #### Success Response (200) - **rank** (integer) - The ranking position. - **url** (string) - The URL of the ranking page. - **title** (string) - The title of the ranking page. - **domain_rating** (integer) - The Domain Rating of the page's domain. #### Response Example ```json [ { "rank": 1, "url": "https://example.com/page1", "title": "Top SEO Tools Review", "domain_rating": 95 } ] ``` ``` -------------------------------- ### Limits and Usage API Source: https://docs.ahrefs.com/api/docs/changelog Provides information about your subscription limits and API usage. ```APIDOC ## GET /subscription/usage ### Description This endpoint details your current API subscription limits and tracks your usage against those limits. ### Method GET ### Endpoint /subscription/usage ### Parameters None ### Request Example ```json {} ``` ### Response #### Success Response (200) - **limit_daily_queries** (integer) - Your daily API query limit. - **used_daily_queries** (integer) - Queries used today. - **limit_monthly_units** (integer) - Your monthly API unit limit. - **used_monthly_units** (integer) - Units used this month. #### Response Example ```json { "limit_daily_queries": 10000, "used_daily_queries": 1500, "limit_monthly_units": 500000, "used_monthly_units": 250000 } ``` ``` -------------------------------- ### Keywords Explorer - Single Keyword Metrics Source: https://docs.ahrefs.com/api/docs/changelog Retrieves key metrics for a single keyword. ```APIDOC ## GET /keywords-explorer/metrics ### Description This endpoint provides detailed metrics for a single keyword, including search volume, keyword difficulty, and CPC. ### Method GET ### Endpoint /keywords-explorer/metrics ### Parameters #### Query Parameters - **keyword** (string) - Required - The keyword to get metrics for. ### Request Example ```json { "keyword": "content marketing" } ``` ### Response #### Success Response (200) - **keyword** (string) - The analyzed keyword. - **search_volume** (integer) - Monthly search volume. - **keyword_difficulty** (integer) - Keyword Difficulty score. - **cpc** (float) - Cost Per Click in USD. #### Response Example ```json { "keyword": "content marketing", "search_volume": 8000, "keyword_difficulty": 65, "cpc": 2.50 } ``` ``` -------------------------------- ### Batch Analysis API Source: https://docs.ahrefs.com/api/docs/changelog Allows bulk retrieval of selected metrics for multiple URLs and domains. ```APIDOC ## POST /batch-analysis ### Description This endpoint enables you to pull selected metrics for a batch of URLs and domains efficiently. ### Method POST ### Endpoint /batch-analysis ### Parameters #### Request Body - **items** (array) - Required - A list of URLs or domains to analyze. - **url** (string) - Required - The URL or domain. - **metrics** (string[]) - Required - List of metrics to retrieve (e.g., 'ahrefs_rank', 'domain_rating', 'url_rating'). ### Request Example ```json { "items": [ { "url": "https://example.com", "metrics": ["domain_rating", "url_rating"] }, { "url": "https://anotherdomain.org", "metrics": ["ahrefs_rank", "domain_rating"] } ] } ``` ### Response #### Success Response (200) - **url** (string) - The analyzed URL or domain. - **metrics** (object) - An object containing the requested metrics and their values. #### Response Example ```json [ { "url": "https://example.com", "metrics": { "domain_rating": 92.5, "url_rating": 75.2 } }, { "url": "https://anotherdomain.org", "metrics": { "ahrefs_rank": 15000, "domain_rating": 88.1 } } ] ``` ``` -------------------------------- ### Keywords Explorer - Volume by Country Source: https://docs.ahrefs.com/api/docs/changelog Retrieves search volume for a keyword, broken down by country. ```APIDOC ## GET /keywords-explorer/volume-by-country ### Description This endpoint shows the search volume distribution for a keyword across different countries. ### Method GET ### Endpoint /keywords-explorer/volume-by-country ### Parameters #### Query Parameters - **keyword** (string) - Required - The keyword to get country-specific volume for. ### Request Example ```json { "keyword": "digital marketing" } ``` ### Response #### Success Response (200) - **country** (string) - The country name. - **volume** (integer) - The search volume from that country. #### Response Example ```json [ { "country": "United States", "volume": 10000 }, { "country": "United Kingdom", "volume": 3000 } ] ``` ``` -------------------------------- ### Matching Terms API Source: https://docs.ahrefs.com/api/docs/changelog Retrieves terms that match a given keyword pattern. ```APIDOC ## GET /keywords-explorer/matching-terms ### Description This endpoint returns keywords that contain or match a specified pattern or keyword. ### Method GET ### Endpoint /keywords-explorer/matching-terms ### Parameters #### Query Parameters - **keyword** (string) - Required - The keyword or pattern to match against. ### Request Example ```json { "keyword": "keyword" } ``` ### Response #### Success Response (200) - **keyword** (string) - A matching keyword. - **search_volume** (integer) - The monthly search volume for the matching keyword. #### Response Example ```json [ { "keyword": "keyword research", "search_volume": 5000 }, { "keyword": "keyword difficulty", "search_volume": 3000 } ] ``` ``` -------------------------------- ### Logical Operator Filtering Source: https://docs.ahrefs.com/api/docs/filter-syntax Shows how to combine multiple conditions using logical 'and' and 'or' operators, including the use of field modifiers and array list conditions. ```json { "and": [ { "field": "foo", "is": ["eq", 3] }, { "field": "bar", "is": ["lt", 10] } ] } { "or": [ { "field": "foo", "modifier": "uppercase", "is": ["eq", "AHREFS"] }, { "field": "bar", "list_is": { "and": [ ["prefix", "Ahrefs"], ["suffix", "seo"] ] } } ] } ``` -------------------------------- ### Controlling API Usage Source: https://docs.ahrefs.com/api/docs/api-keys-creation-and-management You can control the monthly usage of API units by setting limits for individual API keys or by managing pay-as-you-go settings in Account settings. ```APIDOC ## Controlling API Usage ### Description API key usage can be controlled through Account settings. You can limit the monthly API units consumed by specific keys. If your subscription includes pay-as-you-go, you can also set limits or disable pay-as-you-go units. ### Settings Location Account settings / API keys Account settings / Limits & usage (for pay-as-you-go) ### Features - Limit usage of particular API keys. - Limit maximum pay-as-you-go API units. - Disable pay-as-you-go API units. ``` -------------------------------- ### APIv3 - Backlinks Source: https://docs.ahrefs.com/api/docs/changelog Retrieves a list of backlinks pointing to a specified URL using APIv3. ```APIDOC ## GET /site-explorer/backlinks ### Description This endpoint returns a list of backlinks pointing to a given URL, including details about the referring page, anchor text, and referring domain. ### Method GET ### Endpoint /site-explorer/backlinks ### Parameters #### Query Parameters - **url** (string) - Required - The URL to find backlinks for. ### Request Example ```json { "url": "https://example.com" } ``` ### Response #### Success Response (200) - **source_url** (string) - The URL of the page linking to the target. - **anchor_text** (string) - The anchor text used. - **referring_domain_rating** (integer) - The Domain Rating of the referring domain. #### Response Example ```json [ { "source_url": "https://referring.com/article", "anchor_text": "great resource", "referring_domain_rating": 80 } ] ``` ``` -------------------------------- ### Search Suggestions API Source: https://docs.ahrefs.com/api/docs/changelog Retrieves search suggestions for a given keyword. ```APIDOC ## GET /keywords-explorer/search-suggestions ### Description This endpoint provides search suggestions for a given keyword, similar to "People also ask" or "Related searches" on Google. ### Method GET ### Endpoint /keywords-explorer/search-suggestions ### Parameters #### Query Parameters - **keyword** (string) - Required - The keyword to get suggestions for. ### Request Example ```json { "keyword": "link building" } ``` ### Response #### Success Response (200) - **keyword** (string) - A suggested keyword. - **search_volume** (integer) - The monthly search volume for the suggested keyword. #### Response Example ```json [ { "keyword": "link building strategies", "search_volume": 2000 }, { "keyword": "link building tools", "search_volume": 1500 } ] ``` ``` -------------------------------- ### API Request Parameters Overview Source: https://docs.ahrefs.com/api/docs/parameters Standard parameters used to constrain and format the data returned by Ahrefs API endpoints. ```APIDOC ## Request Parameters Overview ### Description This section describes the standard parameters used to filter, select, and sort data across various API endpoints. All parameter values must be URL-encoded. ### Parameters #### Query Parameters - **select** (string) - Optional - A comma-separated list of field names to return. - **where** (string) - Optional - A JSON-formatted filter expression to narrow down results. - **order_by** (string) - Optional - A comma-separated list of fields and directions (e.g., field:asc) to order the results. ### Examples - **Select**: `?select=field_a,field_b` - **Where**: `?where={"and":[{"field":"field_a","is":["gt",90]}]}` - **Order By**: `?order_by=field_a:desc,field_b:asc` ``` -------------------------------- ### Keywords Explorer - Volume History Source: https://docs.ahrefs.com/api/docs/changelog Retrieves the historical search volume for a keyword. ```APIDOC ## GET /keywords-explorer/volume-history ### Description This endpoint provides the historical monthly search volume data for a specific keyword. ### Method GET ### Endpoint /keywords-explorer/volume-history ### Parameters #### Query Parameters - **keyword** (string) - Required - The keyword to get volume history for. ### Request Example ```json { "keyword": "seo audit" } ``` ### Response #### Success Response (200) - **date** (string) - The month and year (YYYY-MM). - **volume** (integer) - The search volume for that month. #### Response Example ```json [ { "date": "2023-10", "volume": 1500 }, { "date": "2023-11", "volume": 1650 } ] ``` ``` -------------------------------- ### Workspace Projects with Site Audit Health Scores API Source: https://docs.ahrefs.com/api/docs/changelog Retrieves a list of workspace projects and their associated Site Audit Health Scores. ```APIDOC ## GET /workspaces/projects/site-audit-health ### Description This endpoint returns a list of your workspace projects, including their Site Audit Health Scores. ### Method GET ### Endpoint /workspaces/projects/site-audit-health ### Parameters None ### Request Example ```json {} ``` ### Response #### Success Response (200) - **project_id** (string) - The ID of the project. - **project_name** (string) - The name of the project. - **site_audit_health_score** (integer) - The Site Audit Health Score for the project. #### Response Example ```json [ { "project_id": "proj_123", "project_name": "My Website", "site_audit_health_score": 85 } ] ``` ``` -------------------------------- ### Best by Links API Source: https://docs.ahrefs.com/api/docs/changelog Retrieves pages ranked best by the number of backlinks. ```APIDOC ## GET /links/best-by-links ### Description This endpoint returns a list of pages ranked by the number of referring domains pointing to them. ### Method GET ### Endpoint /links/best-by-links ### Parameters #### Query Parameters - **url** (string) - Required - The domain or URL to analyze. ### Request Example ```json { "url": "example.com" } ``` ### Response #### Success Response (200) - **url** (string) - The URL of the page. - **referring_domains** (integer) - The number of referring domains. - **backlinks** (integer) - The total number of backlinks. #### Response Example ```json [ { "url": "https://example.com/page1", "referring_domains": 500, "backlinks": 2000 } ] ``` ``` -------------------------------- ### Anchors API Source: https://docs.ahrefs.com/api/docs/changelog Retrieves information about the anchors used for backlinks. ```APIDOC ## GET /links/anchors ### Description This endpoint returns details about the anchor text used for backlinks pointing to a specified URL. ### Method GET ### Endpoint /links/anchors ### Parameters #### Query Parameters - **url** (string) - Required - The URL to analyze. ### Request Example ```json { "url": "https://example.com" } ``` ### Response #### Success Response (200) - **anchor_text** (string) - The anchor text of the backlink. - **count** (integer) - The number of backlinks using this anchor text. #### Response Example ```json [ { "anchor_text": "learn more", "count": 25 } ] ``` ``` -------------------------------- ### Linked Domains API Source: https://docs.ahrefs.com/api/docs/changelog Retrieves a list of domains that link to a specified URL. ```APIDOC ## GET /links/linked-domains ### Description This endpoint returns a list of unique domains that link to a specified URL. ### Method GET ### Endpoint /links/linked-domains ### Parameters #### Query Parameters - **url** (string) - Required - The URL to find linking domains for. ### Request Example ```json { "url": "example.com" } ``` ### Response #### Success Response (200) - **domain** (string) - The domain that links to the target URL. - **domain_rating** (integer) - The Domain Rating of the linking domain. #### Response Example ```json [ { "domain": "referringdomain.com", "domain_rating": 70 } ] ``` ``` -------------------------------- ### Outgoing Links API Source: https://docs.ahrefs.com/api/docs/changelog Retrieves a list of outgoing links from a given URL. ```APIDOC ## GET /links/outgoing ### Description This endpoint returns a list of outgoing links found on a specified URL. ### Method GET ### Endpoint /links/outgoing ### Parameters #### Query Parameters - **url** (string) - Required - The URL to analyze. ### Request Example ```json { "url": "https://example.com" } ``` ### Response #### Success Response (200) - **url** (string) - The outgoing URL. - **linked_pages** (string[]) - List of pages linked to from the source URL. #### Response Example ```json [ { "url": "https://example.com/page1", "linked_pages": ["https://example.com/internal", "https://external.com"] } ] ``` ``` -------------------------------- ### Outgoing Anchors API Source: https://docs.ahrefs.com/api/docs/changelog Retrieves information about the anchors used for outgoing links. ```APIDOC ## GET /links/outgoing-anchors ### Description This endpoint provides details about the anchor text used for outgoing links from a specified URL. ### Method GET ### Endpoint /links/outgoing-anchors ### Parameters #### Query Parameters - **url** (string) - Required - The URL to analyze. ### Request Example ```json { "url": "https://example.com" } ``` ### Response #### Success Response (200) - **anchor_text** (string) - The anchor text used. - **count** (integer) - The number of times this anchor text was used. #### Response Example ```json [ { "anchor_text": "click here", "count": 15 } ] ``` ``` -------------------------------- ### Filter Syntax Grammar Definition Source: https://docs.ahrefs.com/api/docs/filter-syntax The formal BNF-style grammar defining the structure of boolean filters, expressions, and conditions allowed in the API. ```text ::= { "and" : + } | { "or" : + } | { "not" : } | ::= { "field" : , ? "is": , ? "list_is": } ::= [ "eq", ] | [ "neq", ] | [ "gt", ] | [ "gte", ] | [ "lt", ] | [ "lte", ] | [ "substring", ] | [ "isubstring", ] | [ "phrase_match", ] | [ "iphrase_match", ] | [ "prefix", ] | [ "suffix", ] | [ "regex", ] | "empty" | "is_null" ::= { "and" : + } | { "or" : + } | { "not" : } | ::= { "any" : } | { "all" : } ``` -------------------------------- ### AhrefsBot IP Ranges API Source: https://docs.ahrefs.com/api/docs/changelog Provides a list of IP addresses used by the AhrefsBot crawler. ```APIDOC ## GET /ahrefsbot/ip-ranges ### Description This endpoint returns the current list of IP address ranges used by the AhrefsBot crawler. ### Method GET ### Endpoint /ahrefsbot/ip-ranges ### Parameters None ### Request Example ```json {} ``` ### Response #### Success Response (200) - **ip_ranges** (string[]) - A list of CIDR notation IP ranges. #### Response Example ```json { "ip_ranges": [ "1.2.3.0/24", "5.6.7.0/24" ] } ``` ``` -------------------------------- ### Related Terms API Source: https://docs.ahrefs.com/api/docs/changelog Retrieves related terms for a given keyword. ```APIDOC ## GET /keywords-explorer/related-terms ### Description This endpoint returns a list of terms related to a given keyword, sourced from Keywords Explorer. ### Method GET ### Endpoint /keywords-explorer/related-terms ### Parameters #### Query Parameters - **keyword** (string) - Required - The keyword to find related terms for. ### Request Example ```json { "keyword": "content marketing" } ``` ### Response #### Success Response (200) - **keyword** (string) - A related keyword. - **search_volume** (integer) - The monthly search volume for the related keyword. #### Response Example ```json [ { "keyword": "content marketing strategy", "search_volume": 1200 }, { "keyword": "content marketing examples", "search_volume": 800 } ] ``` ``` -------------------------------- ### DR History Chart API Source: https://docs.ahrefs.com/api/docs/changelog Retrieves the Domain Rating history for a domain. ```APIDOC ## GET /history/dr-chart ### Description This endpoint provides the historical data for a domain's Domain Rating (DR). ### Method GET ### Endpoint /history/dr-chart ### Parameters #### Query Parameters - **domain** (string) - Required - The domain to get the DR history for. ### Request Example ```json { "domain": "example.com" } ``` ### Response #### Success Response (200) - **date** (string) - The date of the data point (YYYY-MM-DD). - **dr** (integer) - The Domain Rating on that date. #### Response Example ```json [ { "date": "2023-11-23", "dr": 90 }, { "date": "2023-11-24", "dr": 91 } ] ``` ``` -------------------------------- ### API Key Authentication Source: https://docs.ahrefs.com/api/docs/api-keys-creation-and-management All requests to Ahrefs API v3 require an API key. This key should be provided in the Authorization header as a Bearer token. ```APIDOC ## API Key Authentication ### Description Provide your API key in the `Authorization` header when making requests to the Ahrefs API v3. The key should be prefixed with `Bearer `. ### Method All HTTP Methods ### Endpoint All Endpoints ### Request Headers - **Authorization** (string) - Required - The API key, formatted as `Bearer YOUR_API_KEY`. ### Request Example ``` GET /api/v3/site-explorer/summary?site=ahrefs.com&output=json Host: https://apiv3.ahrefs.com Authorization: Bearer YOUR_API_KEY ``` ``` -------------------------------- ### Broken Backlinks API Source: https://docs.ahrefs.com/api/docs/changelog Identifies broken backlinks pointing to a specified URL. ```APIDOC ## GET /links/broken-backlinks ### Description This endpoint identifies backlinks that point to a specified URL but are now broken (e.g., 404 errors). ### Method GET ### Endpoint /links/broken-backlinks ### Parameters #### Query Parameters - **url** (string) - Required - The URL to check for broken backlinks. ### Request Example ```json { "url": "example.com" } ``` ### Response #### Success Response (200) - **source_url** (string) - The URL of the page with the broken backlink. - **target_url** (string) - The broken target URL. - **anchor_text** (string) - The anchor text of the broken backlink. #### Response Example ```json [ { "source_url": "https://external.com/page", "target_url": "https://example.com/nonexistent-page", "anchor_text": "check this out" } ] ``` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.