🌐 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:
| Parameter | Type | Default | Description |
|---|---|---|---|
new | Boolean | false | Force refresh from API |
account_id | String | - | Override account ID |
Semrush API:
GET https://api.semrush.com/?type=domain_rank&key={API_KEY}&database={COUNTRY}&domain={DOMAIN}
API Parameters:
type:domain_rankdatabase: 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:
| Metric | Description | Unit |
|---|---|---|
| Rank | Global domain rank | Position |
| Organic Keywords | Number of ranking keywords | Count |
| Organic Traffic | Estimated organic traffic | Visits/month |
| Organic Cost | Equivalent PPC value of organic traffic | USD |
| Adwords Keywords | Number of paid keywords | Count |
| Adwords Traffic | Estimated paid traffic | Visits/month |
| Adwords Cost | Estimated ad spend | USD |
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
| Country | Code | Database |
|---|---|---|
| United States | US | us |
| United Kingdom | GB | uk |
| Canada | CA | ca |
| Australia | AU | au |
| Germany | DE | de |
| France | FR | fr |
| Spain | ES | es |
| Italy | IT | it |
| Netherlands | NL | nl |
| Brazil | BR | br |
| Russia | RU | ru |
| India | IN | in |
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:
- No cached data exists
- Data older than 7 days
?new=trueparameter- Manual cache clear
Cache Metadata
Response includes freshness indicators:
lastUpdate: When data was fetchednextUpdate: When next refresh recommendeddaysSinceUpdate: Age of datadaysUntilUpdate: Days until refresh neededisStale: 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"
}