What is LLM Scraper?
LLM Scraper is a TypeScript library for pulling structured data out of any webpage. You define the shape of the data you want with a Zod or JSON schema, point it at a live page, and an LLM fills in the values. It sits in the Web Scraping & Crawling category of the Data & Labeling tools and is open-source, written in TypeScript.
Overview
LLM Scraper is a TypeScript library for pulling structured data out of any webpage. You define the shape of the data you want with a Zod or JSON schema, point it at a live page, and an LLM fills in the values. The result is fully typed, so you get the same fields you described in your schema.
It is built for developers who already work with Node and TypeScript and want to avoid writing brittle CSS selectors or XPath rules that break when a site changes its markup. Instead of describing how to find each value, you describe what you want, and the model reads the page for you.
Within the web scraping and crawling space, it sits on top of Playwright for loading pages and the Vercel AI SDK for talking to models, so it works with OpenAI, Anthropic, Google, Groq, Ollama, and other supported providers.
What it does
- Define output with Zod or plain JSON Schema and get full TypeScript type-safety
- Works with GPT, Sonnet, Gemini, Llama, and Qwen model series through the Vercel AI SDK
- Built on Playwright, so it drives a real browser to load pages
- Six input formatting modes: html, raw_html, markdown, text, image, and custom
- Stream partial objects as the model extracts them via the stream() method
- Generate a reusable Playwright scraping script from a schema with generate()
Getting started
Install the library with Playwright and Zod, pick an LLM provider, then run a scraper against a page.
Install dependencies
Install the core library together with Zod and Playwright from npm.
npm i zod playwright llm-scraperInitialize an LLM provider
Install a provider package and create a model instance. This example uses OpenAI.
npm i @ai-sdk/openaiCreate a scraper and extract data
Launch a browser, open a page, define a schema, and run the scraper to get typed data back.
import { chromium } from 'playwright'
import { z } from 'zod'
import { Output } from 'ai'
import { openai } from '@ai-sdk/openai'
import LLMScraper from 'llm-scraper'
const browser = await chromium.launch()
const llm = openai('gpt-4o')
const scraper = new LLMScraper(llm)
const page = await browser.newPage()
await page.goto('https://news.ycombinator.com')
const schema = z.object({
top: z
.array(
z.object({
title: z.string(),
points: z.number(),
by: z.string(),
commentsURL: z.string(),
})
)
.length(5)
.describe('Top 5 stories on Hacker News'),
})
const { data } = await scraper.run(page, Output.object({ schema }), {
format: 'html',
})
console.log(data.top)
await page.close()
await browser.close()Commands and code are distilled from the project's own documentation — always check the official repo for the latest.
When to use it
- Turn a list page, like Hacker News front page or a search results page, into a typed array of records
- Collect product, listing, or article fields from sites that change their markup often and break selector-based scrapers
- Stream large extractions and show partial results as the model fills in the schema
- Generate a reusable Playwright script once, then run it repeatedly without calling the model each time
How LLM Scraper compares
LLM Scraper alongside other open-source web scraping & crawling tools AI/TLDR tracks, ranked by GitHub stars.
| Tool | Stars | What it does |
|---|---|---|
| Firecrawl | ★ 214k | A crawling service and API that converts whole websites into clean Markdown or structured JSON ready for LLMs. |
| Agent Reach | ★ 116k | A capability layer that installs, health-checks and routes readers so a CLI agent can read and search web pages, YouTube, RSS, GitHub, Reddit, Twitter/X and more without API fees. |
| Scrapling | ★ 107k | A Python web scraping framework whose parser relocates your elements when pages change, with stealthy fetchers and a Scrapy-like spider engine for full crawls. |
| Crawl4AI | ★ 88.2k | A local-first Python web crawler that turns pages into clean Markdown for use in RAG and LLM pipelines. |
| Scrapy | ★ 65.7k | A mature Python framework for writing fast spiders that crawl websites and extract structured data at scale. |
| changedetection.io | ★ 36.1k | A self-hosted web page change monitor with XPath/CSS/jq filters, browser steps and restock alerts, which can route every diff through an LLM to suppress noise. |
| ScrapeGraphAI | ★ 33k | A Python library that uses LLMs and a graph pipeline to extract data from pages based on natural-language prompts. |
| LLM Scraper | ★ 7k | Extract structured data from any webpage using LLMs and Zod schemas |

