Developer-first SaaS API for EU VAT validation via VIES with Redis caching, change monitoring, and webhook notifications.
SaaS platform for PDF authenticity verification with a public REST API. Detects edits through 5-layer analysis of metadata, xref structure, digital signatures, and content.
Databases
Services
Key Results

When a bank receives a signed loan contract, or a law firm gets a countersigned agreement, or an HR team processes an employment certificate – how do they verify the document has not been edited after signing? Most organisations have no reliable answer. They look at the signature icon in Acrobat and assume that means something. Often it does not.
Enterprise PDF verification tools charge $1–$1.50 per document and require sales calls, NDAs, and annual contracts before you can run a single test. There was no self-service option for teams that need to verify dozens or hundreds of documents a month without going through an enterprise procurement process. The gap was obvious: a product that works via API, explains what it found, and costs less than a coffee per day.
I built a self-service SaaS that answers one question fast and clearly: has this signed PDF been edited since it was signed? Upload a document – or send it through the API – and within seconds you get a 0–100 risk score with the specific evidence behind it, not a black-box verdict you have to trust blindly.
The verdict is reliable because it is deterministic. A legitimate PDF has one internal revision table; every later edit adds another. That single, checkable fact – combined with metadata analysis, digital-signature validation, and fingerprinting of known editing tools – is more dependable than any heuristic guess, and it is reproducible: the same document always yields the same explained result.
Around that engine I built the full commercial product: sign-up, separate live and test API environments, tiered billing (a self-built billing layer handling mandates, proration, dunning, and EU VAT), and algorithm versioning so that when the detection logic improves, an older stored result is automatically flagged rather than silently trusted. For banks, law firms, and other regulated teams whose documents cannot leave their own infrastructure, an Enterprise Docker option runs the whole thing on-premise, addressing GDPR, HIPAA, and PCI DSS requirements. The API promo block on the site uses a looping SVG animation of the verification flow that I built separately.
What previously required an enterprise contract and per-document billing is now available via API for $15/month. Teams at banks, law firms, and HR departments can integrate PDF verification into their own workflows without a procurement process.
| Metric | Value |
|---|---|
| Analysis time | 18 s in-thread cap, 20 s worker hard limit |
| Max file size | 10 MB, direct upload to Cloudflare R2 |
| Detection markers | 7+ deterministic (iLovePDF, PDF24, QPDF, etc.) |
| Algorithm versions | v2.0.0 → v2.47.0 |
| Database schema | 26 tables, per-period credit pool with ledger |
| Pricing tiers | $15–$499/month + Enterprise on-premise |
The deterministic approach means results are reproducible, explainable, and fast. Enterprise option (Docker/Kubernetes) addresses GDPR, HIPAA, and PCI DSS requirements for fintech and legal clients.
The category – ‘PDF authenticity verification API’ – is small enough that organic discovery from developers searching for the exact problem is the primary acquisition channel. That makes technical SEO load-bearing, not optional:
SoftwareApplication, FAQPage, BreadcrumbList, and Organization – surfaces rich results for the long-tail queries this niche actually generates (‘detect if PDF was edited’, ‘verify digital signature PDF API’)llms.txt describing the API, pricing, and the technical articles – the developer audience increasingly evaluates tools through ChatGPT and Perplexity before they ever click throughFor the technically curious, here is how the core pieces are built. One real constraint shaped the upload path: real-world contracts and scans regularly run to several megabytes, so the browser uploads straight to object storage instead of sending the file through the application server.
A multi-step upload pattern: the browser asks the API for a presigned URL, uploads the PDF directly to Cloudflare R2, and then hands the object reference and a single-use token to a server action, which verifies the stored object and analyses it:
// hooks/useFileUpload.ts — Step 1: ask our API for a presigned PUT URL
const tokenRes = await fetch("/api/blob-token", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ filename: cleanFilename, size: file.size }),
});
const { uploadUrl, publicUrl, uploadToken } = await tokenRes.json();
// Step 2: browser → R2
await fetch(uploadUrl, {
method: "PUT",
body: file,
headers: { "Content-Type": "application/pdf" },
});
// Step 3: the server action redeems the token, checks the object, analyses it
const result = await analyzePdf(publicUrl, file.name, /* …client ids… */ uploadToken);
// lib/services/upload-intent.service.ts — hard ceiling on what an upload intent can authorise
export const MAX_UPLOAD_BYTES = 10 * 1024 * 1024;The /api/blob-token route checks the request origin as CSRF defence, rate-limits per IP (anonymous) or per user, rejects declared sizes above the 10 MB ceiling, and signs a short-lived PUT URL bound to the declared size under a staging/ prefix. Files up to 10 MB are accepted, and nothing under staging/ is analysed until the server has admitted the object.
Analysis is split into independent layers. The critical marker is xref table counting: a legitimate PDF has one, each incremental update adds another. PDF 1.5+ complicates this with xref streams (different syntax):
// lib/services/pdf-structure.service.ts
private countXrefTables(pdfBuffer: Buffer): number {
let count = 0;
let pos = 0;
while (pos < pdfBuffer.length) {
// Classic xref tables: "xref\n" at start of line
const xrefIdx = pdfBuffer.indexOf(Buffer.from('xref\n'), pos);
// xref streams (PDF 1.5+): "/Type /XRef" in stream dictionary
const xrefStreamIdx = pdfBuffer.indexOf(Buffer.from('/Type /XRef'), pos);
const nextIdx = Math.min(
xrefIdx === -1 ? Infinity : xrefIdx,
xrefStreamIdx === -1 ? Infinity : xrefStreamIdx
);
if (nextIdx === Infinity) break;
count++;
pos = nextIdx + 5;
}
return count;
}The algorithm is versioned (currently v2.47.0), and the version is saved with each result. When requesting /api/v1/result/{uid}, outdated results are automatically flagged with algorithmOutdated: true.
Quota is not derived from counting checks rows. Each subscriber has a per-period credit balance in users.subscriptionCreditsRemaining; a credit is debited when an analysis is reserved and compensated back if no result is delivered, and every change is appended to subscription_credit_ledger. Credits used is the monthly allowance minus the balance, so a check that costs more than one credit is reflected immediately (the admin dashboard reads it the same way):
// lib/services/subscription-credit-pool.ts
export function creditsUsedThisPeriod(row: {
requestsPerMonth: number | null;
subscriptionCreditsRemaining: number | null;
}): number {
if (row.requestsPerMonth == null) return 0;
return Math.max(0, row.requestsPerMonth - (row.subscriptionCreditsRemaining ?? 0));
}Keys follow format htpbe_{live|test}_{43-random-chars}. Test keys only accept mock URLs from whitelist – developers can test integration without consuming quota:
// app/api/v1/analyze/route.ts
const keyEnv = getApiKeyEnvironment(apiKey); // 'live' | 'test'
if (keyEnv === 'test') {
const TEST_URLS = ['https://htpbe.tech/samples/modified-high.pdf', ...];
if (!TEST_URLS.includes(file_url)) {
return Response.json({
error: 'Test keys only work with official HTPBE sample URLs',
test_urls: TEST_URLS,
}, { status: 422 });
}
}
// Live keys: fetch any public PDF URL, analyze, bill quotaLong-Term Validation (LTV) adds timestamps and certificates to signed PDFs – this is legitimate modification that shouldn’t trigger alerts:
// lib/services/pdf-ltv.service.ts
export function analyzeLTV(bytes: Uint8Array): LTVAnalysis {
const text = new TextDecoder("latin1").decode(bytes);
// Detect Document Security Store (DSS)
const hasDSS = /\/Type\s*\/DSS\b/.test(text);
// Detect Document Timestamp
const hasDTS =
/\/Type\s*\/DocTimeStamp\b/.test(text) || /\/SubFilter\s*\/ETSI\.RFC3161\b/.test(text);
// ETSI PAdES-LTV compliance markers
const isETSICompliant = hasDSS || hasDTS || /\/SubFilter\s*\/ETSI\.CAdES\.detached\b/.test(text);
return {
hasLTV: hasDSS || hasDTS,
hasDSS,
hasDTS,
isETSICompliant,
ltvDetails: isETSICompliant ? extractLTVDetails(bytes) : null,
};
}
AvailableNeed something similar?
I build custom solutions – from APIs to full products. Let’s talk about your project.
Developer-first SaaS API for EU VAT validation via VIES with Redis caching, change monitoring, and webhook notifications.
Vertical SaaS that gives a salon, barbershop or solo beauty specialist their own booking website in minutes.
40+ point production SaaS checklist: auth, Stripe billing, PostgreSQL, rate limiting, email, monitoring, and security – with honest 8-week build estimates.
Stack
Databases
API key management for a public SaaS: hashing keys at rest, prefix + last-4 display, fail-closed validation, and revocation.
Databases