How to Convert a Spreadsheet Worksheet to CSV Using Aspose.Cells Cloud API
The ConvertWorksheetToCsv endpoint transforms a single worksheet from a local spreadsheet file into a CSV document entirely on the Aspose.Cells Cloud server. By uploading the source file and specifying the target worksheet, developers receive a binary CSV stream without needing to store the file in cloud storage. This API is ideal for automating data extraction, integrating spreadsheet data into downstream systems, and reducing storage overhead.
Convert Worksheet to CSV API
Web API
PUT https://api.aspose.cloud/v4.0/cells/convert/worksheet/csv
Security and Authentication
The Aspose.Cells Cloud APIs are secure and require JWT token-based authentication.
-H "Authorization: Bearer {access_token}"
cURL Sample
curl -X PUT "https://api.aspose.cloud/v4.0/cells/convert/worksheet/csv?worksheet=Sheet1" \
-H "Authorization: Bearer {access_token}" \
-F "Spreadsheet=@myWorkbook.xlsx"
Request Parameters
| Parameter Name | Type | Location | Required/Optional | Description |
|---|---|---|---|---|
| Spreadsheet | File | FormData | Required | Binary file of the source spreadsheet (e.g., .xlsx, .xls). Example: myWorkbook.xlsx. |
| worksheet | String | Query | Required | Name of the worksheet to be converted (case‑sensitive). If omitted, the first worksheet is used. Example: Sheet1. |
| outPath | String | Query | Optional | Target folder path in cloud storage where the generated CSV will be saved. If omitted, the CSV is returned directly in the response stream. |
| outStorageName | String | Query | Optional | Name of the storage service (e.g., Azure, AWS S3) where the output file should be placed. Required only when outPath is used. |
| fontsLocation | String | Query | Optional | Path to a custom fonts folder on the server, allowing the conversion engine to use non‑standard fonts. |
| region | String | Query | Optional | Locale identifier that influences number/date formatting in the CSV (e.g., en-US, fr-FR). |
| password | String | Query | Optional | Password for opening a protected spreadsheet. Must match the encryption password of the source file. |
Response
[
{
"Name": "ResponseFile",
"DataType": {
"Identifier": "File",
"Reference": "Stream"
}
}
]
Error Codes
- 400 Bad Request – Invalid Aspose.Cells Cloud API URI.
- 401 Unauthorized – Invalid access token, client ID, or client secret.
- 404 Not Found – The spreadsheet file is not accessible.
- 500 Server Error – The spreadsheet caused an internal processing error.
When to Use the Convert Worksheet to CSV API?
- Data Extraction for BI pipelines – Pull a specific worksheet from an Excel report and feed the resulting CSV directly into Power BI or Tableau without intermediate file handling.
- Automated Invoice Processing – Convert the worksheet containing invoice rows to CSV for fast import into accounting systems.
- Legacy System Integration – Export worksheet data to CSV for consumption by older applications that only accept delimited text files.
- On‑the‑fly Reporting – Generate CSV snapshots of live spreadsheet data in a web service, returning the file instantly to the client browser.
Why Use the Convert Worksheet to CSV API?
- No permanent cloud storage required – The file is streamed directly to the conversion engine and discarded after conversion, saving bandwidth and storage costs.
- High‑Performance Cloud Execution – Conversion runs on Aspose’s optimized servers, typically completing within 2 seconds for files up to 100 MB.
- Fine‑grained Control – Select a single worksheet, apply custom fonts, regional formatting, and password protection in one request.
- Consistent Cross‑Platform Output – Guarantees identical CSV output across .NET, Java, Python, and other SDKs using the same REST endpoint.
How to Use the Convert Worksheet to CSV API with SDKs
Convert Worksheet to CSV API Specification
Convert Worksheet to CSV API Specification provides a publicly accessible programming interface for executing REST interactions directly from a web browser.
Excel API SDK
Use Aspose.Cells Cloud SDKs
Using the SDK simplifies development by abstracting low‑level details, allowing you to merge a spreadsheet into another spreadsheet with concise code. Please check out the GitHub repository for a complete list of Aspose.Cells Cloud SDKs.
The following code examples demonstrate how to interact with Aspose.Cells web services using various SDKs: