# CSV to Excel Converter - CSV and TSV to XLSX with Download Link (`kotaro-project/csv-to-excel-converter`) Actor

Convert up to 20 public CSV or TSV files into Excel .xlsx files. Choose the delimiter and text encoding or let it detect them, including Shift_JIS. Get a download link for each file. Numbers stay numbers, IDs with leading zeros stay text. Pay per file converted.

- **URL**: https://apify.com/kotaro-project/csv-to-excel-converter.md
- **Developed by:** [KOTARO project](https://apify.com/kotaro-project) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 file converteds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## CSV to Excel Converter

Turn public CSV or TSV files into Excel `.xlsx` files and get a download link for each one.

### What you get

For every file:

- **downloadUrl**: the link to the `.xlsx` file
- **rows** and **columns** written
- **delimiter** and **encoding** that were used
- **notes** if something had to be cut to fit Excel's limits

### Input

| Field | What it is |
|---|---|
| `fileUrls` | Public addresses of CSV or TSV files, up to 20, each up to 50 MB |
| `delimiter` | Auto, comma, tab, semicolon or pipe. Auto looks at the file name and the first lines. |
| `encoding` | Auto, UTF-8, Shift_JIS, Latin-1 or UTF-16. Auto tries them in that order. Shift_JIS files from Japanese software open without broken characters. |
| `sheetName` | Name of the sheet, up to 31 characters |
| `boldHeader` | Bold first row, fixed at the top |
| `convertNumbers` | Write 12 or 3.5 as numbers. Values with leading zeros, such as zip codes or IDs like `0123`, always stay text. |

The sample input converts a public list of country names and codes, so you can see a result in a few seconds.

### Price

You pay once per file converted (`file-converted`). Files that cannot be downloaded, read or have no rows are **not charged**. An empty input ends at once with a free note.

### Good to know

- Excel holds up to 1,048,576 rows and 16,384 columns per sheet, and 32,767 characters per cell. Anything beyond that is cut and reported in `notes`.
- Text is never turned into formulas or links, so a value such as `=SUM(A1)` stays text.
- Only the files you name are downloaded. Internal and private addresses are refused.
- The files are kept in the run's key-value store, under the storage retention of your Apify plan.

# Actor input Schema

## `fileUrls` (type: `array`):

Public addresses of CSV or TSV files, up to 20, each up to 50 MB. Each file becomes one .xlsx file. Internal addresses are refused.

## `delimiter` (type: `string`):

The character between values. Auto looks at the file name and the first lines.

## `encoding` (type: `string`):

The text encoding of the files. Auto tries UTF-8, UTF-16 with a byte order mark, Shift_JIS and then Latin-1.

## `sheetName` (type: `string`):

Name of the sheet in each Excel file, up to 31 characters.

## `boldHeader` (type: `boolean`):

Show the first row in bold and keep it fixed at the top when scrolling.

## `convertNumbers` (type: `boolean`):

Write values such as 12 or 3.5 as numbers so they can be added up in Excel. Values with leading zeros, such as 0123, always stay text.

## Actor input object example

```json
{
  "fileUrls": [
    "https://raw.githubusercontent.com/datasets/country-list/main/data.csv"
  ],
  "delimiter": "auto",
  "encoding": "auto",
  "sheetName": "Sheet1",
  "boldHeader": true,
  "convertNumbers": true
}
```

# Actor output Schema

## `results` (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 = {
    "fileUrls": [
        "https://raw.githubusercontent.com/datasets/country-list/main/data.csv"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("kotaro-project/csv-to-excel-converter").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 = { "fileUrls": ["https://raw.githubusercontent.com/datasets/country-list/main/data.csv"] }

# Run the Actor and wait for it to finish
run = client.actor("kotaro-project/csv-to-excel-converter").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 '{
  "fileUrls": [
    "https://raw.githubusercontent.com/datasets/country-list/main/data.csv"
  ]
}' |
apify call kotaro-project/csv-to-excel-converter --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,kotaro-project/csv-to-excel-converter"
        }
    }
}
```

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/fb8MVEhCfZXxVmCDM/builds/YXVafxoYMFLvHVQRQ/openapi.json
