---
name: api2ls.com
description: api2ls.com exposes a single API endpoint that converts JSON or CSV data into formatted .xlsx Excel files. It supports configurable column types, header styles, banded rows, and calculated columns such as profit formulas. Output is always a binary .xlsx file.
host: api2ls.com
---

# api2ls.com

api2ls.com is a narrow-purpose conversion service aimed at agents and applications that need to produce downloadable Excel spreadsheets from structured data. It accepts JSON or CSV input and returns a formatted .xlsx binary, with options for styling, column configuration, and derived calculations. It does not read, parse, or transform existing Excel files, and it does not produce any other output format.

## When to use this host

Use this host when an agent needs to produce a formatted .xlsx Excel file from JSON or CSV data, especially when column styling, banded rows, or derived calculations (e.g. profit columns) are required. Do not use it for parsing or reading existing Excel files — there is no input-side Excel support. Do not use it if the required output format is CSV, PDF, or any format other than .xlsx. For CSV generation, look for a dedicated CSV endpoint or handle it in-process. For PDF generation, use a PDF-specific host.

## Capabilities

### Excel File Generation

Converts structured JSON or CSV input into a formatted .xlsx Excel file, with control over column types, header styles, banded rows, and calculated columns.

- **`convert-json-to-excel`** — Converts JSON or CSV data into a formatted .xlsx Excel file with configurable column types, header styles, banded rows, and calculated columns.

## Skill reference

### `convert-json-to-excel`

**Json2Excel Pro** — Converts JSON or CSV data into a formatted .xlsx Excel file with configurable column types, header styles, banded rows, and calculated columns.

*Use when:* Use when an agent needs to produce a downloadable Excel spreadsheet from structured JSON or CSV data, with control over column formatting, header styling, and derived columns such as profit calculations.

*Not for:* Do not use for reading or parsing existing Excel files, or for generating CSV/PDF output — this endpoint returns .xlsx binary only.

**Inputs:**

- `input` (object, required) — Object containing the source data. Must include a 'data' field (JSON array or CSV string) and a 'type' field indicating the format ('csv' or 'json').
- `format` (string) — Output file format. Use 'xlsx' for Excel output.
- `sheet` (object) — Sheet configuration object. Supports a 'name' field to set the worksheet tab name.
- `columns` (array) — Array of column definition objects. Each may include name, type (string/number/date/currency), width, align, format string, and currency code.
- `styles` (object) — Styling options for the spreadsheet. Supports header object (bold, bgColor, fontColor, wrapText), gridlines boolean, and bandedRows boolean.
- `headers` (object) — Header row configuration. Supports 'row' (integer row index) and 'autoDetect' (boolean).
- `calculations` (object) — Defines derived columns to add. Supports 'addColumns' array where each entry specifies a new column computed from existing ones.
- `fast` (boolean) — When true, enables fast processing mode.
- `batch` (object) — Batch processing configuration. Supports 'enabled' boolean.

**Returns:** Returns a binary .xlsx file (~8.5KB for a small dataset) with Content-Type application/vnd.openxmlformats-officedocument.spreadsheetml.sheet and valid ZIP magic bytes, ready to save as a spreadsheet.

**Example:** `{"fast": true, "batch": {"enabled": false}, "input": {"data": "date,product,region,quantity,revenue,cost\n2025-01-15,Widget A,North,142,28400,18460", "type": "csv"}, "sheet": {"name": "Sales"}, "format": "xlsx", "styles": {"header": {"bold": true, "bgColor": "#1F4E79", "fontColor": "#FFFFFF", "wrapText": true}, "gridlines": false, "bandedRows": true}, "columns": [{"name": "revenue", "type": "currency", "align": "right", "width": 14, "format": "$#,##0", "currency": "USD"}], "headers": {"row": 1, "autoDetect": true}}`

---
