Telephone
United States
+1 (800) 815 - 9959
12:00 PM - 5:00 PM (EST/EDT)
Monday - Friday
Need help?
Telephone
United States
United States
Canada
United Kingdom
Spain
France
Italy
Germany
Australia
+1 (800) 815 - 9959
12:00 PM - 5:00 PM (EST/EDT)
Monday - Friday
The Domain vs. Domain report helps you to compare the keyword profiles of up to five competitors.
This tutorial shows you how to create a report that compares your domain with two competitors to find keywords that they rank for, but you don’t (untapped keywords). This is perfect for finding content gaps and new SEO opportunities.
You can use API testing tools like Postman to test your requests before full implementation. Note that test requests consume API units.
Imagine you are analyzing mybrand.com against two competitors: competitor1.com and competitor2.com.
To find untapped keywords for mybrand.com, use the following formula:
*|or|competitor1.com|+|or|competitor2.com|-|or|mybrand.com
*
to start with all keywords.|or|competitor1.com
to add competitor organic keyword pools.|+|or|competitor2.com
to add additional competitor organic keyword pools to the keyword set.|-|or|mybrand.com
to exclude keywords you already rank for.This string must be included as the domains
parameter to your request in the URL-encoded format.
Since this parameter contains special characters like *
, |
, +
, and -
, you must encode it. The encoded string will look as follows:
The domains parameter example
domains=%2A%7Cor%7Ccompetitor1.com%7C%2B%7Cor%7Ccompetitor2.com%7C%2D%7Cor%7Cmybrand.com
Let’s break it down:
Request part | Meaning | Encoded |
---|---|---|
* | Sign: Wildcard for all keywords | %2A |
| | Separator between segments | %7C |
+ | Sign: Add to the pool of keywords | %2B |
- | Sign: Exclude from the pool of keywords | %2D |
You can use the display_filter
parameter to apply filters to the report. For example, if you want to focus on:
Nq
) to greater than 1,000.Kd
) to less than 60.Co
) to less than 0.6.The string will look as follows: +|Nq|Gt|1000|+|Kd|Lt|60|+|Co|Lt|0.6
Here:
+|Nq|Gt|1000
+
→ includeNq
→ search volumeGt
→ greater than1000
→ value+|Kd|Lt|60
+
→ includeKd
→ keyword difficultyLt
→ lower than60
→ value+|Co|Lt|0.6
+
→ includeCo
→ competitionLt
→ lower than0.6
→ valueSince this parameter contains special characters like +
and |
, you must encode it. The encoded string will look as follows:
The display_filter parameter example
display_filter=%2B%7CNq%7CGt%7C1000 %7C%2B%7CKd%7CLt%7C60%7C%2B%7CCo%7CLt%7C0.6
Let’s break it down:
Request part | Meaning | Encoded |
---|---|---|
+ | Sign: Include rows that match the filter condition | %2B |
| | Separator between segments | %7C |
You can sort the results by descending search volume using the display_sort
parameter: display_sort=nq_desc
.
To check other sorting options, refer to Sortings.
type=domain_domains
.key=YOUR_API_KEY
.database=us
for the United States.export_columns=Ph,P0,P1,P2,Nq,Kd,Co,Cp
.display_limit=10
.When you put all the parameters together, the request will look like this:
The Domain vs. Domain request example
https://api.semrush.com/?type=domain_domains&key=YOUR_API_KEY&database=us&domains=%2A%7Cor%7Ccompetitor1.com%7C%2B%7Cor%7Ccompetitor2.com%7C%2D%7Cor%7Cmybrand.com&display_sort=nq_desc&display_filter=%2B%7CNq%7CGt%7C1000%7C%2B%7CKd%7CLt%7C60%7C%2B%7CCo%7CLt%7C0.6&export_columns=Ph,P0,P1,P2,Nq,Kd,Co,Cp&display_limit=10
In this guide, you learned how to identify high-value, lower-competition organic keywords your competitors rank for, but you do not. This approach supports data-driven content planning by highlighting untapped keywords where competitors have visibility.
From here, you can refine your filters to match your SEO goals, integrate results into your reporting workflows, or build automated tools to streamline ongoing analysis. For a more comprehensive strategy, you may also explore other Semrush API reports.
AI-powered search features, like Google's AI Overview, are changing how users interact with search results. This often leads to fewer clicks on regular organic listings.
In this guide, you'll learn how to evaluate possible traffic loss. You can check how often Google AI Overviews appear for your ranking keywords and see how often your domain is included in these overviews.
To analyze the impact of the AI Overview SERP feature on your organic visibility and traffic, you can use the Analytics API Domain Overview method and export the FKn
and FPn
columns with code 52
for AI Overview.
In the report:
FK52
shows the total number of the AI Overview SERP feature triggered by the keywords that your domain ranks for.FP52
shows the total number of the AI Overview SERP feature that your domain actually ranks in.Retrieve the Domain Ranks report with export columns including FK52 and FP52
https://api.semrush.com/?key=YOUR_API_KEY&type=domain_ranks&domain=your-domain.com&database=us&export_columns=Db,Dn,Rk,Ot,FK52,FP52
Compare FP52
against FK52
:
FP52
/FK52
ratio indicates a strong presence in AI Overview.In some methods, such as Domain Organic Search Keywords, you can retrieve keywords presented in the AI Overview results:
Fk
and Fp
SERP Features columns:Fk
: All SERP features triggered by a keyword.Fp
: SERP features in which the domain appears for that keyword.2. Apply the display_filter
parameter to the request. For example, use display_filter=+|Fk|Eq|52
to filter only those keywords that trigger AI Overview. If you need keywords in AI Overview results where your domain ranks, use Fp
instead.
The filter must be URL-encoded: display_filter=%2B%7CFk%7CEq%7C52
.
Retrieve keywords present on SERP in AI Overview results (filter by Fk column)
https://api.semrush.com/?type=domain_organic&key=API_KEY&display_limit=50&export_columns=Ph,Po,Pp,Pd,Nq,Cp,Ur,Tr,Tc,Co,Nr,Td,Fk,Fp&domain=justanswer.com&database=us&display_filter=%2B%7CFk%7CEq%7C52&display_positions_type=all
Retrieve keywords where the domain appears in AI Overview (filter by Fp column)
https://api.semrush.com/?type=domain_organic&key=API_KEY&display_limit=50&export_columns=Ph,Po,Pp,Pd,Nq,Cp,Ur,Tr,Tc,Co,Nr,Td,Fk,Fp&domain=justanswer.com&database=us&display_filter=%2B%7CFp%7CEq%7C52&display_positions_type=all
Focus on improvements that make your content AI-friendly using Semrush tools, such as SEO Writing Assistant. This can help recover lost organic traffic from zero-click searches.
To integrate CSV Semrush API reports into your Google Sheets reports, you can:
In this article, you will find examples of how to use both options.
You can fetch and split CSV data from the Semrush API into columns using functions, like IMPORTDATA
, SPLIT
, and ARRAYFORMULA
. You just need to create a formula for your case and insert it into the cell.
Import the Domain Organic Search Keywords data into the sheet
=IMPORTDATA("https://api.semrush.com/?type=domain_organic&key=SEMRUSH_API_KEY&export_columns=Ph,Po,Nq,Cp&domain=example.com&database=us&display_limit=10")
Import the Domain Organic Search Keywords data into the sheet and split it into columns
=ARRAYFORMULA(SPLIT(IMPORTDATA("https://api.semrush.com/?type=domain_organic&key=SEMRUSH_API_KEY&export_columns=Ph,Po,Nq,Cp&domain=example.com&database=us&display_limit=10"), ";"))
SEMRUSH_API_KEY
and Value: Your API key.In the Apps Script:
As an example, you can use the following functions that will:
Function 1. Fetch and parse Domain Organic Search Keywords data
function getSemrushData(domain) { var apiKey = PropertiesService.getScriptProperties().getProperty('SEMRUSH_API_KEY'); var apiUrl = `https://api.semrush.com/?type=domain_organic&key=${apiKey}&export_columns=Ph,Po,Nq,Cp&domain=${domain}&database=us&display_limit=10`; var response = UrlFetchApp.fetch(apiUrl); var csvData = response.getContentText(); var rows = Utilities.parseCsv(csvData, ";"); return rows; }
Function 2. Store data in a monthly-named sheet
function fetchAndStoreMonthlyData() { var spreadsheet = SpreadsheetApp.getActiveSpreadsheet(); var domain = 'example.com'; // Replace with your domain var rows = getSemrushData(domain); var sheetName = Utilities.formatDate(new Date(), Session.getScriptTimeZone(), "MMMM yyyy"); var sheet = spreadsheet.insertSheet(sheetName); rows.forEach(row => sheet.appendRow(row)); }
Function 3. Schedule monthly execution
function createMonthlyTrigger() { var exists = ScriptApp.getProjectTriggers().some(t => t.getHandlerFunction() === 'fetchAndStoreMonthlyData'); if (!exists) { ScriptApp.newTrigger('fetchAndStoreMonthlyData') .timeBased() .everyMonths(1) .onMonthDay(1) .atHour(9) .create(); } }
Run createMonthlyTrigger()
manually from the Editor once to set up the monthly trigger.
You need to provide Apps Script with all the requested permissions to execute the script.
The script will now run automatically at the start of each month, creating a new sheet and fetching the data.
This script is intended as a starting point. You may need to customize the code to fit your unique use case, including error handling or different scheduling requirements.
For example, if a scheduled trigger is unnecessary, you can callgetSemrushData()
directly from a Google Sheets cell:=getSemrushData("example.com")
.
Now that you've imported Semrush data into Google Sheets, you can optionally take any of the following next steps—or choose your own workflow: