excel to json

Excel to JSON online with C# .NET.

Excel spreadsheets have long been a staple for organizing and analyzing information, offering a familiar and versatile platform for users across industries. However, as the demand for data-driven applications and web services continues to grow, there arises a need to convert Excel data into JSON format. JSON (JavaScript Object Notation) has emerged as a preferred data interchange format. Therefore, by converting Excel to JSON with .NET REST API, you gain the flexibility to seamlessly integrate your spreadsheet data into a wide range of web-based platforms, mobile applications, and cloud services.

Excel to JSON Conversion SDK

Converting Excel to JSON format is made simple and efficient with GroupDocs.Conversion Cloud SDK for .NET. This SDK offers a comprehensive set of features for document conversion, including support for various file formats, advanced customization options, and high-quality output. Whether you’re building web applications, mobile apps, or desktop software, the SDK empowers you to streamline document conversion workflows and deliver exceptional user experiences.

Firstly, we need to install the SDK by searching GroupDocs.Conversion-Cloud in NuGet package manager and click the Install button. Another option is to execute the following command in package manager console.

NuGet\Install-Package GroupDocs.Conversion-Cloud -Version 24.2.0

After the installation, please make sure you have obtained your personalized API credentials(i.e. Client ID and Client Secret). You may visit this short tutorial explaining the details on how to get the API credentials.

XLS to JSON Converter using C# .NET

Learn the best practices and expert techniques for converting XLS and XLSX documents to JSON data using C# .NET.

  1. Create an instance of Configuration class where we pass client credentials as arguments.
var configurations = new Configuration(clientId, clientSecret1);
  1. Initialize the ConvertApi where we pass Configuration object as an input argument.
var apiInstance = new ConvertApi(configurations);
  1. Upload the input Excel workbook to the cloud storage.
fileUpload.UploadFile(new UploadFileRequest("input.xls", stream));
  1. Create an instance ConvertSettings where we specify the name for input XLS, resultant format as json and the name for resultant JSON file as arguments.
var settings = new ConvertSettings{...}
  1. Call the ConvertDocumentRequest API to turn Excel to JSON and save the resultant JSON to the cloud storage.
var response = apiInstance.ConvertDocument(new ConvertDocumentRequest(settings));

Convert XLSX to JSON using cURL commands

The conversion of Excel files to JSON format using GroupDocs.Conversion Cloud and cURL commands is a straightforward process that offers flexibility and ease of integration. With GroupDocs.Conversion Cloud’s RESTful API endpoints, you can initiate Excel to JSON conversion directly from the command line or within scripts, making it ideal for automated workflows and batch processing tasks.

The first step in this approach is to obtain a personalized JWT access token. So, once you have a JWT token, please execute the following cURL command to convert XLSX to JSON format and save the resultant JSON to the cloud storage.

curl -v "https://api.groupdocs.cloud/v2.0/conversion" \
-X POST \
-H "accept: application/json" \
-H "authorization: Bearer {accessToken}" \
-H "Content-Type: application/json" \
-d "{  \"StorageName\": \"internal\",  \"FilePath\": \"{sourceFile}\",  \"Format\": \"json\",  \"ConvertOptions\": {    \"FromPage\": 1,    \"PagesCount\": 1,    \"Pages\": [      1    ]  },  \"OutputPath\": \"{myOutput}\"}"

Please replace sourceFile with the name of input Excel workbook, myOutput with the name of resultant JSON and accessToken with personalized JWT access token.

Online Excel to JSON Converter

You may take a quick look over free online XLSX to JSON Converter. This App is developed on top of GroupDocs.Conversion Cloud REST APIs. Please try using this lightweight, super-efficient solution and witness the amazing capabilities of our Cloud SDK for Excel workbook to HTML conversion.

xlsx to JSON app

Conclusion

In conclusion, whether you choose to convert Excel to JSON using GroupDocs.Conversion Cloud SDK for .NET or through GroupDocs.Conversion Cloud and cURL commands, you’re equipped with powerful tools to streamline your document conversion workflows. In short, the API provides a reliable and high-quality conversion services, empowering you to transform Excel spreadsheets into JSON data with ease.

We highly recommend visiting the following links to learn more about: