# Invoice PDF to Excel & CSV (`adhistory/invoice-pdf-to-excel`) Actor

Extract invoice number, dates, vendor, currency, subtotal, tax, total and line items from invoice PDFs, with an Excel file and CSVs. Billed only for invoices delivered: $5 per 1,000.

- **URL**: https://apify.com/adhistory/invoice-pdf-to-excel.md
- **Developed by:** [Brandon Ob](https://apify.com/adhistory) (community)
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.50 / 1,000 invoices

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Invoice PDF to Excel & CSV: extract invoice data from PDF links

This invoice PDF to Excel converter reads the invoice PDFs you link to and returns one row per invoice: invoice number, invoice date, due date, vendor, currency, subtotal, tax, total and the line items. You also get one Excel file for the whole run (an Invoices sheet and a Line items sheet) and two CSV files. You are charged per invoice delivered, never for a PDF that failed or was not an invoice.

### What does Invoice PDF to Excel & CSV do?

- **Extracts invoice header fields**: invoice number, invoice date, due date, vendor, currency, subtotal, tax and total.
- **Extracts line items**: description, quantity, unit price and amount for each item row (can be switched off).
- Recognizes labels in **English, French, German, Spanish, Dutch and Italian** (for example "Invoice No", "Facture n°", "Rechnungsnr.").
- Normalizes numbers written as `1.234,56`, `1,234.56` or `1 234,56`, and returns clear dates as `YYYY-MM-DD`.
- Writes **one Excel workbook for the run** (Invoices and Line items sheets) plus `invoices.csv` and `line-items.csv`.
- Opens password-protected PDFs when you give the password.
- Lists PDFs that could not be read, or did not look like invoices, in a `SUMMARY` record.

### Use cases

- **Bookkeepers and accountants:** turn a month of supplier invoices into one spreadsheet for reconciliation or import into accounting software.
- **Accounts payable teams:** check totals, tax and due dates across many invoices at once.
- **Freelancers and small businesses:** build an expense log from invoices received by email.
- **Procurement and spend analysis:** compare line items and prices across vendors.
- **Automation builders:** add an "invoice to rows" step after a mailbox or cloud-folder trigger, then push the rows to Google Sheets or a database.

### How to use it

1. Open the Actor in Apify Console and add invoice PDF links, one per line. Each file must open in a browser without a login.
2. Optional: turn off **Extract line items** if you only need the header fields and totals.
3. Click **Start**.
4. Open the **Invoices** view, download the dataset, or use the `excelUrl` link for the workbook.
5. To process new invoices regularly, save your input as a task and schedule it, or call the Actor from the API.

### Input

| Field | What it does |
|---|---|
| `pdfUrls` | Direct links to invoice PDFs, one per line. |
| `extractLineItems` | Also read the item rows (on by default). |
| `pdfPassword` | Optional, for password-protected files. |
| `maxItems` | Stop after this many invoices (default 100). |

Example input:

```json
{
  "pdfUrls": ["https://raw.githubusercontent.com/invoice-x/invoice2data/master/tests/compare/NetpresseInvoice.pdf"],
  "extractLineItems": true,
  "maxItems": 100
}
```

### Output

One dataset item per invoice. Real output from the example input above (a French invoice from a public test set), shortened:

```json
{
  "invoiceNumber": "2022089083",
  "invoiceDate": "2022-11-28",
  "dueDate": null,
  "vendor": "ALEXINUX",
  "currency": "EUR",
  "subtotal": 46.68,
  "tax": 9.34,
  "total": 56.02,
  "lineItems": [
    {"description": "le-tout-lyon.fr du 06/12/2022", "quantity": null, "unitPrice": null, "amount": 45.93},
    {"description": "Justificatif", "quantity": 1, "unitPrice": 0.75, "amount": 0.75},
    {"description": "Justificatif Papier", "quantity": 0, "unitPrice": 3.5, "amount": 0.0}
  ],
  "pdfUrl": "https://raw.githubusercontent.com/invoice-x/invoice2data/master/tests/compare/NetpresseInvoice.pdf",
  "pages": 1,
  "extractedAt": "2026-10-26T10:41:02+00:00",
  "excelUrl": "https://api.apify.com/v2/key-value-stores/<storeId>/records/invoices.xlsx"
}
```

The key-value store holds `invoices.xlsx`, `invoices.csv`, `line-items.csv` and the `SUMMARY` record. The dataset can be downloaded as JSON, CSV, Excel, XML or HTML, or read through the API.

### Pricing

Pay per event: **$5.00 per 1,000 invoices** delivered, plus a $0.00005 charge per Actor start. PDFs that fail or are not invoices are not charged. You can set a maximum cost per run.

Discounts apply automatically on paid Apify plans: 10% off on Starter, 20% on Scale and 30% on Business.

Example: 200 invoices a month cost about **$1.00**.

### Integrations and API

Run it and get the invoices back in one call:

```bash
curl -X POST "https://api.apify.com/v2/acts/adhistory~invoice-pdf-to-excel/run-sync-get-dataset-items?token=<YOUR_API_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"pdfUrls": ["https://example.com/invoice-1042.pdf"], "extractLineItems": true}'
```

Python, with the `apify-client` package:

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_API_TOKEN>")
run = client.actor("adhistory/invoice-pdf-to-excel").call(run_input={
    "pdfUrls": ["https://example.com/invoice-1042.pdf"],
})
for inv in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(inv["invoiceNumber"], inv["vendor"], inv["total"], inv["currency"])
```

Like every Apify Actor, it also works with Make, Zapier and n8n, with webhooks and schedules, and as a tool for AI agents through the Apify MCP server.

### FAQ

**Does it read scanned invoices?** No. It needs PDFs that contain real text. A scanned invoice (a picture of paper) fails with a clear message; there is no OCR.

**A field is empty. Why?** The invoice probably uses a label the Actor does not know, or none at all. Open an issue with the layout (no private data needed) and I will add the label.

**How are dates handled?** Dates are returned as `YYYY-MM-DD` when the order of day and month is clear (for example `28/11/2022`). Ambiguous dates such as `03/04/2022`, and dates with a month name, are returned as printed.

**How reliable are line items?** They are a best effort. Rows with description, quantity, unit price and amount on one line work best; quantity and unit price are filled only when the row has exactly three numbers. Multi-line descriptions, discounts and tax columns can split or merge rows.

**Which total is used if there are several?** The number printed next to the total label; with several totals (for example one per page), the last one.

**Are there file limits?** Up to 50 MB per PDF, from public links. Check that you are allowed to process the invoices you submit.

### Related tools

- [PDF Table to Excel & CSV](https://apify.com/adhistory/pdf-tables-to-excel): every table from any text-based PDF.
- [Bank Statement PDF to Excel & CSV](https://apify.com/adhistory/bank-statement-to-excel): transactions and balances from bank statements.
- [Payslip PDF to Excel & CSV](https://apify.com/adhistory/payslip-pdf-to-excel): pay, tax and deductions from payslips.
- [Google Sheets Export & Import](https://apify.com/adhistory/google-sheets-export-actor): send invoice rows straight into a Google Sheet.

Found a bug or need a feature? Open an issue on the Issues tab — I usually reply within a day.

# Actor input Schema

## `pdfUrls` (type: `array`):

Direct links to invoice PDF files, one per line. The file must be reachable without a login.

## `extractLineItems` (type: `boolean`):

Also read the item rows (description, quantity, unit price, amount). Turn off to get header fields and totals only.

## `pdfPassword` (type: `string`):

Optional. Only for password-protected files.

## `maxItems` (type: `integer`):

Stop after this many invoices. You are charged per invoice delivered.

## Actor input object example

```json
{
  "pdfUrls": [
    "https://raw.githubusercontent.com/invoice-x/invoice2data/master/tests/compare/NetpresseInvoice.pdf"
  ],
  "extractLineItems": true,
  "maxItems": 100
}
```

# Actor output Schema

## `invoices` (type: `string`):

No description

## `summary` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "pdfUrls": [
        "https://raw.githubusercontent.com/invoice-x/invoice2data/master/tests/compare/NetpresseInvoice.pdf"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("adhistory/invoice-pdf-to-excel").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "pdfUrls": ["https://raw.githubusercontent.com/invoice-x/invoice2data/master/tests/compare/NetpresseInvoice.pdf"] }

# Run the Actor and wait for it to finish
run = client.actor("adhistory/invoice-pdf-to-excel").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "pdfUrls": [
    "https://raw.githubusercontent.com/invoice-x/invoice2data/master/tests/compare/NetpresseInvoice.pdf"
  ]
}' |
apify call adhistory/invoice-pdf-to-excel --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,adhistory/invoice-pdf-to-excel"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/j6F50VfdEEjnLictf/builds/h94fE40F8yuew1Uc7/openapi.json
