Skip to main content
Distill — URL to Structured Data for AI Pipelines project overview
All work

Distill — URL to Structured Data for AI Pipelines

AI pipelines constantly need live web content in structured form — and raw scraped HTML is not it. Distill is a REST API that fetches any URL with a full Playwright browser, then uses Gemini to extract exactly the fields the calling system specified, returning clean structured JSON.

Client
Open-source — self-built
Industry
AI Infrastructure / Developer Tools
Year
2026
Built with
  • TypeScript
  • Python
  • FastAPI
  • Playwright
  • Redis
  • PostgreSQL
  • Gemini API
  • Docker

The situation

Almost every AI pipeline built for clients needed to pull live information from the web — competitor pricing, product specs, news articles, documentation pages, public listings. The standard approach is to scrape the HTML, strip the tags, and dump plain text into the prompt.

That works for simple static pages. It breaks on JavaScript-rendered content, dynamic loading, paginated results, and anything with a complex DOM. And even when the scrape succeeds, it produces unstructured blobs that make the AI's job harder. The model has to locate, parse, and interpret the data before it can use it. Half the context window is spent on noise.

What I built

Distill is a REST API service that accepts a URL and a JSON schema, fetches the page using a full Playwright browser — handling JavaScript, cookies, dynamic loading, and pagination — and uses Gemini to extract exactly the fields the calling system asked for, in the shape it specified. The output is clean structured JSON, not a scraped text dump.

A Redis cache layer means the same URL fetched twice in a short window costs nothing. PostgreSQL stores extraction history, schema definitions, and audit records. The service runs as a FastAPI application deployable anywhere with Docker. The TypeScript client library wraps the API for use inside n8n HTTP Request nodes or any Node.js pipeline.

The outcome

1 API call

replaces a bespoke scraper on every pipeline that needs web data

Built by extracting the pattern from the fourth consecutive client project that needed web data in a structured form for an AI pipeline. Rebuilt the same scraping and extraction layer four times across four projects. Productized it once instead of rebuilding it a fifth time.

Now runs as shared infrastructure underneath multiple pipeline builds. When a client project needs web data, the answer is a single Distill API call with a schema — not another bespoke scraper.

Answers from this site. Anything else reaches Hephzibah.