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
API Endpoint
PUT https://api.aspose.cloud/v4.0/cells/convert/worksheet/csv
Request Parameters:
| Parameter Name | Type | Location | Required/Optional | Description |
|---|---|---|---|---|
| Spreadsheet | File | Required | FormData | Binary file of the source spreadsheet (e.g., .xlsx, .xls). Must be a readable file on the client side. Example: myWorkbook.xlsx. |
| worksheet | String | Required | Query | Name of the worksheet to be converted (case‑sensitive). If omitted, the first worksheet is used. Example: Sheet1. |
| outPath | String | Optional | Query | Target folder path in the cloud storage where the generated CSV will be saved. If not provided, the file is returned directly in the response stream. |
| outStorageName | String | Optional | Query | 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 | Optional | Query | Path to a custom fonts folder on the server, allowing the conversion engine to use non‑standard fonts. |
| region | String | Optional | Query | Locale identifier that influences number/date formatting in the CSV (e.g., en-US, fr-FR). |
| password | String | Optional | Query | Password for opening a protected spreadsheet. Must match the encryption password of the source file. |
Response
Successful response (200 OK) Content-Type: text/csv or application/octet-stream Headers:
- Content-Disposition: attachment; filename="
.csv" - Content-Length:
Body: binary stream containing the generated CSV file.
If outPath is supplied, the response body is empty and the CSV is stored at the specified cloud location; the response includes a JSON payload with the storage path.
Error responses follow standard HTTP status codes (400, 401, 404, 500) with a JSON error object:
{
"code": "ErrorCode",
"message": "Human readable error description"
}
Error Codes
- 400 Bad Request: Invalid Aspose.Cells Cloud API URI.
- 401 Unauthorized: Invalid access token. Or invalid client id and secret.
- 404 Not Found: The spreadsheet file not accessible.
- 500 Server Error: The spreadsheet has encountered an anomaly in obtaining calculation data.
Where should we 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 should you use the Convert Worksheet To Csv API?
- Zero‑Upload Architecture – Works with local files without first uploading them to cloud storage, saving bandwidth and storage costs.
- High Performance Cloud Execution – Conversion runs on Aspose’s optimized servers, delivering faster results than client‑side libraries.
- 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
The 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 is the fastest way to develop, as it abstracts away the low-level details, allowing you to merge a spreadsheet into another spreadsheet with short 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: