PDF & Document Data Extraction
Pull structured fields out of PDFs, reports, and filings without building a parser. process_document reads the file, extract_with_llm returns typed JSON.
Quick Answer
Point process_document (2 credits) at a PDF URL or file to get text, sections, and metadata, then pass that text to extract_with_llm (3 credits) with a JSON schema to get typed fields back. About 5 credits per document, and extraction defaults to a local Ollama model so contents stay on your machine.
The Problem
Critical numbers live in PDFs: annual reports, price lists, regulatory filings, research papers. Copying them out by hand does not scale, and generic PDF libraries return a wall of text with no structure you can query.
The Solution
CrawlForge process_document extracts text, sections, and metadata from a PDF URL or file, and extract_with_llm turns that text into the exact JSON shape you asked for -- running against local Ollama by default, so document contents never leave your machine.
Code Example
// Pull structured fields out of a PDF report
const doc = await mcp.process_document({
source: "https://example.com/2026-annual-report.pdf",
sourceType: "pdf_url",
options: { extractText: true, extractMetadata: true },
});
// Ask for exactly the fields you need, as JSON
const fields = await mcp.extract_with_llm({
content: doc.text,
prompt: "Extract fiscal year, revenue, operating margin, and headcount.",
schema: {
type: "object",
properties: {
fiscalYear: { type: "string" },
revenue: { type: "string" },
operatingMargin: { type: "string" },
headcount: { type: "number" },
},
},
});
console.log(doc.metadata.pageCount);
console.log(fields.data);Tools Used
Estimated cost: ~5 credits per document
Frequently Asked Questions
How do I extract data from a PDF automatically?
Point process_document at the PDF URL or file to get text, sections, and metadata, then send that text to extract_with_llm with a JSON schema describing the fields you want. You get typed JSON back instead of a wall of text.
Does the PDF have to be online?
No. process_document accepts a URL or a local file path via sourceType — url, pdf_url, file, or pdf_file — and options such as pageRange and maxPages let you process only the pages you care about.
Which model does the extraction use?
extract_with_llm defaults to a local Ollama model, so document contents never leave your machine. Pass provider openai or anthropic with the matching API key when you want a cloud model instead.
What does document extraction cost?
About 5 credits per document: 2 for process_document and 3 for extract_with_llm. The free 1,000-credit tier covers roughly 200 documents, enough to validate the pipeline against a real archive before upgrading.
Ready to Get Started?
Every new account gets 1,000 free credits. No credit card required.
Start Free with 1,000 Credits