Convert HTML to Word with these HTML to DOCX APIs Free

0 Comments
Editor Ratings:
User Ratings:
[Total: 0 Average: 0]




In this post I have listed a couple of free APIs for HTML to DOCX conversion. Here you can use these APIs very easily right from the command prompt or your applications. All you have to do is just make a request to a predefined endpoint and then simply get the final Word file that you can open in MS Word or any Word alternative. In the free plan, you will get limited number of API calls but that is enough for personal or individual use. Also, not only HTML to Word, but with these websites, you can carry out other conversions as well such as HTML to PDF.

HTML is a web page and a document format that can only be viewed in a browser. And DOCX is a MS Word file that support almost all the HTML elements. And if you want to convert any HTML document or Word document then you will need some tools for that. There are some HTML to Word converter software are there but if you want to add this functionality in your applications then you will need some APIs and this post mentions 2 of them which are free.

APIs are useful in cases you don’t want to code something for a task from scratch. If you go and write the logic of HTML to DOCX conversion by yourself then it will take a lot of time as a lot of coding will be required. In those cases, it is wise to rely on APIs. The websites I have added here for HTML for DOCS conversion provide you some handy docs for different programming languages such as Python, Node.js, ASP.net, Ruby, and others. You can go through those docs and then implement the API in your web or desktop applications accordingly.

HTML to DOCX APIs

2 HTML to DOCX APIs Free

Convertio

Convertio is a popular online file converter which you can use. Here it supports a long list of file formats to convert  one format to another. And luckily it supports precise HTML to DOCX conversion too and provides its API as well. The Convertio API can be used via any major programming language. Or, you can simply make the API calls using command line HTTP clients like cURL or Httpie.

The Convertio API in the free plan gives you 25 conversion minutes each day. Rather than providing number of calls, it calculates time taken in converting a file from one format to another. You just have to make a simple call and then you get the response. With this API, you can either convert a local HTML file to Word document or you can use it to convert an HTML to DOCX which hosted somewhere online.

In order to use this API using cURL, you will need to obtain an API key. To get an API key, you will have to sign up using your Google or Facebook account. After that, you just run the cURL command as follows.

curl -i -X POST -d "{"apikey": "APIKey", "file":"FileURL", "outputformat":"docx"}" http://api.convertio.co/convert

Convertio Curl Request

If you get 200 code in the response then it means, your file has been uploaded and the conversion has started. In the response, it will give you a data id that you will have to use in order to get the file. To get the final DOCS file, you simply make the cURL request like this and copy the URL to the DOCX file and then download it.

curl -i -X GET http://api.convertio.co/convert/_ID_/status

Convertio API Response

In this way, you can use Convertio API to convert any given HTML file to DOCX. You just need to make two simple request to the specified endpoint and get the results. In each response, it shows you the quota remaining in your account. Overall, I liked the API and then result it produced was as I expected.

AConvert

AConvert Sample Code for HTML to Word with REST API

AConvert is another free API that you can use for quick HTML to DOCX conversion. Here it gives you a REST API which is free and there is no need or an API key or authentication. But in the free API conversion where you don’t need an API key, you can only process a file less than 1 MB. You can use it for all the other conversions that this website supports. This API can be used via web after you go through its documentation page. And if you need API without any restrictions then you will have to buy some credits from its main website.

There is a sample HTML file is given on the main website which you can use. You can simply copy all the code and then you can simply run it in browser. A form will show up and all the components there are self-explanatory. Just upload the HTML file there which you want to convert to DOCX. There is an API key field as well but for free conversion you don’t have to put anything in that.

AConvert Sample Code

Just hit the “Convert” button after submitting the HTML file and wait for it to convert the file for you. When it is done, it will reveal the URL to the converted DOCX file. You can simply follow that link and then download the converted DOCX file PC.

Next, you can go through the details API documentation and then see the different parameters in the API. It has two servers running which are responsible for the conversion in the cloud. One is Linux server and other is Windows server. And the UI of the sample code that it gives for the conversion via API can be seen in the screenshot I have added above. Not only HTML to Word but you can use it in the same way for other conversions as well.

Closing thoughts

These are the only free APIs that I was able to find and test locally on my PC. Both these APIs produce very good results. You can use anyone from these anywhere you like. You can use these in your desktop and mobile applications and there is support available for that. If just want to convert small HTML files then I will suggest you to go with AConvert API. Otherwise, you can sign up for Convertio API and start using it for any file conversion, including HTML to DOCX.

Editor Ratings:
User Ratings:
[Total: 0 Average: 0]

Leave A Reply

 

Get 100 GB FREE

Provide details to get this offer