Tsdiq badge API & embeds
Read a business's live evidence badges and display them anywhere. Tsdiq remains the source of truth: a copied image proves nothing, the verification link does.
Endpoints
| Method | Path | Description |
|---|---|---|
| GET | /api/public/v1/entities/{slug}/badges | All currently active badges held by a published business. |
| GET | /api/public/v1/badges/{reference} | One badge by its Tsdiq reference (TSB-…). Includes is_current — only true means it may be presented as held. |
| GET | /api/public/v1/badges/{reference}/image.svg | Live badge image. Query: variant=compact|standard|large, theme=dark|light. |
| GET | /api/public/v1/badge.js | Official loader script for [data-tsdiq-badge] placeholders. |
| POST | /api/public/v1/badges/event | Anonymous view/click telemetry sent by the loader. No personal data. |
All read endpoints are public, CORS-enabled, cached briefly and rate limited. No API key is required, and no personal data is returned.
Quick start
<div data-tsdiq-badge="TSB-XXXXXXXXXXXX" data-tsdiq-variant="standard" data-tsdiq-theme="dark"></div> <script src="https://tsdiq.com/api/public/v1/badge.js" async></script>
Prefer a plain image? Link the SVG endpoint to the verification page — never host a copy of the image yourself, because a hosted copy cannot expire.
<a href="https://tsdiq.com/verify/badge/TSB-XXXXXXXXXXXX" target="_blank" rel="noopener"> <img src="https://tsdiq.com/api/public/v1/badges/TSB-XXXXXXXXXXXX/image.svg" alt="Tsdiq verified badge" /> </a>
Product-inline badge
Place one compact badge next to each product. It renders live from Tsdiq and links to the business's public evidence profile. Stack several references to show every badge the business currently holds.
<script src="https://tsdiq.com/api/public/v1/badge.js" async></script> <div data-tsdiq-badge="TSB-XXXXXXXXXXXX" data-tsdiq-variant="compact" data-tsdiq-theme="dark"></div>
React / Lovable projects — a reusable component:
import { useEffect } from "react";
export function TsdiqBadge({ reference, variant = "compact" }: { reference: string; variant?: "compact" | "standard" | "large" }) {
useEffect(() => {
if (!document.querySelector('script[src*="badge.js"]')) {
const s = document.createElement("script");
s.src = "https://tsdiq.com/api/public/v1/badge.js";
s.async = true;
document.body.appendChild(s);
}
}, []);
return <div data-tsdiq-badge={reference} data-tsdiq-variant={variant} data-tsdiq-theme="dark" />;
}Minimal footer badge
A one-line footer strip for every page: the live badge image linked to the public verification page. Never host a copy of the image — only the live URL can reflect a status change.
<a href="https://tsdiq.com/verify/badge/TSB-XXXXXXXXXXXX" target="_blank" rel="noopener" style="display:inline-flex;align-items:center;gap:8px"> <img src="https://tsdiq.com/api/public/v1/badges/TSB-XXXXXXXXXXXX/image.svg?variant=compact&theme=dark" alt="Verified on Tsdiq" height="28" /> <span style="font-size:12px">Verified on Tsdiq</span> </a>
Lifecycle
- Badges are awarded only by the Tsdiq evidence engine; they cannot be requested.
- Revoked, expired, superseded and non-production awards are never returned as current, and the live image switches to a neutral “not current” treatment.
- Responses carry short cache lifetimes with revalidation, so a status change reaches embedded badges within minutes.

