Market Intelligence 6 min read

Market Intelligence Dashboard: Compare SERP Source Snapshots

Run a local Node.js source dashboard with timestamps, URL changes and failures. Keep API keys on the server and avoid treating rank changes as market share.

(Updated: ) • 1,155 words

A market intelligence dashboard should expose what was observed and when. Preserve the query and source URLs, then show which URLs appeared again, changed title or were not seen in the next sample. Search-result changes are observations, not direct measurements of revenue, market share or whether a source still exists.

Give the dashboard a source contract

Field Why it is retained
Query, engine and market Two different searches are not a controlled change sample
Observation time When this result set was collected
Source URL and title A reviewer can inspect the underlying page
Change state New, seen again, title changed or not seen in this sample
Collection failure A failed refresh must not become an empty successful market update

The local implementation uses Node.js native fetch on the server. It does not put a SearchCans key in browser JavaScript. The rendering uses DOM textContent rather than treating a result title as HTML. It is a local tutorial server, not a new SearchCans public API or an Astro deployment.

Save the search client and dashboard files

Save the complete Node.js search client as wp229.mjs beside wp104.mjs below. Run node wp104.mjs and open http://127.0.0.1:8787/. It starts with clearly labeled synthetic fixtures and makes no provider call. For a deliberate live run, set SEARCHCANS_API_KEY and DASHBOARD_QUERY, then supply --live. One button refresh requests one sample; the local server permits only one sample operation in flight.

import http from 'node:http';
import {pathToFileURL} from 'node:url';
import {search} from './wp229.mjs';

const page = `<!doctype html><html lang="en"><meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Source snapshot dashboard</title>
<style>body{font:16px/1.6 system-ui;margin:32px auto;padding:20px;max-width:1000px}
table{width:100%;border-collapse:collapse}td,th{text-align:left;padding:12px;border-bottom:1px solid #ddd}
button{padding:10px 18px;font:inherit}a{color:#075985}.removed{opacity:.6}</style>
<main><h1>Source snapshot dashboard</h1><p>Changes in observed URLs, not market share.</p>
<button id="refresh">Refresh sample</button><p id="status">No sample yet</p>
<table><thead><tr><th>Observation</th><th>Source</th><th>Change</th></tr></thead><tbody id="rows"></tbody></table></main>
<script>
let previous = new Map();
async function refresh() {
 const button = document.querySelector('#refresh');button.disabled = true;
 try {
  const response = await fetch('/api/snapshot');if (!response.ok) throw new Error('Failed sample');
  const sample = await response.json();const next = new Map(sample.results.map(r => [r.link, r]));
  const display = sample.results.map(r => ({...r, change: previous.has(r.link) ?
      (previous.get(r.link).title === r.title ? 'seen again' : 'title changed') : 'new in sample'}));
  for (const [link, item] of previous) if (!next.has(link)) display.push({...item, change: 'not seen in sample'});
  const body = document.querySelector('#rows');body.replaceChildren();
  for (const item of display) {
   const row = document.createElement('tr');if (item.change === 'not seen in sample') row.className = 'removed';
   const time = document.createElement('td');time.textContent = sample.observed_at;
   const source = document.createElement('td'), anchor = document.createElement('a');
   anchor.textContent = item.title;const u = new URL(item.link);
   if (u.protocol === 'https:' || u.protocol === 'http:') {anchor.href = u.href;anchor.rel = 'noreferrer';}
   source.append(anchor);const state = document.createElement('td');state.textContent = item.change;
   row.append(time, source, state);body.append(row);
  }
  previous = next;document.querySelector('#status').textContent =
    (sample.fixture_only ? 'Synthetic fixture' : 'Observed search sample') + ': ' + sample.query;
 } catch {
  document.querySelector('#status').textContent = 'Refresh failed; previous rows retained.';
 } finally {button.disabled = false;}
}
document.querySelector('#refresh').addEventListener('click', refresh);refresh();
${'</scr' + 'ipt>'}</html>`;

export function createDashboardServer(sample) {
 let busy = false;
 return http.createServer(async (request, response) => {
  response.setHeader('Cache-Control', 'no-store');
  if (request.method !== 'GET') {response.writeHead(405);response.end();return;}
  if (request.url === '/') {response.setHeader('Content-Type', 'text/html; charset=utf-8');response.end(page);return;}
  if (request.url !== '/api/snapshot') {response.writeHead(404);response.end();return;}
  if (busy) {response.writeHead(429);response.end();return;}
  busy = true;
  try {const data = await sample();response.setHeader('Content-Type', 'application/json');response.end(JSON.stringify(data));}
  catch {response.writeHead(503);response.end('Sample unavailable');}
  finally {busy = false;}
 });
}

if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {
 const live = process.argv.includes('--live'), query = process.env.DASHBOARD_QUERY || 'official API changelog';
 const sample = live ? () => search(query) : async () => ({query: 'synthetic fixture',
   fixture_only: true, observed_at: new Date().toISOString(), results: [
    {link: 'https://example.test/a', title: 'Fixture source A'},
    {link: 'https://example.test/b', title: 'Fixture source B'}]});
 createDashboardServer(sample).listen(Number(process.env.PORT || 8787), '127.0.0.1',
   () => console.log('Local dashboard ready; fixture mode unless --live is supplied.'));
}

Check transitions before connecting live data

  • Supply two fixtures where one URL remains, one disappears from the sample and one is newly observed. Check all three labels.
  • Change a title without changing the URL and verify title changed rather than a new source.
  • Return a collection error and verify that the previous rows remain visible.
  • Use a title containing HTML-like text and verify it is displayed as text rather than executed.

The code stores the previous successful snapshot in the browser’s memory. It does not implement persistent history, a multi-user database or a scheduled production collector. Add those only after defining retention, access and sampling requirements. A source not seen in a sample may still be available; the label deliberately avoids asserting deletion.

Add evidence review to the market question

For a real question, label which sources or changes matter, open the reference pages and retain source context. A title change may be editorial, and a ranking movement may reflect search sampling. Use the wider market-intelligence architecture for business interpretation and claim-level review before promoting a collected statement to a finding.

For actual request capacity and charges, use the current SERP contract and pricing page. The dashboard contains no hardcoded old Starter price, and the synthetic fixture timings are not a performance claim.

Sources and verification

Tags:

Market Intelligence Dashboard Development SERP API Business Analytics
SearchCans Team

SearchCans Team

SERP API & Reader API Experts

The SearchCans engineering team builds high-performance search APIs serving developers worldwide. We share practical tutorials, best practices, and insights on SERP data, web scraping, RAG pipelines, and AI integration.

Ready to build with SearchCans?

Test SERP API and Reader API with 100 free credits. No credit card required.