DEV Community

Cover image for I Built a PDF Hosting Service with Per-View Analytics and a REST API — Here's How It Works
Samuel Aondo
Samuel Aondo

Posted on

I Built a PDF Hosting Service with Per-View Analytics and a REST API — Here's How It Works

Sharing a PDF is trivial. Knowing whether anyone actually opened it, how long they read, and where they dropped off is the part most tools skip. I built PDFHost to solve that specific gap — permanent hosted links plus real analytics per document, with an API for teams that want to wire it into their own product instead of using a dashboard.

The core idea

Upload a PDF, get a permanent link (pdfhost.se/d/xxxx), embed it or share it directly.

Every open is tracked: view count, average read time, geographic distribution, and completion rate.

For anyone sending pitch decks, proposals, or contracts, that data is the whole point — you want to know if the doc got opened at all before you follow up.

Stack notes

  • CDN-backed delivery for sub-100ms loads globally — PDFs are often multi-MB, so edge caching matters more here than for typical static assets

  • Embeddable viewer — a single script/iframe tag drops a full PDF viewer into any page, no dependency on the visitor having a PDF plugin

  • REST API + webhooks for programmatic upload/manage/track — built this specifically because a few early users wanted to auto-generate and host reports without touching a dashboard

  • Password protection that can be revoked independently of the link itself — so you can lock/unlock access without regenerating and re-sending a new URL

The upload-before-signup flow

One UX detail worth mentioning: the flow lets you drop a PDF in before creating an account. The file is held while you sign up, then it lands directly in your dashboard. Cut a surprising amount of friction compared to a signup-wall-first flow.

What's next

Working on deeper analytics (scroll depth per page, not just aggregate read time) and expanding the custom-domain setup to be fully self-serve.

If you're curious or have a use case that needs tracked document sharing: https://pdfhost.se — would love feedback from other builders on the API design.

Top comments (0)