domain capa

domain-keywords

Keyword tracking, ranking, and opportunity scoring for SEO/SEM research

Keyword tracking, ranking, and opportunity scoring for SEO/SEM research

Tierdomain
Roleunclassified (baselined)
Pathcrates/domain/keywords
Edition2021
Targetsdomain_keywords
Public items13 across 1 module
Tests39

What it is for

domain-keywords: Keyword tracking, ranking, and opportunity scoring

Overview

This crate provides a comprehensive keyword research and tracking system for SEO/SEM analysis. It handles keyword management, ranking tracking across competitors, SERP feature detection, and opportunity scoring.

Layer

Domain - depends on: foundation-basemodels

Key Types

Scoring System

Opportunity scores are calculated using:

Example

use domain_keywords::{
Keyword, KeywordRanking, KeywordIntent, KeywordStatus,
scoring::{calculate_opportunity, volume_score}
};

// Create a keyword
let keyword = Keyword::new(tenant_id, "plumber phoenix")
.with_search_volume(12_000)
.with_difficulty(45)
.with_intent(KeywordIntent::Commercial);

// Create a ranking
let ranking = KeywordRanking::new(keyword.id, competitor_id)
.with_rank(5)
.with_featured_snippet();

// Calculate opportunity
let opportunity = calculate_opportunity(&keyword, &ranking, None);
println!("Opportunity: {} ({})", opportunity.opportunity_score, opportunity.priority_tier);

Capabilities

scoring (other)

Opportunity scoring system for keywords.

Item
fn volume_score(search_volume : Option <i32>) -> i16
fn difficulty_score(difficulty : Option <i16>) -> i16
fn competition_score(rankings : & KeywordRanking) -> i16
fn competition_score_from_avg(avg_rank : Option <f64>, count : i32) -> i16
fn intent_score(intent : Option <KeywordIntent>) -> i16
fn calculate_opportunity(keyword : & Keyword, rankings : & KeywordRanking, client_rank : Option <i16>,) -> KeywordOpportunity
fn generate_recommendation(opportunity_score : i16, client_rank : Option <i16>, best_competitor_rank : Option <i16>,) -> String

ScoringWeights

Opportunity scoring system for keywords.

Item
pub struct ScoringWeights
ScoringWeights :: fn default() -> Self
ScoringWeights :: fn custom(volume : f64, difficulty : f64, competition : f64, intent : f64) -> Self
ScoringWeights :: fn is_valid(& self) -> bool
fn opportunity_score(volume : i16, difficulty : i16, competition : i16, intent : i16, weights : & ScoringWeights,) -> i16
fn opportunity_score_with_priority(volume : i16, difficulty : i16, competition : i16, intent : i16, priority : i16, weights : & ScoringWeights,) -> i16

How to use it

No examples/ target and no doctest in this crate's rustdoc. The tests listed under Verification are the closest executable usage.

Module structure

domain_keywords

Public surface

`scoring`

ItemWhat it is
pub struct ScoringWeightsScoring weights for opportunity calculation.
ScoringWeights :: fn default() -> Self
ScoringWeights :: fn custom(volume : f64, difficulty : f64, competition : f64, intent : f64) -> SelfCreate custom weights
ScoringWeights :: fn is_valid(& self) -> boolCheck if weights sum to approximately 1.0.
fn volume_score(search_volume : Option <i32>) -> i16Calculate volume score (0-100) from monthly search volume
fn difficulty_score(difficulty : Option <i16>) -> i16Calculate difficulty score (0-100) from keyword difficulty
fn competition_score(rankings : & KeywordRanking) -> i16Calculate competition score (0-100) based on competitor rankings
fn competition_score_from_avg(avg_rank : Option <f64>, count : i32) -> i16Calculate competition score from pre-computed average rank.
fn intent_score(intent : Option <KeywordIntent>) -> i16Calculate intent score (0-100) from keyword intent.
fn opportunity_score(volume : i16, difficulty : i16, competition : i16, intent : i16, weights : & ScoringWeights,) -> i16Calculate the overall opportunity score.
fn opportunity_score_with_priority(volume : i16, difficulty : i16, competition : i16, intent : i16, priority : i16, weights : & ScoringWeights,) -> i16Calculate opportunity score with priority multiplier
fn calculate_opportunity(keyword : & Keyword, rankings : & KeywordRanking, client_rank : Option <i16>,) -> KeywordOpportunityCalculate full opportunity record for a keyword.
fn generate_recommendation(opportunity_score : i16, client_rank : Option <i16>, best_competitor_rank : Option <i16>,) -> StringGenerate a recommendation based on the opportunity analysis.

No pub use re-exports: every item above is declared in this crate.

Boundary

Reaches into foundation.

Shares tier domain with 41 other crates: domain-agreements, domain-ai-report, domain-billing, domain-catalog, domain-classify, domain-comments, domain-competitive-intel, domain-contact, … (41 total).

_What this crate deliberately does NOT own is a judgment. No committed registry records one for it, so none is stated here._

Where it sits

Tier (ontology)domain
Architectural role (taxonomy)unclassified (baselined)
Locationcrates/domain/keywords
Vocabulary in force (lexicon)current

Tier flow. Which tiers this crate's own edges cross.

flowchart LR
  n_domain["domain"] --> n_foundation["foundation"]

Dependencies

Runtime, in this workspace.

CrateTierOptionalOnly on
`foundation-basemodels`foundationnoalways

Runtime, from outside the workspace.

CrateRequirementFeaturesOptionalOnly on
async-trait^0.1noalways
chrono^0.4serdenoalways
serde^1derivenoalways
serde_json^1noalways
sqlx^0.8runtime-tokio, postgres, chrono, uuid, jsonnoalways
thiserror^2noalways
uuid^1v4, serdenoalways

Development, from outside the workspace.

CrateRequirementFeaturesOptionalOnly on
tokio^1full, test-utilnoalways

Build. None.

Depended on by. 1 workspace crate.

Signal flow — what reaches this crate, and what it reaches.

flowchart LR
  n_application_keywords["application-keywords"] -->|uses| SELF
  SELF["domain-keywords"]
  SELF -->|runtime| n_foundation_basemodels["foundation-basemodels"]
  classDef self fill:#1f883d,stroke:#1f883d,color:#fff;
  class SELF self;

Feature flags

No Cargo features are defined: every capability is unconditional, so no consumer can receive a half-wired crate.

Targets

KindNameSource
libdomain_keywords`src/lib.rs`

Error model

No public error type was detected: no public item declares a type named *Error, and no public signature returns one.

Operational characteristics

PropertyEvidence
async public surfacenone detected
async runtimenone detected
database accessyes
network I/Onone detected
unsafe codenone detected
environment variablesnone detected

No unsafe block, unsafe fn, unsafe impl or unsafe trait was found by the parser anywhere in this crate's source.

Configuration

No environment variable is read with a literal name anywhere in this crate. A variable whose key is computed at run time cannot be listed here, and is not claimed to be absent.

1 workspace crate depends on this one: application-keywords.

Verification

KindCount
Unit tests39
Integration tests0
Examples0
Doctests0

Evidence by module. How often each public module is named by something executable.

ModuleTestsExamplesConsumers
scoring1000

What the tests establish, by name:

Documentation coverage

MeasureDocumentedTotal
Public items with rustdoc1213
Public modules with a //! block11
pie showData
    title Public items with rustdoc
    "Documented" : 12
    "No rustdoc detected" : 1

Metrics

MetricValue
Rust source files6
Source lines3254
Code lines2411
Public API items13
Public modules1
Tests39
Examples0
Cargo features0
Direct runtime dependencies8
Workspace reverse dependencies1
pie showData
    title Public API by kind
    "function" : 9
    "method" : 3
    "struct" : 1
pie showData
    title Rust source composition
    "Code" : 2411
    "Blank or comment" : 843

Generation

Rendered by tools-corpus corpus readme from repository evidence alone, renderer schema 2, lexicon current. No model, network service or database was consulted. Regenerate with tools-corpus corpus readme --write; verify with --check.

Todas las domain · Manual