# PDF to Excel API, processed in the EU

> Convert PDF tables to Excel through an API that runs in the EU. Numbers arrive as numbers, scanned pages work too. Free API key with 20 files a day.

Send a PDF and get an Excel workbook back. Each table arrives in its own cells, with numbers and dates as values you can calculate with.

The same call converts PDF to [Word](https://switchfile.io/pdf-to-docx) and [PowerPoint](https://switchfile.io/pdf-to-pptx).

```bash
# Key from https://switchfile.io/dashboard/keys. Prints 200: report.xlsx is the workbook.
# Prints 202: still running, report.xlsx then holds the status reply; fetch links.self later.
curl -L "https://api.switchfile.io/v1/convert?wait=30" -w "%{http_code}\n" \
  -H "Authorization: Bearer $SWITCHFILE_API_KEY" \
  -H "Accept: application/octet-stream" \
  -F file=@report.pdf -F to=xlsx -o report.xlsx
```

```js
// npm i switchfile
import Switchfile from "switchfile";

const switchfile = new Switchfile({ apiKey: process.env.SWITCHFILE_API_KEY });
const conversion = await switchfile.convert("report.pdf", "xlsx");
await switchfile.download(conversion, "report.xlsx");
```

```python
# pip install switchfile-sdk
import os
import switchfile
switchfile.configure(api_key=os.environ["SWITCHFILE_API_KEY"])
conversion = switchfile.convert("report.pdf", "xlsx")
switchfile.download(conversion, "report.xlsx")
```

The one-call API under /v1 is a preview and may still change before it is released. CloudConvert-compatible jobs under /v2 are described further down.

[Get a free API key](https://switchfile.io/signup) (20 files a day).

## Where your files go

- **Converted in the EU**: Conversions run on our server in the EU. Stored files and results are deleted after 24 hours. [Hosting in the privacy policy](https://switchfile.io/privacy#hosting)
- **Without storage: store=false**: The PDF and the workbook are processed in memory while the request runs and are not written to our file storage or database. The service that converts them cannot open connections to the internet. Files can be up to 50 MB. Your usage history keeps the time, formats, sizes and credits, never the file name. [Converting without storage](https://switchfile.io/docs/no-store)

Every request to the API passes through the network of Cloudflare, which ends the encrypted connection and forwards the request to our server in the EU. Stored files are kept in Cloudflare storage located in the EU.

```bash
curl "https://api.switchfile.io/v1/convert?store=false" \
  -H "Authorization: Bearer $SWITCHFILE_API_KEY" \
  -F file=@report.pdf -F to=xlsx -o report.xlsx
```

## Coming from CloudConvert

The API accepts CloudConvert v2 jobs. Change the base URL and the API key, and a convert task with output_format xlsx runs as before. Webhooks work the same way. [Migration guide](https://switchfile.io/developers/migrate-from-cloudconvert)

## Pricing

Free: 20 files/day, up to 50 pages, free API key
Credit pack: from €7, 500 credits, one-time, no subscription
Monthly: from €13, 2,000 credits a month, cancel at any time
PDF to Excel: 1 credit per started minute, at least 2. Up to 300 pages with credits.
[Pricing](https://switchfile.io/pricing)

## Questions

### Does it work with scanned PDFs?

Yes. Scanned pages are read with text recognition, and tables on them become cells like in any other PDF. The language is detected on its own; to set it, pass ocr_language, for example deu for German.

### What happens to a table that runs over several pages?

When a table continues on the next page with the same columns, it becomes one table in the workbook and the repeated header row is left out. Each table gets its own worksheet; set single_sheet to true to collect them on one.

### What are the limits?

Without credits a PDF can have up to 50 pages and 1 GB, and you get 20 files a day. With credits a PDF can have up to 300 pages. For a longer PDF, convert it in parts with the pages option, for example 1-50. Without storage, a file can be up to 50 MB.

### How long do you keep my files?

A stored conversion keeps the PDF and the workbook for 24 hours, then both are deleted. With store=false no file is stored: the workbook comes back in the response, and only an entry with time, formats, sizes and credits stays in your usage history for 400 days.

### Do I get an invoice with VAT?

Yes. Each purchase comes with a receipt by email that has a running number and shows our VAT ID as well as the VAT. Prices are in euros and include VAT where it applies. A business in another EU country with a valid VAT ID pays the price without VAT, and the receipt shows reverse charge.
