# Parsley

> AI document parser that transforms PDFs or images into structured JSON or CSV data

- **Year**: 2025
- **Platforms**: web
- **Tools**: [TanStack Start](https://tanstack.com/start), [Vercel AI SDK](https://wastu.net/experiments/parsley/tools/vercel-ai-sdk), [OpenRouter](https://wastu.net/experiments/parsley/tools/openrouter)
- **Links**: [GitHub](https://github.com/bgwastu/parsley), [Visit the website](https://parsley.wastu.net)

I used to build custom OCR systems for every document type I needed to parse. Bank statements were especially tedious: hardcoded pixel positions, regex patterns for each bank's format, and brittle parsing logic that broke with every minor PDF template change. Then I'd need similar setups for invoices, receipts, forms.

# The solution

Rather than keep fighting with OCR, I built Parsley with LLMs. It understands the content directly and structures it as needed. If you ask for "customer name" it finds it, whether it's labeled "Bill To:", "Customer:", or hidden in a paragraph. No hardcoded positions or regex.

Your API keys are used directly in the web app, so documents go straight to Google or OpenRouter. I can't access them. Everything stays stateless.

# Features

- Custom schemas (define your own structure, or let AI generate it)
- Supports PDF (including password-protected) and images (PNG, JPEG, WebP)
- Multiple AI providers (Google Gemini, OpenRouter, your own keys)
- Demo mode with rate-limited free tier (no API key needed)
- Export as JSON or CSV
- API works with n8n, Zapier, or other automation tools

# How I use it

I run invoices through Parsley in n8n, extract the needed data, and send it straight to my accounting spreadsheet. Same approach for bank statements, receipts, forms, any document where I want structured data fast.

#### Why I used Vercel AI SDK in Parsley

I like [Vercel AI SDK](https://ai-sdk.dev) because I can switch or combine models while keeping the same SDK. For Parsley, I wanted that flexibility when choosing models for different documents.

#### Why I used OpenRouter in Parsley

I wanted people to choose a model that suited their documents and budget, using their own API key. [OpenRouter](https://openrouter.ai) felt like a practical way to offer that choice.
