How to Convert Local Spreadsheet Table Data to a JSON File: Step‑by‑Step Guide

Convert a local spreadsheet/Excel table to a JSON file with the Aspose.Cells Cloud Web API.

Convert Table to JSON API

Web API

PUT https://api.aspose.cloud/v4.0/cells/convert/table/json

Version & Deprecation – Current API version: v4.0 (stable).

Prerequisites

  1. Create an Aspose Cloud account.
  2. Generate client_id and client_secret in the dashboard.
  3. Obtain an OAuth 2.0 access token and include it in the Authorization header of every request.

Sample cURL Request

curl -X PUT "https://api.aspose.cloud/v4.0/cells/convert/table/json?worksheet=Sheet1&tableName=MyTable" \
     -H "Authorization: Bearer {access_token}" \
     -F "Spreadsheet=@/path/to/your/file.xlsx" \
     -F "outPath=output/folder" \
     -F "outStorageName=MyStorage"

Request Parameters

Parameter Name Type Location Description
Spreadsheet File FormData The Excel file to be uploaded.
worksheet String Query Name of the worksheet that contains the table.
tableName String Query Name of the table to convert.
outPath String Query (Optional) The folder path where the resulting JSON file will be stored; defaults to null.
outStorageName String Query (Optional) Name of the storage where the output file will be placed.
fontsLocation String Query (Optional) Path to custom fonts used during conversion.
region String Query (Optional) Regional settings for the workbook.
password String Query (Optional) Password to open a protected workbook.

Request Body Example (multipart/form‑data)

POST /v4.0/cells/convert/table/json?worksheet=Sheet1&tableName=MyTable HTTP/1.1
Host: api.aspose.cloud
Authorization: Bearer {access_token}
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW

------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="Spreadsheet"; filename="Sample.xlsx"
Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet

<binary content of Sample.xlsx>
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="outPath"

output/json
------WebKitFormBoundary7MA4YWxkTrZu0gW--

Response

[
  {
    "Name": "ResponseFile",
    "DataType": {
      "Identifier": "File",
      "Reference": "Stream"
    }
  }
]

Error Codes

  • 400 Bad Request – Invalid URI or missing required parameters.
  • 401 Unauthorized – Invalid access token or incorrect client credentials.
  • 404 Not Found – The specified spreadsheet file cannot be accessed.
  • 500 Server Error – An internal error occurred while obtaining calculation data.

Handling Tips: Validate all required parameters before sending the request, refresh the OAuth token if a 401 is returned, and implement retry logic for 5xx responses.

Where Should You Use the Convert Table to JSON API?

  • Real‑time Dashboards – Convert live Excel data to JSON for charting libraries such as Chart.js or D3.js.
  • Spreadsheet‑as‑Service – Expose Excel tables as JSON endpoints for other micro‑services.
  • Webhook Payloads – Transform spreadsheet data into JSON for webhook notifications.
  • Rapid Data Prototyping – Quickly convert cleaned Excel data to JSON for Python or R analysis.
  • Machine‑Learning Pipelines – Pre‑process training data stored in business spreadsheets.
  • E‑commerce Operations – Sync product catalogs or pricing sheets to websites via JSON.
  • Reporting Automation – Generate JSON feeds from financial models for automated reporting.
  • App Configuration – Manage feature flags, settings, or A/B‑test parameters in Excel → JSON.
  • Multi‑language Support – Convert localization spreadsheets to JSON for i18n libraries.
  • Dynamic Menus/Navigation – Store website navigation structures in Excel and deploy them as JSON.

Why Should You Use the Convert Table to JSON API?

  • Developer‑Friendly – Aspose.Cells Cloud provides SDKs for many languages, reducing development effort and offering comprehensive documentation.
  • Cost‑Effective – Convert table data without first uploading the workbook, saving storage space and reducing costs.
  • Modern Web & Mobile Compatibility – JSON is the native data language of the web; the API lets you feed live spreadsheet data directly into React, Vue, Angular, mobile apps, or single‑page applications without complex parsing.
  • Broad Language Support – JSON works with virtually every programming language, database, and web service.
  • Structured Data Preservation
    • Intelligent Structure Detection – Automatically converts tabular data to proper JSON arrays/objects.
    • Header Mapping – Uses the first row as JSON keys for clean object structures.
    • Data Type Retention – Preserves numbers, dates, and booleans (not just text).

How to Use the Convert Table to JSON API with SDKs?

Convert Table to JSON API Specification

The Convert Table to JSON API Specification provides a publicly accessible programming interface, enabling REST interactions directly from a web browser.

Use Aspose.Cells Cloud SDKs

Using an SDK abstracts low‑level details, allowing you to convert a spreadsheet table to a JSON file with minimal code. See the official 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:

Frequently Asked Questions

Q: How do I convert a local Excel table to JSON using Aspose.Cells Cloud?
A: Send a PUT request to https://api.aspose.cloud/v4.0/cells/convert/table/json with the workbook in FormData and specify worksheet and tableName as query parameters. The API returns the JSON file as a stream.

Q: What are the required parameters for this API?
A: Required: Spreadsheet (multipart/form‑data file), worksheet (string), tableName (string). Optional: outPath, outStorageName, fontsLocation, region, password.

Q: Which error codes might I encounter and how should I handle them?
A:

  • 400 – Bad request; verify the URI and required parameters.
  • 401 – Unauthorized; refresh the access token.
  • 404 – File not found; ensure the file path is correct.
  • 500 – Server error; retry after a short delay or contact support.

Note: The Cloud SDK Family section (code tabs) has been left unchanged as requested.