Service www.konwerter.net has an API interface that can help automate converting tasks.
The API is based on the forms, it works in the same way as forms of HTML language, but responses are JSON formatted.
In order to use the api an individual apikey is required. It must be included in every
request as a header.
At the moment, the key issue has not been determined - api will not be available to the public.
Server address:
https://api.konwerter.net
Accepted methods:
POST - conversion request GET - check the status of the conversion, download files DELETE - files removal
In order to start a conversion, POST request should be sent to the address of the desired function. In the example, we convert a "data.pdf" document to "txt" format.
curl -X POST -F file=@data.pdf -F outputformat=txt -H "APIKEY:secret_key" https://api.konwerter.net/documents/
Valid query generates a response with the location to the process.
{"code": 200, "location": "https://api.konwerter.net/file/5274"}To check the status of conversion a GET request should be sent to the resulting address from the "location" field.
curl -X GET -H "APIKEY:secret_key" https://api.konwerter.net/file/5274
Response contains more information about conversion process.
{"id": "5274",
"status": "ready",
"filename": "data.pdf",
"outputformat": "txt",
"download": "https://api.konwerter.net/download/5274"}
If the "status" is equal to "ready", "download" field contains link to the location where file can be downloaded. Other possible values for the field "status":
processing - conversion in progress ready - conversion completed successfully, the location of the file defines the "download" field failed - conversion error, the document may be corrupted or unsupported timeout - maximum execution time exceeded
To check the status of all processes, send a GET request:
curl -X GET -H "APIKEY:secret_key" https://api.konwerter.net/file/
In order to download the resulting file a GET request must be sent to the address from the "download" field.
curl -X GET -H "APIKEY:secret_key" https://api.konwerter.net/download/5274 > result.txt
In order to remove a file from conversion table send DELETE request(field "location" of the conversion status)
curl -X DELETE -H "APIKEY:secret_key" https://api.konwerter.net/file/5274
{"message": "Object deleted", "code": 200}
In order to remove all files send DELETE request to the "/delete_all/" location.
curl -X DELETE -H "APIKEY:secret_key" https://api.konwerter.net/delete_all/
{"message": "Object deleted", "code": 200}Wrong requests or incorrect parameters generate the following error messages.
Too many queries in a short period of time
{'message': 'to many requests, try later', 'code': 403}
Too many files in the conversion table
{"message": "Max. X in the queue. Remove files to continue", "code": 403}
Uploaded file is too big
{"message": "File too big", "code": 413}
Incorrect query or wrong parameters
{'message': 'invalid data', 'error': 'more info about the error', 'code': 400}API provides all the features that are available on the https://www.konwerter.net site. Following is a description of each function and example using CURL tool.
Convert a web page into the selected file format
Location: /webpagetopdf/
Fields:
url: address of a web page, required
outputformat: ['pdf', 'jpg', 'png', 'svg'], output format, required
noimg: ['True', 'False'], disable images, optional
nojs: ['True', 'False'], disable JavaScript, optional
Request:
curl -F url=www.konwerter.net -F outputformat=png -H "APIKEY:secret_key" https://api.konwerter.net/webpagetopdf/
Response:
{"code": 200, "location": "https://api.konwerter.net/file/67299"}
Check status:
curl -X GET -H "APIKEY:secret_key" https://api.konwerter.net/file/67299Response:
{"id": "67299", "status": "ready", "filename": "www.konwerter.net.png", "outputformat": "png", "download": "https://api.konwerter.net/download/67299"}
Download converted file:
curl -X GET -H "APIKEY:secret_key" https://api.konwerter.net/download/67299 > www.konwerter.net.png
Audio/video conversion into selected formats
Location: /audio/
Fields:
file: input file, type: audio/video, required
outputformat: ['mp3', 'ogg', 'aiff', 'flac', 'wav', 'wma'], output format, required
bitrate: ['default', '32k', '48k', '64k', '96k', '112k', '128k', '160k', '192k', '224k', '256k', '320k'], optional
frequency: ['default', '11025', '22050', '24000', '32000', '44100', '48000'], optional
hz432: ['True', 'False'], convert to 432Hz, optional
pitch [-1500 - 1500], custom tone, optional
Request:
curl -F file=@audio.mp3 -F outputformat=ogg -H "APIKEY:secret_key" https://api.konwerter.net/audio/
Conversion of documents into various ebook formats
Location: /ebooks/
Fields:
file: ['htm','azw','azw3','cbz', 'cbr', 'cbc', 'chm', 'djvu', 'epub', 'fb2', 'html',
'htmlz', 'lit', 'lrf', 'mobi', 'odt', 'pdf', 'prc', 'pdb', 'pml', 'rb', 'rtf',
'snb', 'tcr', 'txt', 'txtz','doc','docx' ], input file, required
outputformat: ['pdf', 'azw3', 'epub', 'mobi', 'lit', 'lrf', 'fb2', 'pdb', 'rb', 'htmlz',
'rtf', 'snb', 'tcr', 'txtz'], output file, required
targetreader: ['default', 'bambook', 'cybookg3', 'cybook_opus', 'galaxy', 'generic_eink',
'generic_eink_large', 'hanlinv3', 'hanlinv5', 'illiad', 'ipad', 'ipad3',
'irexdr1000', 'irexdr800', 'jetbook5', 'kindle', 'kindle_dx', 'kindle_fire',
'kindle_pw', 'kindle_voyage', 'kobo', 'mobipocket', 'msreader', 'nook', 'nook_color',
'nook_hd_plus', 'pocketbook_900', 'pocketbook_pro_912', 'sony', 'sony300',
'sony900', 'sony-landscape', 'tablet'], reader type, optional
author: change the author, optional
title: change the title, optional
c2txt: ['True', 'False'], convert pdf to txt before the proper conversion process, optional
rmlines: ['True', 'False'], remove empty lines between rows, optional
Request
curl -F file=@ebook.pdf -F outputformat=mobi -F c2txt=True -H "APIKEY:secret_key" https://api.konwerter.net/ebooks/
Document conversion between various formats
Location: /documents/
Fields:
file: input file, required
outputformat: ['pdf','doc', 'docx', 'odp', 'odt', 'odg', 'ppt', 'pptx', 'txt', 'rtf', 'xls', 'xlsx', 'csv','html'], output format, required
Request:
curl -F file=@Pdf_File.pdf -F outputformat=txt -H "APIKEY:secret_key" https://api.konwerter.net/documents/
Compare two text files and find the difference
Location: /comparetxtfiles/
Fields:
'file1': input file, type: text file, required
'file2': input file, type: text file, required
'difftype': type of comparison, required
'diff', difference
'common', common lines
'noncommon', all except common lines
'rmspace': ['True', 'False'], ignore spaces at the beginning/end of the line, optional
'insensitive': ['True', 'False'], case insensitive, optional
Request:
curl -F file1=@1.txt -F file2=@2.txt -F difftype=diff -H "APIKEY:secret_key" https://api.konwerter.net/comparetxtfiles/
Convert image and PDF files to selected format
Location: /images/
Fields:
file: input file, type: image or pdf, required
outputformat: ['bmp', 'jpg', 'gif', 'tiff', 'png', 'ico'], output format, required
width: 1-4096px, width, optional, requires "height" field
height: 1-4096px, height, optional, requires "width" field
sepia: ['True', 'False'], add sepia effect, optional
rotation: 1-360°, rotate the image, optional
quality: 1-100, quality of the image, optional
Request:
curl -F file=@pic.jpg -F outputformat=bmp -H "APIKEY:secret_key" https://api.konwerter.net/images/
Function creates mosaic from many images
Location: /genmosaic/
Fields:
file1: input file, type: image, main image, required
file2: input file, type: image, additional images, min. 21, max: 250 files, required
Requests:
curl -F file1=@1.jpg -F file2=@2.png -F file2=@2.png -F file2=@3.png -F file2=@4.png -F file2=@5.png -F file2=@6.png -F file2=@7.png -F file2=@8.png -F file2=@9.png -F file2=@10.png -F file2=@11.png -F file2=@12.png -F file2=@13.png -F file2=@14.png -F file2=@15.png -F file2=@16.png -F file2=@17.png -F file2=@18.png -F file2=@19.png -F file2=@20.png -F file2=@21.png -F file2=@22.png -F file2=@23.png -F file2=@24.png -H "APIKEY:secret_key" https://api.konwerter.net/genmosaic/
Function optimizes and reduces the size of image without quality loss
Location: /optimizeimages/
Fields:
file: input file, type: image, required
jpgquality: 0-100, quality factor, for JPG images only, optional
Request:
curl -F file=@1.bmp -H "APIKEY:secret_key" https://api.konwerter.net/optimizeimages/
Function extract images from documents to selected format and creates zip archive
Location: /extractimages/
Fields:
file: input file, required
outputformat: ['jpg','bmp','gif','png'], output format, required
Request:
curl -F file=@1.doc -F outputformat=jpg -H "APIKEY:secret_key" https://api.konwerter.net/extractimages/
Function removes passwords and restrictions from secured PDF files
Location: /unlockpdf/
Fields:
file: input file, type: pdf, required
pwd: password to open a pdf file,
Request:
curl -F file=@locked.pdf -F pwd=secret_pass -H "APIKEY:secret_key" https://api.konwerter.net/unlockpdf/
Function combines several separate PDF files(or pages) into single document
Location: /mergepdf/
Fields:
file: input file, type: pdf, min. 2, max. 250 files, required
rotation: ['default','90','180','270'], rotation angle, optional
paperformat: ['a0', 'a1', 'a2', 'a3', 'a4', 'a5', 'a6', 'a7', 'a8', 'a9', 'a10',
'b0', 'b1', 'b2', 'b3', 'b4', 'b5', 'c0', 'c1', 'c2', 'c3', 'c4', 'c5',
'c6', 'jisb0', 'jisb1', 'jisb2', 'jisb3', 'jisb4', 'jisb5', 'jisb6', '11x17',
'tabloid', 'ledger', 'legal', 'letter', 'archa', 'archb', 'archc', 'archd',
'arche'], paper format, optional
pagenumbers: 1-2000, add page numbers from selected page, optional
Request:
curl -F file=@1.pdf -F file=@2.pdf -F file=@3.pdf -F angle=90 -F paperformat=a4 -F pagenumbers=2 -H "APIKEY:secret_key" https://api.konwerter.net/mergepdf/
Function combines various file types into a single pdf document
Location: /docsmerge/
Fields:
file: input file, type: any convertible into pdf, max. 20 files, required
Request:
curl -F file=@1.doc -F file=@2.odt -F file=@3.pdf -F file=@4.docx -H "APIKEY:secret_key" https://api.konwerter.net/docsmerge/
Function splits pdf into separate pages and creates zip archive
Location: /splitpdf/
Fields:
file: input file, type: pdf, required
Request:
curl -F file=@splitme.pdf -H "APIKEY:secret_key" https://api.konwerter.net/splitpdf/
Obracanie pliku PDF o wybrany kąt
Location: /rotatepdf/
Fields:
file: input file, type: pdf, required
angle: ['90','180','270'], rotation angle, required
Request:
curl -F file=@1.pdf -F angle=90 -H "APIKEY:secret_key" https://api.konwerter.net/rotatepdf/
Function changes paper format and size with quality factor
Location: /resizepdf/
Fields:
file: input file, type: pdf, required
size: ['a0', 'a1', 'a2', 'a3', 'a4', 'a5', 'a6', 'a7', 'a8', 'a9', 'a10',
'b0', 'b1', 'b2', 'b3', 'b4', 'b5', 'c0', 'c1', 'c2', 'c3', 'c4', 'c5',
'c6', 'jisb0', 'jisb1', 'jisb2', 'jisb3', 'jisb4', 'jisb5', 'jisb6', '11x17',
'tabloid', 'ledger', 'legal', 'letter', 'archa', 'archb', 'archc', 'archd', 'arche'],
paper format, required
horizontal: ['True', 'False'], horizontal orientation, optional
quality: ['default', 'low', 'medium', 'high_printer', 'high_prepress'], quality - can reduce the size, optional
Request:
curl -F file=@1.pdf -F size=a4 -F quality=low -H "APIKEY:secret_key" https://api.konwerter.net/resizepdf/
Function reverses the page order of a pdf document
Location: /reversepdf/
Fields:
file: input file, type: pdf, required
Request:
curl -F file=@1.pdf -H "APIKEY:secret_key" https://api.konwerter.net/reversepdf/
Function removes a single page, range of pages, individual pages, all except selected, odd or even pages from pdf file
Location: /removepdfpages/
Fields:
file: input file, type: pdf, required
pages: ['first','last','first_last'], remove first, last or first and last, optional
frompage: 1-2048, remove page range: from (requires: 'topage'), optional
topage: 1-2048, remove page range: from (requires: 'frompage'), optional
pagelist: comma separated list of pages to be removed, optional
exceptlist: remove all except comma separated list of pages, optional
parity: ['even','odd'], remove even or odd pages, optional
Remove all except "1,2,3,4,5":
curl -F file=@1.pdf -F exceptlist="1,2,3,4,5" -H "APIKEY:secret_key" https://api.konwerter.net/removepdfpages/
curl -F file=@1.pdf -F pagelist=44 -H "APIKEY:secret_key" https://api.konwerter.net/removepdfpages/or:
curl -F file=@1.pdf -F frompage=44 -F topage=44 -H "APIKEY:secret_key" https://api.konwerter.net/removepdfpages/
Function adds page numbers starting from selected page
Location: /numberingpdf/
Fields:
file: input file, type: pdf, required
startpage: 1-2000: begin numbering from selected page, optional
Request:
curl -F file=@1.pdf -F startpage=5 -H "APIKEY:secret_key" https://api.konwerter.net/numberingpdf/
Function encrypts PDF document with password and assigns permissions for printing, modification, text and graphic extraction
Location: /encryptpdf/
Fields:
file: input file, type: pdf, required
enctype: ['128aes','256aes','128rc4'], encryption type
userpwd: user password, will be required to open the file, optional
ownerpwd: owner password, optional
accessibility: ['True', 'False'], allow accessibility for visually impaired, optional
contentextract: ['True', 'False'], Allow copying text and graphics, optional
printing: 'full': allow full printing,
'low' : only low-resolution printing,
'none': disallow printing,
optional
modification: 'all': allow full document modification,
'annotate': allow comment authoring and form operations,
'form': allow form field fill-in and signing,
'assembly': allow document assembly only,
'none': allow no modifications,
optional,
Request:
curl -F file=@1.pdf -F userpwd=13245 -H "APIKEY:secret_key" https://api.konwerter.net/encryptpdf/
Function arranges multiple PDF pages on a single sheet
Location: /multipdfpagespersheet/
Fields:
file: input file, type: pdf, required
paperformat: [ 'a3','a4','a5','b4','b5' ], paper format, optional
rows: 1-16, rows per page, required
cols: 1-16, cols per page, required
orientation: ['horizontal','vertical'], horizontal or vertical orientation, optional
border: ['True', 'False'], border on every page, optional
Request:
curl -F file=@1.pdf -F rows=2 -F cols=2 -H "APIKEY:secret_key" https://api.konwerter.net/multipdfpagespersheet/
Function extracts images from pdf, saves in selected format and adds to zip archive.
Location: /pdfimages/
Fields:
file: input file, type: pdf, required
outputformat: ['jpg','bmp','gif','png'], output format, required
Request:
curl -F file=@1.pdf -F outputformat=jpg -H "APIKEY:secret_key" https://api.konwerter.net/pdfimages/