# Turn a spreadsheet or PDF into JSON

> Convert a CSV or XLSX file into rows of JSON, or a text PDF into its text page by page, from an upload or a public link.

Status: working operation.

## What it is for

Price lists, inventories, schedules and filings arrive as spreadsheets and PDFs that an agent or a script cannot use until they are rows or text. This converts one file into JSON, keeping sheet names, header rows and page numbers, so the figures can be read and checked against the file.

Buyers comparing supplier price lists, operations staff loading schedules, and agents that receive a file and need its contents as data.

## What happens to a request

You send the file (up to 5 MB) or a public link to it. CSV and XLSX become one JSON object per row under each sheet's header row; a PDF with a text layer becomes its text per page. Scanned PDFs without text are reported as such rather than guessed at. The file is processed in memory and not stored.

## What you get

A JSON answer: for spreadsheets, each sheet's name, header and rows; for PDFs, the page count and each page's text; with the detected type and any rows or pages cut by the limits.

## Scope and limits

Any file you hold the right to process.

- 5 MB per file; up to 20,000 rows returned per sheet.
- PDF tables are returned as page text, not as cell grids.
- No OCR: a scanned PDF returns no text and says so.

## Operation: POST /document-conversion/op/convert

CSV or XLSX to JSON rows per sheet; text PDF to text per page.

Price: free within a daily budget.

- `url` (string): Public link to the file, instead of a raw upload
- `sheet` (string): Only this sheet

```json
{
  "type": "xlsx",
  "sheets": [
    {
      "name": "Prices",
      "header": [
        "sku",
        "description",
        "unit_price"
      ],
      "rows": [
        {
          "sku": "A-100",
          "description": "Hex bolt M8",
          "unit_price": 0.12
        }
      ],
      "row_count": 1,
      "truncated": false
    }
  ]
}
```

## Make a request

POST the file to /document-conversion/op/convert (raw body with its content type), or POST {"url": "https://..."} (free, within a daily budget). Or describe a conversion this does not cover.

POST https://services.forevenza.com/document-conversion/requests with JSON like:

```json
{
  "action": "convert",
  "need": "Turn our distributor's XLSX price list into JSON rows so we can compare unit prices.",
  "specifications": {
    "file_type": "xlsx",
    "target_fields": [
      "sku",
      "description",
      "unit_price"
    ]
  }
}
```

Schema: https://services.forevenza.com/document-conversion/schema.json
