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.phpbackend (489 lines):SIMILARWEB_CACHE_TTL = 604800(7 days);similarweb_get_api_key()readssimilarweb_settings.api_keywith fallback to theSIMILARWEB_API_KEYconstant.- 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) andsimilarweb_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; theforceparameter bypasses cache. - HTTP:
similarweb_http_get(endpoint, params, timeout)— basehttps://api.similarweb.com/;api_keyappended 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— GETv1/website/{domain}/total-traffic-and-engagement/visits(monthlygranularity,main_domain_only=false); visits per month, bounce rate, page_views, time_on_site, monthly_change, global/country/category rank and category.similarweb_sources— GETv1/website/{domain}/traffic-sources/overview; direct/organic/social/referrals/paid search/email distribution + top organic keywords.similarweb_ranking— GETv1/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— GETv1/website/{domain}/similar-sites/similarsites; competitors with affinity score and category.similarweb_status— without a key: FREE mode (services.similarweb_apionline, explanatorymessage); with a key: GETv1/capabilities+online/http_codeper 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 viaDB::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:
similarwebenricher (priority 60, typesdomain/url) — URLs are reduced to the host (parse_url) and deduplicated bydomain:value; queriessimilarweb_trafficand, when engagement exists, emits a signal withseverity: 'info',status: 'analyzed', summarySimilarWeb: ~{visits} visits/month, Bounce: {bounce}%, withcachedwhen 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); allarg_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.
live feed
open issues on GitHubcarregando andamento...
não foi possivel carregar as issues agora. abra no github pelo link acima.
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
- PHP 8
- MySQL 8
- Alpine.js
- Tailwind CSS
- Plugin NEXUS
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.