Add the widget
to your site
Show comment counts and discussion activity on your website. One script tag, zero dependencies, free forever.
Quick Start
Add this script tag anywhere in your HTML:
<script src="https://comment.page/widget.js"
data-url="https://example.com/your-page"></script>
Shown until your domain is registered and approved. Links to the home page.
Attributes
| Attribute | Required | Description |
|---|---|---|
src | Yes | URL to the widget script |
data-url | Yes | The page URL to show widget data for |
API Reference
The widget fetches data from the JSON API. You can call it directly too.
/widget?url={pageUrl}
// Response
{
"url": "https://example.com/your-page",
"status": "active",
"commentCount": 42,
"hot": true
}
| Field | Type | Description |
|---|---|---|
| url | string | The queried page URL |
| status | string | active new not_found |
| commentCount | number | Total comments on the page |
| hot | boolean | True if page has high activity |
Examples
Basic embed
Place the widget next to your article title or in a sidebar.
<h2>My Blog Post</h2>
<script src="https://comment.page/widget.js"
data-url="https://myblog.com/post/123"></script>
Custom integration via API
Fetch data directly and render your own UI.
const url = encodeURIComponent('https://myblog.com/post/123');
const res = await fetch(`https://comment.page/widget?url=${url}`);
const data = await res.json();
// data.status → "active"
// data.commentCount → 42
// data.hot → true
Good to know
Style isolation
Shadow DOM keeps your CSS and the widget completely separate.
Graceful fallback
If the page is unreachable the widget stays invisible; unapproved domains show a clear hint. Never breaks your layout.
60s cache
Data refreshes automatically. No stale counts.
Click to discuss
Clicking the widget opens the discussion page in a new tab.
Register your site
Submit your details. Once approved, the widget will work on your domains.
Your request is pending approval. We'll enable the widget on your domains once reviewed.
Something went wrong. Please try again.