# Convert an Excel file to JSON or CSV

**Use case:** 

Read an Excel workbook (.xlsx) from a URL into rows, with numbers kept as numbers and dates as ISO text, then filter, rename and save a CSV. This example takes Vermont's counties from USDA's Rural-Urban Continuum Codes. Swap in your own Excel link.

## Input

```json
{
  "fileUrl": "https://www.ers.usda.gov/media/5767/2023-rural-urban-continuum-codes.xlsx",
  "filters": [
    "State == VT"
  ],
  "filterMode": "all",
  "dedupeBy": [
    "currency",
    "exchange_rate"
  ],
  "sortBy": [
    "exchange_rate"
  ],
  "fields": [
    "FIPS -> fips",
    "County_Name -> county",
    "Population_2020 -> population",
    "RUCC_2023 -> ruralUrbanCode",
    "Description -> description"
  ],
  "flatten": false,
  "exportFormat": "csv",
  "fileFormat": "auto"
}
```

## Output

```json
{
  "fips": {
    "label": "FIPS",
    "format": "text"
  },
  "county": {
    "label": "County",
    "format": "text"
  },
  "population": {
    "label": "Population (2020)",
    "format": "number"
  },
  "ruralUrbanCode": {
    "label": "Rural-urban code",
    "format": "number"
  },
  "description": {
    "label": "Description",
    "format": "text"
  }
}
```

## How it works

### 1. Sign up on Apify or log in

The Dataset Transformer: Filter, Dedupe, JSON to CSV Actor is ready to run with the inputs already set for "Convert an Excel file to JSON or CSV". [Sign up or log in](https://console.apify.com/create-task-from-example/NC94Kb9afnSTHcXB5) and you'll land in Apify Console with a copy of this exact task.

### 2. Start the "Convert an Excel file to JSON or CSV" task

The Dataset Transformer: Filter, Dedupe, JSON to CSV Actor will start running based on the input automatically. You can also change all the input fields, like or: file url or upload (csv, json, jsonl or excel), filters, and more, to match your specific use case.

### 3. Receive the "Convert an Excel file to JSON or CSV" output

Monitor the progress in real time. You will be notified as soon as your dataset is complete and ready for review. Each result includes data such as FIPS, county, population (2020), and more.

### 4. Integrate into your workflow

The final output is delivered in JSON, CSV, or Excel format, ready to be plugged into your workflow. You can also [run the "Convert an Excel file to JSON or CSV" task via API](https://apify.com/humble-echidna/dataset-transform.md).

## About this Actor

This example demonstrates how to use [Dataset Transformer: Filter, Dedupe, JSON to CSV](https://apify.com/humble-echidna/dataset-transform.md) with a specific input configuration. Visit the [Actor detail page](https://apify.com/humble-echidna/dataset-transform.md) to learn more, explore other use cases, and run it yourself.


## How to integrate an Actor?

This Task's input is already configured above. Use it as-is rather than inventing a new one.

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 full API examples (JavaScript, Python, CLI, MCP, OpenAPI), see this Task's Actor page: https://apify.com/humble-echidna/dataset-transform.md

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`).
