
Automate Factur-X and ZUGFeRD e-Invoices in Python with PDF.co
15 MIN READ
Using our XLS to JSON API, you can convert XLS to JSON while preserving the layout of your XLS file.
Here at PDF.co Web API platform, there’s no need to purchase any license to use our APIs. You only need to get either a subscription plan or top-up non-expiring credits.
PDF.co Web API platform has a lot of integrations available. Starting with Zapier, Make, BluePrism, UiPath, Automation Anywhere, and 300+ more.
We prepared this sample XLS file for this demo.
The code snippets below are in different programming languages. Using those code snippets, you can convert the sample XLS file above into a JSON file.
The result would look like this.
[
{
"Column0": "Customer Name",
"Column1": "Book Name",
"Column2": "Password",
"Column3": null
},
{
"Column0": "John Doe",
"Column1": "Book of Lfe",
"Column2": "password",
"Column3": null
}
]Before we proceed with the code, let us first check the /v1/xls/convert/to/json parameters and its uses.
https://api.pdf.co/v1/xls/convert/to/jsontrue to return data as inline or false to return link to the output file (default).true or false.job/check: true or false.Now we are ready to write some code.
curl --request POST 'https://api.pdf.co/v1/xls/convert/to/json' \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"url": "https://pdfco-test-files.s3.us-west-2.amazonaws.com/other/Input.xls",
"name": "result.json",
"inline": false,
"async": false
}'This sample code and other cURL source source code samples are available at our documentation.
Download the sample Excel file used in this example. You can also supply a direct download URL to your own XLS or XLSX file.
Replace YOUR_API_KEY with your PDF.co API key and run the request. The response contains a temporary url where you can download the generated JSON file.
Create an account, get an API key and test a request.