Skip to main content

🌐 Semrush - Domain Analytics

Overview

Get comprehensive domain metrics including authority scores, traffic estimates, keyword rankings, and visibility trends.

Domain Overview

Get Domain Rank

GET /overview/:domain

Purpose: Retrieve domain authority, traffic estimates, and ranking metrics

Request:

GET /v1/integrations/semrush/overview/example.com?new=false
Authorization: Bearer {jwt_token}

Query Parameters:

ParameterTypeDefaultDescription
newBooleanfalseForce refresh from API
account_idString-Override account ID

Semrush API:

GET https://api.semrush.com/?type=domain_rank&key={API_KEY}&database={COUNTRY}&domain={DOMAIN}

API Parameters:

  • type: domain_rank
  • database: Country code (us, uk, ca, etc.)
  • domain: Target domain

Caching:

  • Cache Type: domain_rank
  • TTL: 7 days
  • Account-specific: Yes

CSV Response Columns:

Database;Domain;Rank;Organic Keywords;Organic Traffic;Organic Cost;Adwords Keywords;Adwords Traffic;Adwords Cost

JSON Response:

{
"success": true,
"message": "SUCCESS",
"data": {
"data": [
{
"Database": "us",
"Domain": "example.com",
"Rank": "125000",
"Organic Keywords": "5432",
"Organic Traffic": "12500",
"Organic Cost": "28750",
"Adwords Keywords": "230",
"Adwords Traffic": "1200",
"Adwords Cost": "3400"
}
],
"createdAt": "2025-10-10T08:00:00Z",
"lastUpdate": "2025-10-10T08:00:00Z",
"nextUpdate": "2025-10-17T08:00:00Z",
"daysSinceUpdate": 0,
"daysUntilUpdate": 7,
"isStale": false
}
}

Key Metrics:

MetricDescriptionUnit
RankGlobal domain rankPosition
Organic KeywordsNumber of ranking keywordsCount
Organic TrafficEstimated organic trafficVisits/month
Organic CostEquivalent PPC value of organic trafficUSD
Adwords KeywordsNumber of paid keywordsCount
Adwords TrafficEstimated paid trafficVisits/month
Adwords CostEstimated ad spendUSD

Country Database Selection

Automatic Detection

Database automatically selected based on account country:

const accountCountry = req.auth?.account?.business?.address?.country;
const country = countryCode[accountCountry] || 'us';

Supported Countries

CountryCodeDatabase
United StatesUSus
United KingdomGBuk
CanadaCAca
AustraliaAUau
GermanyDEde
FranceFRfr
SpainESes
ItalyITit
NetherlandsNLnl
BrazilBRbr
RussiaRUru
IndiaINin

Use Cases

1. Client Onboarding

Get baseline metrics for new SEO clients:

GET /v1/integrations/semrush/overview/newclient.com?new=true

Metrics to Track:

  • Current domain rank
  • Organic keyword count
  • Traffic estimates
  • Competitive positioning

2. Progress Monitoring

Compare domain metrics over time:

# Initial assessment (force refresh)
GET /overview/client.com?new=true

# Weekly check (use cache)
GET /overview/client.com

3. Multi-Domain Comparison

Fetch metrics for multiple domains:

const domains = ['client1.com', 'client2.com', 'client3.com'];
const metrics = await Promise.all(
domains.map(domain => fetch(`/v1/integrations/semrush/overview/${domain}`)),
);

Cache Behavior

Force Refresh Logic

const shouldForceRefresh = createdAt => {
if (!createdAt) return true;
const oneWeekAgo = new Date(Date.now() - 7 * 24 * 60 * 60 * 1000);
return new Date(createdAt) < oneWeekAgo;
};

Refresh Triggers:

  1. No cached data exists
  2. Data older than 7 days
  3. ?new=true parameter
  4. Manual cache clear

Cache Metadata

Response includes freshness indicators:

  • lastUpdate: When data was fetched
  • nextUpdate: When next refresh recommended
  • daysSinceUpdate: Age of data
  • daysUntilUpdate: Days until refresh needed
  • isStale: Boolean freshness indicator

Error Handling

Common Errors

Domain Not Found:

{
"success": false,
"message": "ERROR 40 :: Domain not found or has insufficient data"
}

Invalid Domain Format:

{
"success": false,
"message": "Domain is invalid.",
"error_code": "VALIDATION_ERROR"
}

Rate Limit Exceeded:

{
"success": false,
"message": "ERROR 30 :: Rate limit exceeded",
"error_code": "RATE_LIMIT_EXCEEDED"
}
💬

Documentation Assistant

Ask me anything about the docs

Hi! I'm your documentation assistant. Ask me anything about the docs!

I can help you with:
- Code examples
- Configuration details
- Troubleshooting
- Best practices

Try asking: How do I configure the API?
09:31 AM