Build a public live-stats widget for your marketing site

Publish real product metrics to your homepage in 30 seconds. Social proof that updates itself, no backend, no auth, embed-friendly.

Published

difficulty beginner · time to value 2 minutes

Start from this

Publish a public dashboard showing total customers, errors caught this month, and active investigations. Give me the embed URL — should work in an iframe, no auth needed.

Why this matters

Marketing wants “live, real numbers.” Engineering doesn’t want to ship a backend for it. So the marketing site stays static, with hardcoded testimonials and a “10,000+ users” badge that hasn’t updated since 2023.

Agentry’s public dashboards solve this: you publish a query, get a returned public URL, drop it in an iframe. The numbers are live. The URL is read-only AND scoped to only the query you explicitly published — even if it leaks, the worst case is people see a query you already chose to make public.

Plausible Analytics did this for their own public dashboard and it directly contributed to their growth. Every developer-tool startup should have one.

What you get

  • A returned public URL like api.agentry.sh/v1/public/q/pub_xxx
  • CORS-open, ratelimited, no signups required
  • Embed-friendly: drop in an <iframe> or render server-side with fetch
  • Updates every time your data changes (no caching headaches)

Walk through it

You

Publish a public dashboard showing: total customers, errors caught this month, and “active investigations” (open cases). I want to embed it on agentry.sh/about.

Agent

Three metrics, one dashboard. Let me publish each as a separate query so you can place them individually if you want.

POST /v1/projects/:project_id/public-queries {
  blueprint_id: "headline_count",
  description: "Total customers",
  params: { metric: "distinct_users_ever" }
}
{ "publication_id": "pub_count", "public_url": "https://api.agentry.sh/v1/public/q/pub_count" }
POST /v1/projects/:project_id/public-queries {
  blueprint_id: "headline_count",
  description: "Errors caught this month",
  params: { metric: "event_count", event: "error.captured", window_days: 30 }
}
{ "publication_id": "pub_errors", "public_url": "https://api.agentry.sh/v1/public/q/pub_errors" }
POST /v1/projects/:project_id/public-queries {
  blueprint_id: "headline_count",
  description: "Active investigations",
  params: { metric: "case_count", status: "open" }
}
{ "publication_id": "pub_open", "public_url": "https://api.agentry.sh/v1/public/q/pub_open" }
Agent

Three URLs published. Here’s the embed-ready snippet for your About page:

<div class="live-stats">
  <iframe src="https://api.agentry.sh/v1/public/q/pub_count"
          width="200" height="120" frameborder="0" loading="lazy"
          title="Customers"></iframe>
  <iframe src="https://api.agentry.sh/v1/public/q/pub_errors"
          width="200" height="120" frameborder="0" loading="lazy"
          title="Errors caught"></iframe>
  <iframe src="https://api.agentry.sh/v1/public/q/pub_open"
          width="200" height="120" frameborder="0" loading="lazy"
          title="Active investigations"></iframe>
</div>

For Notion / Markdown contexts where iframes don’t render, server-side fetch works too — see Setting it up below.

Want a single combined dashboard URL instead of three? I can publish one that renders all three numbers in a row.

The output

✅ 3 public dashboards published

  pub_count    "Total customers"         → 1,247
  pub_errors   "Errors caught this month" → 18,392
  pub_open     "Active investigations"   → 47

URLs (each is iframe-embeddable, CORS-open, no auth):
  https://api.agentry.sh/v1/public/q/pub_count
  https://api.agentry.sh/v1/public/q/pub_errors
  https://api.agentry.sh/v1/public/q/pub_open

Embed code copied to clipboard. Ratelimit: 60 req/min per IP.

Security notes:
  • Each public URL is read-only AND only auths its publication
  • If a URL leaks, max exposure = that public number (which is public anyway)
  • Revoke any time: DELETE /v1/projects/:project_id/public-queries/:publication_id pub_xxx

Setting it up

Publish the query through the public-query API and use the returned public_url as-is. Do not ask the user to find or paste a raw public key.

Iframe embed (simplest — works in any HTML context):

<iframe src="PUBLIC_URL_FROM_AGENTRY"
        width="240" height="100" frameborder="0" loading="lazy"></iframe>

Server-side render (for Notion-friendly markdown, static-site templates, RSS feeds):

// In your page loader
const publicUrl = "PUBLIC_URL_FROM_AGENTRY";
const res = await fetch(`${publicUrl}&format=json`);
const data = await res.json();
return `<div class="metric"><strong>${data.value.toLocaleString()}</strong> customers</div>`;

Custom-styled (fetch JSON, render however you want):

const publicUrl = "PUBLIC_URL_FROM_AGENTRY";

fetch(`${publicUrl}&format=json`)
  .then(r => r.json())
  .then(data => {
    document.querySelector("#customer-count").textContent =
      data.rows[0].count.toLocaleString();
  });

Variations

  • “Publish a chart instead of a single number — error rate over the last 30 days as a sparkline.”
  • “Build a ‘who’s using Agentry’ wall — recent signups (just first name + city if you have it).”
  • “Publish a ‘last incident resolved’ timer for the marketing site — like Linear’s status page.”
  • “For my newsletter, publish ‘this week’s new features’ as a JSON feed I can include in my emails.”
  • “Revoke the dashboards from last quarter’s campaign — they’re not needed anymore.”

Adapt this playbook in your own agent.

Ask your agent to map the starter prompt to your saved signal map, live events, and the current HTTP API before answering.

Install agentry.sh/install.md for me
Agent will onboard itself and then your app