Ro

Robust LLM extractor for websites in TypeScript

Hacker News

Robust LLM extractor for websites in TypeScript

We've been building data pipelines that scrape websites and extract structured data for a while now. If you've done this, you know the drill: you write CSS selectors, the site changes its layout, everything breaks at 2am, and you spend your morning rewriting parsers. LLMs seemed like the obvious fix — just throw the HTML at GPT and ask for JSON. Except in practice, it's more painful than that: - Raw HTML is full of nav bars, footers, and tracking junk that eats your token budget. A typical product page is 80% noise. - LLMs return malformed JSON more often than you'd expect, especially with nested arrays and complex schemas. One bad bracket and your pipeline crashes. - Relative URLs, markdown-escaped links, tracking parameters — the "small" URL issues compound fast when you're processing thousands of pages. - You end up writing the same boilerplate: HTML cleanup → markdown conversion → LLM call → JSON parsing → error recovery → schema validation. Over and over. We got tired of rebuilding this stack for every project, so we extracted it into a library. Lightfeed Extractor is a TypeScript library that handles the full pipeline from raw HTML to validated, structured data: - Converts HTML to LLM-ready markdown with main content extraction (strips nav, headers, footers), optional image inclusion, and URL cleaning - Works with any LangChain-compatible LLM (OpenAI, Gemini, Claude, Ollama, etc.) - Uses Zod schemas for type-safe extraction with real validation - Recovers partial data from malformed LLM output instead of failing entirely — if 19 out of 20 products parsed correctly, you get those 19 - Built-in browser automation via Playwright (local, serverless, or remote) with anti-bot patches - Pairs with our browser agent (@lightfeed/browser-agent) for AI-driven page navigation before extraction We use this ourselves in production at Lightfeed, and it's been solid enough that we decided to open-source it. GitHub: https://github.com/lightfeed/extractor npm: npm install @lightfeed/extractor Apache 2.0 licensed. Happy to answer questions or hear feedback.

Share card

Actual performance

72points
50comments
Made the leaderboard

Launch Intel predictions

Analyze your own launch →
Product HuntOn track for Day 1 leaderboard · Strong signals: agent, claude, openai · Missing: mac, agents, macos
91%91% predicted probability of success on Product Hunt, based on ML models trained on real launch data.
best fitHighest predicted score across all platforms for this description.
Indie HackersFits the IH revenue-focused audience · Strong signals: para, gemini, compatible · Missing: supports, reddit linkedin, podcasting
87%87% predicted probability of success on Indie Hackers, based on ML models trained on real launch data.
Hacker NewsMay not resonate with HN audience · Strong signals: llama, ide, pipe · Missing: https docs, excited, just released
48%48% predicted probability of success on Hacker News, based on ML models trained on real launch data.
nativeThis product was originally launched on this platform.
TrustMRRLess likely to generate early MRR · Strong signals: para · Missing: mobile apps, ios, personal
40%40% predicted probability of success on TrustMRR, based on ML models trained on real launch data.
AppSumoMay struggle as an AppSumo deal · Missing: plus, platform, intuitive
28%28% predicted probability of success on AppSumo, based on ML models trained on real launch data.
Acquire.comPre-revenue stage for this audience · Strong signals: arr · Missing: mrr, revenue, profit
14%14% predicted probability of success on Acquire.com, based on ML models trained on real launch data.
BetaListMay not resonate with beta-testers · Missing: web3, chat, crypto
0%0% predicted probability of success on BetaList, based on ML models trained on real launch data.

Incorrect prediction on native model

Similar products

Mo
Modelsmith – Yet another LLM entity extractor55%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Modelsmith – Yet another LLM entity extractor

Hacker News1
Co
Concept extractor44%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Concept extractor

Hacker News4
Ce
Cerialize – Typescript serialization by annotation39%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Cerialize – Typescript serialization by annotation

Hacker News1
Sc
Scala-ts – Scala to TypeScript compiler41%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Scala-ts – Scala to TypeScript compiler

Hacker News66
Ha
Hapi with Typescript51%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Hapi with Typescript

Hacker News2
JS
JSONSchema to TypeScript compiler51%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

JSONSchema to TypeScript compiler

Hacker News72
Tr
Transpile Scala to TypeScript29%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Transpile Scala to TypeScript

Hacker News1
Ge
Get started modding Factorio in TypeScript44%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Get started modding Factorio in TypeScript

Hacker News69
We
WebSockets Explained with TypeScript64%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

WebSockets Explained with TypeScript

Hacker News3
Du
DuoCode 1.0 bridges the gap between C# and TypeScript31%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

DuoCode 1.0 bridges the gap between C# and TypeScript

Hacker News7