Cover image for project: NEXUS SimilarWeb IN PROGRESS

Technical summary

NEXUS plugin for market intelligence and web traffic analysis via the SimilarWeb API V5: total visits, engagement (bounce rate, pages/visit, time on site), traffic sources, rankings and affinity-based competitors — with a keyless free/estimate mode, 7-day local caching, API Key setup in the UI and domain enrichment signals in the Intelligence Hub.

Executed scope

  • backend.php backend (489 lines): SIMILARWEB_CACHE_TTL = 604800 (7 days); similarweb_get_api_key() reads similarweb_settings.api_key with fallback to the SIMILARWEB_API_KEY constant.
  • Tables (created by similarweb_install() on load): similarweb_cache (id, kind, query_key VARCHAR(255), status, http_code, data LONGTEXT, error, task_id, updated_at; UNIQUE uk_kind_key (kind, query_key), idx_updated_at) and similarweb_history (id, query_type, query_val VARCHAR(255), status, task_id, created_at; idx_created_at).
  • Cache: similarweb_cache_get/put — upsert per kind+key (lowercase key) with 7-day TTL; every query is logged to history; the force parameter bypasses cache.
  • HTTP: similarweb_http_get(endpoint, params, timeout) — base https://api.similarweb.com/; api_key appended to query params when configured; 4s connect / 10s timeout (default); Accept: application/json.
  • Two operation modes: without an API Key → FREE response with structured estimates (mode: ESTIMATED — simulated visits, engagement, rankings and sample competitors, cached for testing); with an API Key → real SimilarWeb V5 data.
  • similarweb_traffic — GET v1/website/{domain}/total-traffic-and-engagement/visits (monthly granularity, main_domain_only=false); visits per month, bounce rate, page_views, time_on_site, monthly_change, global/country/category rank and category.
  • similarweb_sources — GET v1/website/{domain}/traffic-sources/overview; direct/organic/social/referrals/paid search/email distribution + top organic keywords.
  • similarweb_ranking — GET v1/website/{domain}/global-rank/global-rank; global, country and category (available via API; in the UI the ranks appear in the Traffic tab cards).
  • similarweb_similar — GET v1/website/{domain}/similar-sites/similarsites; competitors with affinity score and category.
  • similarweb_status — without a key: FREE mode (services.similarweb_api online, explanatory message); with a key: GET v1/capabilities + online/http_code per service.
  • similarweb_history — page and limit ≤ 50, ordered by id DESC (query_type, query_val, status, task_id, created_at).
  • similarweb_settings_save — real action (not a placeholder): saves the API Key via DB::setConfig('similarweb_settings', ['api_key' => ...]), falling back to the constant.
  • API: 7 actions via PluginManager::registerApiAction (similarweb_status, similarweb_traffic, similarweb_sources, similarweb_ranking, similarweb_similar, similarweb_history, similarweb_settings_save).
  • Intelligence Hub: similarweb enricher (priority 60, types domain/url) — URLs are reduced to the host (parse_url) and deduplicated by domain:value; queries similarweb_traffic and, when engagement exists, emits a signal with severity: 'info', status: 'analyzed', summary SimilarWeb: ~{visits} visits/month, Bounce: {bounce}%, with cached when served from cache.
  • Alpine.js UI (tab.php, 468 lines): indigo theme; mode badge (green "API Active" / amber "Free / Estimate Mode") + ⚙️ Configure Key button (password modal → similarweb_settings_save); Traffic tab (analysis fires traffic + sources + competitors in parallel; KPI cards — Total Visits (B/M/K), Bounce Rate, Pages/Visit, Avg Time (m/s) — plus Global/Country/Category Rank cards and category badge), Sources (per-channel bars), Competitors (domain/category/affinity table + "Analyze" button that re-runs the competitor analysis) and History (type/domain/status/date); raw JSON toggle.
  • Fastr: 3 commands — /similarweb <domain> (domain), /similarweb-sources <domain> (domain), /similarweb-similar <domain> (domain); all arg_required=true.
  • No cronjob.json — on-demand plugin with 7-day cache.

Stack and tools

  • PHP 8 (no framework)
  • MySQL 8 (similarweb_cache + similarweb_history)
  • Alpine.js + Tailwind CSS (premium light, indigo ring)
  • NEXUS plugin system (PluginManager)
  • cURL → SimilarWeb API V5 (api.similarweb.com)

Operational tags

  • Market Intelligence
  • SimilarWeb
  • SEO
  • Web Traffic
  • Competitive Intelligence
  • Analytics
  • Plugin NEXUS

Operational outcome

  • One-click analysis of any domain: visits volume, engagement, rankings and category shown in readable cards without leaving the terminal.
  • Acquisition channel overview with per-source bars (direct, organic, social, referrals, paid, email) to assess the target's traffic strategy.
  • Competitive benchmark: competitors ranked by audience affinity, each re-analyzable with a single click.
  • Automatic enrichment: domains mentioned in tasks/comments become informative signals (visits/month and bounce rate) in the Intelligence Hub.
  • Keyless free mode for testing and previews; optional API Key configured right in the UI.
  • 7-day cache: repeated lookups do not burn paid API credits and the query history stays auditable.

GitHub progress (issues)

Real-time panel with latest repository issues.

abertas (amostra): -- fechadas (amostra): -- base: -- ultimas issues

carregando andamento...

Real results

NEXUS plugin for market intelligence and web traffic analysis via the SimilarWeb API V5: total visits, engagement, traffic sources, rankings and affinity-based competitors — with a keyless free/estimate mode, 7-day local caching, API Key setup and domain enrichment signals in the Intelligence Hub.

Architecture and organization

Execution and operations

The project follows reproducible execution flow with technical validation in production-like environments.

Screenshots

Talk about this project

Apply this implementation pattern in your environment and accelerate delivery with technical consistency.