{
  "markdown": "# Document-to-JSON Converter\n\n> **Turn PDFs into structured JSON in seconds. AI-powered, no coding needed.**\n\n![MCP Server](https://img.shields.io/badge/MCP-Server-blue)\n![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)\n![Apify](https://img.shields.io/badge/Apify-Actor-green)\n\n---\n\n## 🚀 What does it do?\n\nPaste a PDF URL → get structured JSON. That's it.\n\n**Powered by AI.** Instead of rigid templates or fragile regex, an AI model actually\n*reads and understands* each document — so it adapts to any layout, language, or vendor,\nand even handles scanned files. That's why the same tool works on an Italian invoice, a\nSpanish receipt, or an English contract without any configuration.\n\nPerfect for:\n- **Accountants** — extract invoice data (numbers, dates, totals, VAT, IBAN)\n- **Developers** — automate document processing in your apps\n- **Business analysts** — convert bank statements to spreadsheets\n- **Legal teams** — extract contract clauses and dates automatically\n\n## 📋 Supported documents\n\n| Type | What you get | Price |\n|---|---|---|\n| **Invoice** | Seller, buyer, line items, totals, VAT, IBAN, payment info | $0.01 |\n| **Bank Statement** | All transactions, balances, fees, account holder | $0.015 |\n| **Contract** | Parties, key clauses, dates, financial terms, jurisdiction | $0.02 |\n| **Generic** | Full text + tables from any document | **Free during launch** |\n\n## ✨ Example output\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"document_type\": \"invoice\",\n    \"confidence\": 0.97,\n    \"metadata\": {\n      \"invoice_number\": \"INV-2024-00123\",\n      \"invoice_date\": \"2024-03-15\",\n      \"currency\": \"EUR\"\n    },\n    \"seller\": {\n      \"name\": \"Acme S.p.A.\",\n      \"vat_id\": \"IT01234567890\"\n    },\n    \"line_items\": [\n      {\n        \"description\": \"Consulting services\",\n        \"quantity\": 1,\n        \"unit_price\": 5000.00,\n        \"net_amount\": 5000.00,\n        \"vat_rate\": 22.0,\n        \"total\": 6100.00\n      }\n    ],\n    \"totals\": {\n      \"net_total\": 5000.00,\n      \"vat_total\": 1100.00,\n      \"grand_total\": 6100.00\n    },\n    \"payment_info\": {\n      \"iban\": \"IT60X0542811101000000123456\"\n    }\n  }\n}\n```\n\n## 🧪 Live examples — try them now\n\nRun the Actor on these public sample PDFs (synthetic data) to see the extraction quality for yourself:\n\n| Type | Sample PDF | What the AI extracts (highlights) |\n|---|---|---|\n| **Invoice** | [sample-invoice.pdf](https://raw.githubusercontent.com/fashionmascherine-svg/document-to-json-mcp/main/examples/sample-invoice.pdf) | Invoice `INV-2026-0042`, seller + buyer with VAT IDs, 2 line items, VAT 22%, **grand total €1,889.78** — *confidence 1.0* |\n| **Bank statement** | [sample-bank-statement.pdf](https://raw.githubusercontent.com/fashionmascherine-svg/document-to-json-mcp/main/examples/sample-bank-statement.pdf) | 7 transactions auto-categorized, opening/closing balances **reconciled to €8,655.28** — *confidence 1.0* |\n| **Contract** | [sample-contract.pdf](https://raw.githubusercontent.com/fashionmascherine-svg/document-to-json-mcp/main/examples/sample-contract.pdf) | 2 parties + roles, effective/expiry/renewal dates, fee €5,000, **5 key clauses** with summaries, jurisdiction — *confidence 0.95* |\n\nJust paste one of these URLs as `file_url`, pick the matching `document_type`, and run. Each extraction takes ~15–20 seconds.\n\n## 🎯 Why this Actor?\n\n| Feature | Benefit |\n|---|---|\n| **AI understanding** | An AI reads documents like a human — adapts to any layout, no templates or rules to maintain |\n| **Multi-language** | English, Italian, Spanish (OCR) |\n| **OCR included** | Works with scanned documents too |\n| **Validation** | Auto-checks totals and dates for accuracy |\n| **Pay per use** | No subscription, pay only for what you process |\n\n## 🔧 How to use\n\n1. **Get a public PDF URL** (Dropbox, Google Drive, your server)\n2. **Select the document type**\n3. **Run the Actor**\n4. **Get your JSON** in seconds\n\nThat's it. No configuration, no API keys needed.\n\n## 💰 Pricing\n\n| Document type | Price |\n|---|---|\n| Invoice | **$0.01** ($10/1000) |\n| Bank statement | **$0.015** ($15/1000) |\n| Contract | **$0.02** ($20/1000) |\n| Generic | **Free during launch** |\n\n*Pay-per-event via Apify. Pay only for successful extractions. No subscription, no hidden fees.*\n\n## 🔒 Privacy\n\n- PDFs are processed and **not stored** after extraction\n- Data is available in your private dataset\n- All API keys stay encrypted\n\n## 📚 Supported OCR languages\n\n`eng` (English), `ita` (Italian), `spa` (Spanish)\n\nCombine with `+` for multi-language scanned documents: `eng+ita+spa` (default)\n\n## 🤖 Built for AI agents (MCP)\n\nThis Actor is an **MCP server**: AI agents can call it directly as a tool to turn any\nPDF into JSON, with zero configuration — just pass a public `file_url`. Specialized\ntools (`parse_invoice`, `parse_bank_statement`, `parse_contract`) and a free\n`parse_generic_document` make it easy for an LLM to pick the right one for the task.\n\n## 🔌 Integrations\n\n> Replace `YOUR_APIFY_TOKEN` with your token from [Apify → Settings → Integrations](https://console.apify.com/account/integrations).\n\n### Claude Code (CLI)\n\n```bash\nclaude mcp add --transport http apify \\\n  \"https://mcp.apify.com/?actors=opportunity-biz/document-to-json-mcp\"\n```\n\n### Claude Desktop / Cursor (MCP)\n\nAdd to your MCP config (`claude_desktop_config.json` or Cursor's `mcp.json`):\n\n```json\n{\n  \"mcpServers\": {\n    \"document-to-json\": {\n      \"command\": \"npx\",\n      \"args\": [\n        \"-y\", \"mcp-remote\",\n        \"https://mcp.apify.com/?actors=opportunity-biz/document-to-json-mcp\",\n        \"--header\", \"Authorization: Bearer YOUR_APIFY_TOKEN\"\n      ]\n    }\n  }\n}\n```\n\nThe agent then sees `parse_invoice`, `parse_bank_statement`, `parse_contract`, and\n`parse_generic_document` as tools and calls them on its own.\n\n### REST API (any language)\n\nOne call in, JSON out — `run-sync-get-dataset-items` returns the result directly:\n\n```bash\ncurl -X POST \\\n  \"https://api.apify.com/v2/acts/opportunity-biz~document-to-json-mcp/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"file_url\": \"https://example.com/invoice.pdf\", \"document_type\": \"invoice\", \"validate_totals\": true}'\n```\n\n### Python\n\n```python\nfrom apify_client import ApifyClient\n\nclient = ApifyClient(\"YOUR_APIFY_TOKEN\")\nrun = client.actor(\"opportunity-biz/document-to-json-mcp\").call(run_input={\n    \"file_url\": \"https://example.com/invoice.pdf\",\n    \"document_type\": \"invoice\",\n})\nfor item in client.dataset(run[\"defaultDatasetId\"]).iterate_items():\n    print(item)\n```\n\n### JavaScript / TypeScript\n\n```javascript\nimport { ApifyClient } from 'apify-client';\n\nconst client = new ApifyClient({ token: 'YOUR_APIFY_TOKEN' });\nconst run = await client.actor('opportunity-biz/document-to-json-mcp').call({\n  file_url: 'https://example.com/invoice.pdf',\n  document_type: 'invoice',\n});\nconst { items } = await client.dataset(run.defaultDatasetId).listItems();\nconsole.log(items);\n```\n\n### n8n\n\nUse an **HTTP Request** node (POST) to the REST API URL above, or the official\n**Apify** node → select `document-to-json-mcp` → set `file_url` and `document_type`.\nGreat for \"watch inbox → extract invoice → append to Google Sheet\" workflows.\n\n### LangChain / CrewAI / any MCP framework\n\nPoint your agent framework's MCP client at\n`https://mcp.apify.com/?actors=opportunity-biz/document-to-json-mcp` — the parsing\ntools are exposed automatically.\n",
  "bytes": 7412,
  "sha": "1321e8b63dcf0ac12d11c881ffc82361fe83ecdaebfa1b748e541963516f6026",
  "repo_slug": "fashionmascherine-svg/document-to-json-mcp",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_fashionmascherine_svg_document_31784738/readme"
}