Legacy API (v1)

API dokumentacija

Da biste uputili uspješne zahtjeve za API, potreban vam je potvrđeni račun, kliknite ovdje da biste se prijavili ako već nemate račun.

Svoj API ključ možete generirati na Word.to nadzornoj ploči u odjeljku za programere.

DOCX u datoteke

DOCX u PDF

POST https://word.to/v1/api

Python :

import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.docx', 'rb')}
params = {
    'convert_to': 'pdf'
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.pdf', 'wb') as f:
    f.write(r.content)
# Pretvorite datoteku i nabavite ZIP
import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.docx', 'rb')}
params = {
    'convert_to': 'pdf',
    'zip': True
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.zip', 'wb') as f:
    f.write(r.content)

NodeJS :

const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'pdf'})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});
// Pretvorite datoteku i nabavite ZIP
const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'pdf', 'zip': true})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});

CURL :

curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.docx' \
-F 'data={"convert_to": "pdf"}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.pdf
// Pretvorite datoteku i nabavite ZIP
curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.docx' \
-F 'data={"convert_to": "pdf", "zip": true}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.zip

PHP :

<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"pdf\"}",
        "file_contents" => curl_file_create("testing.docx")
    );
    $fp = fopen("file.pdf", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
// Pretvorite datoteku i nabavite ZIP
<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"pdf\", \"zip\": true}",
        "file_contents" => curl_file_create("testing.docx")
    );
    $fp = fopen("file.zip", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
Parametar Opis
file Morate poslati Word datoteku koju želite pretvoriti.
data
  • convert_to: pdf
  • Da biste dobili ZIP datoteku, možete je proslijediti zip: true

DOCX u JPG

POST https://word.to/v1/api

Python :

import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.docx', 'rb')}
params = {
    'convert_to': 'jpg'
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.jpg', 'wb') as f:
    f.write(r.content)
# Pretvorite datoteku i nabavite ZIP
import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.docx', 'rb')}
params = {
    'convert_to': 'jpg',
    'zip': True
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.zip', 'wb') as f:
    f.write(r.content)

NodeJS :

const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'jpg'})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});
// Pretvorite datoteku i nabavite ZIP
const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'jpg', 'zip': true})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});

CURL :

curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.docx' \
-F 'data={"convert_to": "jpg"}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.jpg
// Pretvorite datoteku i nabavite ZIP
curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.docx' \
-F 'data={"convert_to": "jpg", "zip": true}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.zip

PHP :

<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"jpg\"}",
        "file_contents" => curl_file_create("testing.docx")
    );
    $fp = fopen("file.jpg", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
// Pretvorite datoteku i nabavite ZIP
<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"jpg\", \"zip\": true}",
        "file_contents" => curl_file_create("testing.docx")
    );
    $fp = fopen("file.zip", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
Parametar Opis
file Morate poslati Word datoteku koju želite pretvoriti.
data
  • convert_to: jpg
  • Da biste dobili ZIP datoteku, možete je proslijediti zip: true

DOCX u PNG

POST https://word.to/v1/api

Python :

import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.docx', 'rb')}
params = {
    'convert_to': 'png'
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.png', 'wb') as f:
    f.write(r.content)
# Pretvorite datoteku i nabavite ZIP
import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.docx', 'rb')}
params = {
    'convert_to': 'png',
    'zip': True
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.zip', 'wb') as f:
    f.write(r.content)

NodeJS :

const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'png'})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});
// Pretvorite datoteku i nabavite ZIP
const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'png', 'zip': true})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});

CURL :

curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.docx' \
-F 'data={"convert_to": "png"}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.png
// Pretvorite datoteku i nabavite ZIP
curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.docx' \
-F 'data={"convert_to": "png", "zip": true}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.zip

PHP :

<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"png\"}",
        "file_contents" => curl_file_create("testing.docx")
    );
    $fp = fopen("file.png", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
// Pretvorite datoteku i nabavite ZIP
<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"png\", \"zip\": true}",
        "file_contents" => curl_file_create("testing.docx")
    );
    $fp = fopen("file.zip", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
Parametar Opis
file Morate poslati Word datoteku koju želite pretvoriti.
data
  • convert_to: png
  • Da biste dobili ZIP datoteku, možete je proslijediti zip: true

DOCX u XLS

POST https://word.to/v1/api

Python :

import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.docx', 'rb')}
params = {
    'convert_to': 'xls'
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.xls', 'wb') as f:
    f.write(r.content)
# Pretvorite datoteku i nabavite ZIP
import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.docx', 'rb')}
params = {
    'convert_to': 'xls',
    'zip': True
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.zip', 'wb') as f:
    f.write(r.content)

NodeJS :

const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'xls'})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});
// Pretvorite datoteku i nabavite ZIP
const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'xls', 'zip': true})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});

CURL :

curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.docx' \
-F 'data={"convert_to": "xls"}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.xls
// Pretvorite datoteku i nabavite ZIP
curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.docx' \
-F 'data={"convert_to": "xls", "zip": true}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.zip

PHP :

<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"xls\"}",
        "file_contents" => curl_file_create("testing.docx")
    );
    $fp = fopen("file.xls", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
// Pretvorite datoteku i nabavite ZIP
<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"xls\", \"zip\": true}",
        "file_contents" => curl_file_create("testing.docx")
    );
    $fp = fopen("file.zip", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
Parametar Opis
file Morate poslati Word datoteku koju želite pretvoriti.
data
  • convert_to: xls
  • Da biste dobili ZIP datoteku, možete je proslijediti zip: true

DOCX do XLSX

POST https://word.to/v1/api

Python :

import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.docx', 'rb')}
params = {
    'convert_to': 'xlsx'
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.xlsx', 'wb') as f:
    f.write(r.content)
# Pretvorite datoteku i nabavite ZIP
import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.docx', 'rb')}
params = {
    'convert_to': 'xlsx',
    'zip': True
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.zip', 'wb') as f:
    f.write(r.content)

NodeJS :

const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'xlsx'})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});
// Pretvorite datoteku i nabavite ZIP
const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'xlsx', 'zip': true})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});

CURL :

curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.docx' \
-F 'data={"convert_to": "xlsx"}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.xlsx
// Pretvorite datoteku i nabavite ZIP
curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.docx' \
-F 'data={"convert_to": "xlsx", "zip": true}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.zip

PHP :

<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"xlsx\"}",
        "file_contents" => curl_file_create("testing.docx")
    );
    $fp = fopen("file.xlsx", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
// Pretvorite datoteku i nabavite ZIP
<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"xlsx\", \"zip\": true}",
        "file_contents" => curl_file_create("testing.docx")
    );
    $fp = fopen("file.zip", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
Parametar Opis
file Morate poslati Word datoteku koju želite pretvoriti.
data
  • convert_to: xlsx
  • Da biste dobili ZIP datoteku, možete je proslijediti zip: true

DOCX u ICO

POST https://word.to/v1/api

Python :

import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.docx', 'rb')}
params = {
    'convert_to': 'ico'
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.ico', 'wb') as f:
    f.write(r.content)
# Pretvorite datoteku i nabavite ZIP
import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.docx', 'rb')}
params = {
    'convert_to': 'ico',
    'zip': True
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.zip', 'wb') as f:
    f.write(r.content)

NodeJS :

const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'ico'})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});
// Pretvorite datoteku i nabavite ZIP
const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'ico', 'zip': true})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});

CURL :

curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.docx' \
-F 'data={"convert_to": "ico"}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.ico
// Pretvorite datoteku i nabavite ZIP
curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.docx' \
-F 'data={"convert_to": "ico", "zip": true}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.zip

PHP :

<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"ico\"}",
        "file_contents" => curl_file_create("testing.docx")
    );
    $fp = fopen("file.ico", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
// Pretvorite datoteku i nabavite ZIP
<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"ico\", \"zip\": true}",
        "file_contents" => curl_file_create("testing.docx")
    );
    $fp = fopen("file.zip", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
Parametar Opis
file Morate poslati Word datoteku koju želite pretvoriti.
data
  • convert_to: ico
  • Da biste dobili ZIP datoteku, možete je proslijediti zip: true

DOCX u BMP

POST https://word.to/v1/api

Python :

import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.docx', 'rb')}
params = {
    'convert_to': 'bmp'
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.bmp', 'wb') as f:
    f.write(r.content)
# Pretvorite datoteku i nabavite ZIP
import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.docx', 'rb')}
params = {
    'convert_to': 'bmp',
    'zip': True
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.zip', 'wb') as f:
    f.write(r.content)

NodeJS :

const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'bmp'})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});
// Pretvorite datoteku i nabavite ZIP
const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'bmp', 'zip': true})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});

CURL :

curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.docx' \
-F 'data={"convert_to": "bmp"}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.bmp
// Pretvorite datoteku i nabavite ZIP
curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.docx' \
-F 'data={"convert_to": "bmp", "zip": true}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.zip

PHP :

<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"bmp\"}",
        "file_contents" => curl_file_create("testing.docx")
    );
    $fp = fopen("file.bmp", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
// Pretvorite datoteku i nabavite ZIP
<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"bmp\", \"zip\": true}",
        "file_contents" => curl_file_create("testing.docx")
    );
    $fp = fopen("file.zip", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
Parametar Opis
file Morate poslati Word datoteku koju želite pretvoriti.
data
  • convert_to: bmp
  • Da biste dobili ZIP datoteku, možete je proslijediti zip: true

DOCX u SVG

POST https://word.to/v1/api

Python :

import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.docx', 'rb')}
params = {
    'convert_to': 'svg'
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.svg', 'wb') as f:
    f.write(r.content)
# Pretvorite datoteku i nabavite ZIP
import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.docx', 'rb')}
params = {
    'convert_to': 'svg',
    'zip': True
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.zip', 'wb') as f:
    f.write(r.content)

NodeJS :

const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'svg'})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});
// Pretvorite datoteku i nabavite ZIP
const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'svg', 'zip': true})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});

CURL :

curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.docx' \
-F 'data={"convert_to": "svg"}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.svg
// Pretvorite datoteku i nabavite ZIP
curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.docx' \
-F 'data={"convert_to": "svg", "zip": true}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.zip

PHP :

<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"svg\"}",
        "file_contents" => curl_file_create("testing.docx")
    );
    $fp = fopen("file.svg", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
// Pretvorite datoteku i nabavite ZIP
<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"svg\", \"zip\": true}",
        "file_contents" => curl_file_create("testing.docx")
    );
    $fp = fopen("file.zip", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
Parametar Opis
file Morate poslati Word datoteku koju želite pretvoriti.
data
  • convert_to: svg
  • Da biste dobili ZIP datoteku, možete je proslijediti zip: true

DOCX u WebP

POST https://word.to/v1/api

Python :

import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.docx', 'rb')}
params = {
    'convert_to': 'webp'
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.webp', 'wb') as f:
    f.write(r.content)
# Pretvorite datoteku i nabavite ZIP
import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.docx', 'rb')}
params = {
    'convert_to': 'webp',
    'zip': True
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.zip', 'wb') as f:
    f.write(r.content)

NodeJS :

const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'webp'})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});
// Pretvorite datoteku i nabavite ZIP
const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'webp', 'zip': true})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});

CURL :

curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.docx' \
-F 'data={"convert_to": "webp"}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.webp
// Pretvorite datoteku i nabavite ZIP
curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.docx' \
-F 'data={"convert_to": "webp", "zip": true}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.zip

PHP :

<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"webp\"}",
        "file_contents" => curl_file_create("testing.docx")
    );
    $fp = fopen("file.webp", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
// Pretvorite datoteku i nabavite ZIP
<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"webp\", \"zip\": true}",
        "file_contents" => curl_file_create("testing.docx")
    );
    $fp = fopen("file.zip", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
Parametar Opis
file Morate poslati Word datoteku koju želite pretvoriti.
data
  • convert_to: webp
  • Da biste dobili ZIP datoteku, možete je proslijediti zip: true

DOCX u GIF

POST https://word.to/v1/api

Python :

import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.docx', 'rb')}
params = {
    'convert_to': 'gif'
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.gif', 'wb') as f:
    f.write(r.content)
# Pretvorite datoteku i nabavite ZIP
import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.docx', 'rb')}
params = {
    'convert_to': 'gif',
    'zip': True
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.zip', 'wb') as f:
    f.write(r.content)

NodeJS :

const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'gif'})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});
// Pretvorite datoteku i nabavite ZIP
const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'gif', 'zip': true})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});

CURL :

curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.docx' \
-F 'data={"convert_to": "gif"}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.gif
// Pretvorite datoteku i nabavite ZIP
curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.docx' \
-F 'data={"convert_to": "gif", "zip": true}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.zip

PHP :

<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"gif\"}",
        "file_contents" => curl_file_create("testing.docx")
    );
    $fp = fopen("file.gif", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
// Pretvorite datoteku i nabavite ZIP
<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"gif\", \"zip\": true}",
        "file_contents" => curl_file_create("testing.docx")
    );
    $fp = fopen("file.zip", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
Parametar Opis
file Morate poslati Word datoteku koju želite pretvoriti.
data
  • convert_to: gif
  • Da biste dobili ZIP datoteku, možete je proslijediti zip: true

DOCX u TIFF

POST https://word.to/v1/api

Python :

import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.docx', 'rb')}
params = {
    'convert_to': 'tiff'
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.tiff', 'wb') as f:
    f.write(r.content)
# Pretvorite datoteku i nabavite ZIP
import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.docx', 'rb')}
params = {
    'convert_to': 'tiff',
    'zip': True
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.zip', 'wb') as f:
    f.write(r.content)

NodeJS :

const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'tiff'})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});
// Pretvorite datoteku i nabavite ZIP
const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'tiff', 'zip': true})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});

CURL :

curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.docx' \
-F 'data={"convert_to": "tiff"}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.tiff
// Pretvorite datoteku i nabavite ZIP
curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.docx' \
-F 'data={"convert_to": "tiff", "zip": true}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.zip

PHP :

<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"tiff\"}",
        "file_contents" => curl_file_create("testing.docx")
    );
    $fp = fopen("file.tiff", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
// Pretvorite datoteku i nabavite ZIP
<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"tiff\", \"zip\": true}",
        "file_contents" => curl_file_create("testing.docx")
    );
    $fp = fopen("file.zip", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
Parametar Opis
file Morate poslati Word datoteku koju želite pretvoriti.
data
  • convert_to: tiff
  • Da biste dobili ZIP datoteku, možete je proslijediti zip: true

DOCX u PSD

POST https://word.to/v1/api

Python :

import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.docx', 'rb')}
params = {
    'convert_to': 'psd'
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.psd', 'wb') as f:
    f.write(r.content)
# Pretvorite datoteku i nabavite ZIP
import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.docx', 'rb')}
params = {
    'convert_to': 'psd',
    'zip': True
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.zip', 'wb') as f:
    f.write(r.content)

NodeJS :

const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'psd'})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});
// Pretvorite datoteku i nabavite ZIP
const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'psd', 'zip': true})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});

CURL :

curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.docx' \
-F 'data={"convert_to": "psd"}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.psd
// Pretvorite datoteku i nabavite ZIP
curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.docx' \
-F 'data={"convert_to": "psd", "zip": true}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.zip

PHP :

<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"psd\"}",
        "file_contents" => curl_file_create("testing.docx")
    );
    $fp = fopen("file.psd", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
// Pretvorite datoteku i nabavite ZIP
<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"psd\", \"zip\": true}",
        "file_contents" => curl_file_create("testing.docx")
    );
    $fp = fopen("file.zip", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
Parametar Opis
file Morate poslati Word datoteku koju želite pretvoriti.
data
  • convert_to: psd
  • Da biste dobili ZIP datoteku, možete je proslijediti zip: true

DOCX u JPEG

POST https://word.to/v1/api

Python :

import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.docx', 'rb')}
params = {
    'convert_to': 'jpeg'
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.jpeg', 'wb') as f:
    f.write(r.content)
# Pretvorite datoteku i nabavite ZIP
import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.docx', 'rb')}
params = {
    'convert_to': 'jpeg',
    'zip': True
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.zip', 'wb') as f:
    f.write(r.content)

NodeJS :

const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'jpeg'})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});
// Pretvorite datoteku i nabavite ZIP
const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'jpeg', 'zip': true})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});

CURL :

curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.docx' \
-F 'data={"convert_to": "jpeg"}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.jpeg
// Pretvorite datoteku i nabavite ZIP
curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.docx' \
-F 'data={"convert_to": "jpeg", "zip": true}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.zip

PHP :

<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"jpeg\"}",
        "file_contents" => curl_file_create("testing.docx")
    );
    $fp = fopen("file.jpeg", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
// Pretvorite datoteku i nabavite ZIP
<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"jpeg\", \"zip\": true}",
        "file_contents" => curl_file_create("testing.docx")
    );
    $fp = fopen("file.zip", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
Parametar Opis
file Morate poslati Word datoteku koju želite pretvoriti.
data
  • convert_to: jpeg
  • Da biste dobili ZIP datoteku, možete je proslijediti zip: true

DOCX do DOC

POST https://word.to/v1/api

Python :

import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.docx', 'rb')}
params = {
    'convert_to': 'doc'
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.doc', 'wb') as f:
    f.write(r.content)
# Pretvorite datoteku i nabavite ZIP
import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.docx', 'rb')}
params = {
    'convert_to': 'doc',
    'zip': True
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.zip', 'wb') as f:
    f.write(r.content)

NodeJS :

const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'doc'})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});
// Pretvorite datoteku i nabavite ZIP
const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'doc', 'zip': true})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});

CURL :

curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.docx' \
-F 'data={"convert_to": "doc"}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.doc
// Pretvorite datoteku i nabavite ZIP
curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.docx' \
-F 'data={"convert_to": "doc", "zip": true}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.zip

PHP :

<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"doc\"}",
        "file_contents" => curl_file_create("testing.docx")
    );
    $fp = fopen("file.doc", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
// Pretvorite datoteku i nabavite ZIP
<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"doc\", \"zip\": true}",
        "file_contents" => curl_file_create("testing.docx")
    );
    $fp = fopen("file.zip", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
Parametar Opis
file Morate poslati Word datoteku koju želite pretvoriti.
data
  • convert_to: doc
  • Da biste dobili ZIP datoteku, možete je proslijediti zip: true

DOC u datoteke

DOC u PDF

POST https://word.to/v1/api

Python :

import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.doc', 'rb')}
params = {
    'convert_to': 'pdf'
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.pdf', 'wb') as f:
    f.write(r.content)
# Pretvorite datoteku i nabavite ZIP
import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.doc', 'rb')}
params = {
    'convert_to': 'pdf',
    'zip': True
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.zip', 'wb') as f:
    f.write(r.content)

NodeJS :

const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'pdf'})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});
// Pretvorite datoteku i nabavite ZIP
const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'pdf', 'zip': true})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});

CURL :

curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.doc' \
-F 'data={"convert_to": "pdf"}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.pdf
// Pretvorite datoteku i nabavite ZIP
curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.doc' \
-F 'data={"convert_to": "pdf", "zip": true}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.zip

PHP :

<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"pdf\"}",
        "file_contents" => curl_file_create("testing.doc")
    );
    $fp = fopen("file.pdf", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
// Pretvorite datoteku i nabavite ZIP
<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"pdf\", \"zip\": true}",
        "file_contents" => curl_file_create("testing.doc")
    );
    $fp = fopen("file.zip", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
Parametar Opis
file Morate poslati Word datoteku koju želite pretvoriti.
data
  • convert_to: pdf
  • Da biste dobili ZIP datoteku, možete je proslijediti zip: true

DOC u JPG

POST https://word.to/v1/api

Python :

import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.doc', 'rb')}
params = {
    'convert_to': 'jpg'
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.jpg', 'wb') as f:
    f.write(r.content)
# Pretvorite datoteku i nabavite ZIP
import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.doc', 'rb')}
params = {
    'convert_to': 'jpg',
    'zip': True
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.zip', 'wb') as f:
    f.write(r.content)

NodeJS :

const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'jpg'})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});
// Pretvorite datoteku i nabavite ZIP
const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'jpg', 'zip': true})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});

CURL :

curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.doc' \
-F 'data={"convert_to": "jpg"}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.jpg
// Pretvorite datoteku i nabavite ZIP
curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.doc' \
-F 'data={"convert_to": "jpg", "zip": true}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.zip

PHP :

<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"jpg\"}",
        "file_contents" => curl_file_create("testing.doc")
    );
    $fp = fopen("file.jpg", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
// Pretvorite datoteku i nabavite ZIP
<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"jpg\", \"zip\": true}",
        "file_contents" => curl_file_create("testing.doc")
    );
    $fp = fopen("file.zip", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
Parametar Opis
file Morate poslati Word datoteku koju želite pretvoriti.
data
  • convert_to: jpg
  • Da biste dobili ZIP datoteku, možete je proslijediti zip: true

DOC u PNG

POST https://word.to/v1/api

Python :

import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.doc', 'rb')}
params = {
    'convert_to': 'png'
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.png', 'wb') as f:
    f.write(r.content)
# Pretvorite datoteku i nabavite ZIP
import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.doc', 'rb')}
params = {
    'convert_to': 'png',
    'zip': True
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.zip', 'wb') as f:
    f.write(r.content)

NodeJS :

const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'png'})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});
// Pretvorite datoteku i nabavite ZIP
const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'png', 'zip': true})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});

CURL :

curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.doc' \
-F 'data={"convert_to": "png"}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.png
// Pretvorite datoteku i nabavite ZIP
curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.doc' \
-F 'data={"convert_to": "png", "zip": true}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.zip

PHP :

<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"png\"}",
        "file_contents" => curl_file_create("testing.doc")
    );
    $fp = fopen("file.png", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
// Pretvorite datoteku i nabavite ZIP
<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"png\", \"zip\": true}",
        "file_contents" => curl_file_create("testing.doc")
    );
    $fp = fopen("file.zip", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
Parametar Opis
file Morate poslati Word datoteku koju želite pretvoriti.
data
  • convert_to: png
  • Da biste dobili ZIP datoteku, možete je proslijediti zip: true

DOC u XLS

POST https://word.to/v1/api

Python :

import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.doc', 'rb')}
params = {
    'convert_to': 'xls'
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.xls', 'wb') as f:
    f.write(r.content)
# Pretvorite datoteku i nabavite ZIP
import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.doc', 'rb')}
params = {
    'convert_to': 'xls',
    'zip': True
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.zip', 'wb') as f:
    f.write(r.content)

NodeJS :

const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'xls'})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});
// Pretvorite datoteku i nabavite ZIP
const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'xls', 'zip': true})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});

CURL :

curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.doc' \
-F 'data={"convert_to": "xls"}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.xls
// Pretvorite datoteku i nabavite ZIP
curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.doc' \
-F 'data={"convert_to": "xls", "zip": true}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.zip

PHP :

<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"xls\"}",
        "file_contents" => curl_file_create("testing.doc")
    );
    $fp = fopen("file.xls", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
// Pretvorite datoteku i nabavite ZIP
<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"xls\", \"zip\": true}",
        "file_contents" => curl_file_create("testing.doc")
    );
    $fp = fopen("file.zip", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
Parametar Opis
file Morate poslati Word datoteku koju želite pretvoriti.
data
  • convert_to: xls
  • Da biste dobili ZIP datoteku, možete je proslijediti zip: true

DOC u XLSX

POST https://word.to/v1/api

Python :

import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.doc', 'rb')}
params = {
    'convert_to': 'xlsx'
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.xlsx', 'wb') as f:
    f.write(r.content)
# Pretvorite datoteku i nabavite ZIP
import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.doc', 'rb')}
params = {
    'convert_to': 'xlsx',
    'zip': True
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.zip', 'wb') as f:
    f.write(r.content)

NodeJS :

const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'xlsx'})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});
// Pretvorite datoteku i nabavite ZIP
const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'xlsx', 'zip': true})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});

CURL :

curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.doc' \
-F 'data={"convert_to": "xlsx"}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.xlsx
// Pretvorite datoteku i nabavite ZIP
curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.doc' \
-F 'data={"convert_to": "xlsx", "zip": true}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.zip

PHP :

<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"xlsx\"}",
        "file_contents" => curl_file_create("testing.doc")
    );
    $fp = fopen("file.xlsx", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
// Pretvorite datoteku i nabavite ZIP
<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"xlsx\", \"zip\": true}",
        "file_contents" => curl_file_create("testing.doc")
    );
    $fp = fopen("file.zip", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
Parametar Opis
file Morate poslati Word datoteku koju želite pretvoriti.
data
  • convert_to: xlsx
  • Da biste dobili ZIP datoteku, možete je proslijediti zip: true

DOC na ICO

POST https://word.to/v1/api

Python :

import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.doc', 'rb')}
params = {
    'convert_to': 'ico'
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.ico', 'wb') as f:
    f.write(r.content)
# Pretvorite datoteku i nabavite ZIP
import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.doc', 'rb')}
params = {
    'convert_to': 'ico',
    'zip': True
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.zip', 'wb') as f:
    f.write(r.content)

NodeJS :

const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'ico'})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});
// Pretvorite datoteku i nabavite ZIP
const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'ico', 'zip': true})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});

CURL :

curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.doc' \
-F 'data={"convert_to": "ico"}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.ico
// Pretvorite datoteku i nabavite ZIP
curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.doc' \
-F 'data={"convert_to": "ico", "zip": true}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.zip

PHP :

<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"ico\"}",
        "file_contents" => curl_file_create("testing.doc")
    );
    $fp = fopen("file.ico", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
// Pretvorite datoteku i nabavite ZIP
<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"ico\", \"zip\": true}",
        "file_contents" => curl_file_create("testing.doc")
    );
    $fp = fopen("file.zip", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
Parametar Opis
file Morate poslati Word datoteku koju želite pretvoriti.
data
  • convert_to: ico
  • Da biste dobili ZIP datoteku, možete je proslijediti zip: true

DOC u BMP

POST https://word.to/v1/api

Python :

import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.doc', 'rb')}
params = {
    'convert_to': 'bmp'
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.bmp', 'wb') as f:
    f.write(r.content)
# Pretvorite datoteku i nabavite ZIP
import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.doc', 'rb')}
params = {
    'convert_to': 'bmp',
    'zip': True
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.zip', 'wb') as f:
    f.write(r.content)

NodeJS :

const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'bmp'})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});
// Pretvorite datoteku i nabavite ZIP
const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'bmp', 'zip': true})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});

CURL :

curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.doc' \
-F 'data={"convert_to": "bmp"}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.bmp
// Pretvorite datoteku i nabavite ZIP
curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.doc' \
-F 'data={"convert_to": "bmp", "zip": true}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.zip

PHP :

<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"bmp\"}",
        "file_contents" => curl_file_create("testing.doc")
    );
    $fp = fopen("file.bmp", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
// Pretvorite datoteku i nabavite ZIP
<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"bmp\", \"zip\": true}",
        "file_contents" => curl_file_create("testing.doc")
    );
    $fp = fopen("file.zip", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
Parametar Opis
file Morate poslati Word datoteku koju želite pretvoriti.
data
  • convert_to: bmp
  • Da biste dobili ZIP datoteku, možete je proslijediti zip: true

DOC u SVG

POST https://word.to/v1/api

Python :

import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.doc', 'rb')}
params = {
    'convert_to': 'svg'
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.svg', 'wb') as f:
    f.write(r.content)
# Pretvorite datoteku i nabavite ZIP
import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.doc', 'rb')}
params = {
    'convert_to': 'svg',
    'zip': True
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.zip', 'wb') as f:
    f.write(r.content)

NodeJS :

const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'svg'})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});
// Pretvorite datoteku i nabavite ZIP
const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'svg', 'zip': true})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});

CURL :

curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.doc' \
-F 'data={"convert_to": "svg"}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.svg
// Pretvorite datoteku i nabavite ZIP
curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.doc' \
-F 'data={"convert_to": "svg", "zip": true}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.zip

PHP :

<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"svg\"}",
        "file_contents" => curl_file_create("testing.doc")
    );
    $fp = fopen("file.svg", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
// Pretvorite datoteku i nabavite ZIP
<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"svg\", \"zip\": true}",
        "file_contents" => curl_file_create("testing.doc")
    );
    $fp = fopen("file.zip", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
Parametar Opis
file Morate poslati Word datoteku koju želite pretvoriti.
data
  • convert_to: svg
  • Da biste dobili ZIP datoteku, možete je proslijediti zip: true

DOC na WebP

POST https://word.to/v1/api

Python :

import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.doc', 'rb')}
params = {
    'convert_to': 'webp'
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.webp', 'wb') as f:
    f.write(r.content)
# Pretvorite datoteku i nabavite ZIP
import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.doc', 'rb')}
params = {
    'convert_to': 'webp',
    'zip': True
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.zip', 'wb') as f:
    f.write(r.content)

NodeJS :

const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'webp'})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});
// Pretvorite datoteku i nabavite ZIP
const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'webp', 'zip': true})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});

CURL :

curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.doc' \
-F 'data={"convert_to": "webp"}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.webp
// Pretvorite datoteku i nabavite ZIP
curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.doc' \
-F 'data={"convert_to": "webp", "zip": true}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.zip

PHP :

<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"webp\"}",
        "file_contents" => curl_file_create("testing.doc")
    );
    $fp = fopen("file.webp", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
// Pretvorite datoteku i nabavite ZIP
<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"webp\", \"zip\": true}",
        "file_contents" => curl_file_create("testing.doc")
    );
    $fp = fopen("file.zip", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
Parametar Opis
file Morate poslati Word datoteku koju želite pretvoriti.
data
  • convert_to: webp
  • Da biste dobili ZIP datoteku, možete je proslijediti zip: true

DOC u GIF

POST https://word.to/v1/api

Python :

import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.doc', 'rb')}
params = {
    'convert_to': 'gif'
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.gif', 'wb') as f:
    f.write(r.content)
# Pretvorite datoteku i nabavite ZIP
import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.doc', 'rb')}
params = {
    'convert_to': 'gif',
    'zip': True
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.zip', 'wb') as f:
    f.write(r.content)

NodeJS :

const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'gif'})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});
// Pretvorite datoteku i nabavite ZIP
const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'gif', 'zip': true})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});

CURL :

curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.doc' \
-F 'data={"convert_to": "gif"}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.gif
// Pretvorite datoteku i nabavite ZIP
curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.doc' \
-F 'data={"convert_to": "gif", "zip": true}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.zip

PHP :

<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"gif\"}",
        "file_contents" => curl_file_create("testing.doc")
    );
    $fp = fopen("file.gif", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
// Pretvorite datoteku i nabavite ZIP
<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"gif\", \"zip\": true}",
        "file_contents" => curl_file_create("testing.doc")
    );
    $fp = fopen("file.zip", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
Parametar Opis
file Morate poslati Word datoteku koju želite pretvoriti.
data
  • convert_to: gif
  • Da biste dobili ZIP datoteku, možete je proslijediti zip: true

DOC u TIFF

POST https://word.to/v1/api

Python :

import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.doc', 'rb')}
params = {
    'convert_to': 'tiff'
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.tiff', 'wb') as f:
    f.write(r.content)
# Pretvorite datoteku i nabavite ZIP
import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.doc', 'rb')}
params = {
    'convert_to': 'tiff',
    'zip': True
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.zip', 'wb') as f:
    f.write(r.content)

NodeJS :

const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'tiff'})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});
// Pretvorite datoteku i nabavite ZIP
const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'tiff', 'zip': true})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});

CURL :

curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.doc' \
-F 'data={"convert_to": "tiff"}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.tiff
// Pretvorite datoteku i nabavite ZIP
curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.doc' \
-F 'data={"convert_to": "tiff", "zip": true}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.zip

PHP :

<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"tiff\"}",
        "file_contents" => curl_file_create("testing.doc")
    );
    $fp = fopen("file.tiff", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
// Pretvorite datoteku i nabavite ZIP
<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"tiff\", \"zip\": true}",
        "file_contents" => curl_file_create("testing.doc")
    );
    $fp = fopen("file.zip", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
Parametar Opis
file Morate poslati Word datoteku koju želite pretvoriti.
data
  • convert_to: tiff
  • Da biste dobili ZIP datoteku, možete je proslijediti zip: true

DOC u PSD

POST https://word.to/v1/api

Python :

import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.doc', 'rb')}
params = {
    'convert_to': 'psd'
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.psd', 'wb') as f:
    f.write(r.content)
# Pretvorite datoteku i nabavite ZIP
import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.doc', 'rb')}
params = {
    'convert_to': 'psd',
    'zip': True
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.zip', 'wb') as f:
    f.write(r.content)

NodeJS :

const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'psd'})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});
// Pretvorite datoteku i nabavite ZIP
const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'psd', 'zip': true})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});

CURL :

curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.doc' \
-F 'data={"convert_to": "psd"}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.psd
// Pretvorite datoteku i nabavite ZIP
curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.doc' \
-F 'data={"convert_to": "psd", "zip": true}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.zip

PHP :

<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"psd\"}",
        "file_contents" => curl_file_create("testing.doc")
    );
    $fp = fopen("file.psd", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
// Pretvorite datoteku i nabavite ZIP
<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"psd\", \"zip\": true}",
        "file_contents" => curl_file_create("testing.doc")
    );
    $fp = fopen("file.zip", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
Parametar Opis
file Morate poslati Word datoteku koju želite pretvoriti.
data
  • convert_to: psd
  • Da biste dobili ZIP datoteku, možete je proslijediti zip: true

DOC u JPEG

POST https://word.to/v1/api

Python :

import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.doc', 'rb')}
params = {
    'convert_to': 'jpeg'
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.jpeg', 'wb') as f:
    f.write(r.content)
# Pretvorite datoteku i nabavite ZIP
import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.doc', 'rb')}
params = {
    'convert_to': 'jpeg',
    'zip': True
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.zip', 'wb') as f:
    f.write(r.content)

NodeJS :

const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'jpeg'})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});
// Pretvorite datoteku i nabavite ZIP
const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'jpeg', 'zip': true})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});

CURL :

curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.doc' \
-F 'data={"convert_to": "jpeg"}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.jpeg
// Pretvorite datoteku i nabavite ZIP
curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.doc' \
-F 'data={"convert_to": "jpeg", "zip": true}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.zip

PHP :

<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"jpeg\"}",
        "file_contents" => curl_file_create("testing.doc")
    );
    $fp = fopen("file.jpeg", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
// Pretvorite datoteku i nabavite ZIP
<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"jpeg\", \"zip\": true}",
        "file_contents" => curl_file_create("testing.doc")
    );
    $fp = fopen("file.zip", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
Parametar Opis
file Morate poslati Word datoteku koju želite pretvoriti.
data
  • convert_to: jpeg
  • Da biste dobili ZIP datoteku, možete je proslijediti zip: true

DOC do DOCX

POST https://word.to/v1/api

Python :

import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.doc', 'rb')}
params = {
    'convert_to': 'docx'
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.docx', 'wb') as f:
    f.write(r.content)
# Pretvorite datoteku i nabavite ZIP
import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.doc', 'rb')}
params = {
    'convert_to': 'docx',
    'zip': True
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.zip', 'wb') as f:
    f.write(r.content)

NodeJS :

const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'docx'})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});
// Pretvorite datoteku i nabavite ZIP
const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'docx', 'zip': true})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});

CURL :

curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.doc' \
-F 'data={"convert_to": "docx"}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.docx
// Pretvorite datoteku i nabavite ZIP
curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.doc' \
-F 'data={"convert_to": "docx", "zip": true}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.zip

PHP :

<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"docx\"}",
        "file_contents" => curl_file_create("testing.doc")
    );
    $fp = fopen("file.docx", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
// Pretvorite datoteku i nabavite ZIP
<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"docx\", \"zip\": true}",
        "file_contents" => curl_file_create("testing.doc")
    );
    $fp = fopen("file.zip", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
Parametar Opis
file Morate poslati Word datoteku koju želite pretvoriti.
data
  • convert_to: docx
  • Da biste dobili ZIP datoteku, možete je proslijediti zip: true

Datoteke u DOCX

PDF u DOCX

POST https://word.to/v1/api

Python :

import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.pdf', 'rb')}
params = {
    'convert_to': 'docx'
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.docx', 'wb') as f:
    f.write(r.content)
# Pretvorite datoteku i nabavite ZIP
import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.pdf', 'rb')}
params = {
    'convert_to': 'docx',
    'zip': True
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.zip', 'wb') as f:
    f.write(r.content)

NodeJS :

const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'docx'})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});
// Pretvorite datoteku i nabavite ZIP
const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'docx', 'zip': true})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});

CURL :

curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.pdf' \
-F 'data={"convert_to": "docx"}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.docx
// Pretvorite datoteku i nabavite ZIP
curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.pdf' \
-F 'data={"convert_to": "docx", "zip": true}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.zip

PHP :

<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"docx\"}",
        "file_contents" => curl_file_create("testing.pdf")
    );
    $fp = fopen("file.docx", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
// Pretvorite datoteku i nabavite ZIP
<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"docx\", \"zip\": true}",
        "file_contents" => curl_file_create("testing.pdf")
    );
    $fp = fopen("file.zip", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
Parametar Opis
file Morate poslati Word datoteku koju želite pretvoriti.
data
  • convert_to: docx
  • Da biste dobili ZIP datoteku, možete je proslijediti:
    zip: true
  • Da biste izvršili konverziju pomoću OCR-a, morate proći::
    ocr: true

JPG u DOCX

POST https://word.to/v1/api

Python :

import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.jpg', 'rb')}
params = {
    'convert_to': 'docx'
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.docx', 'wb') as f:
    f.write(r.content)
# Pretvorite datoteku i nabavite ZIP
import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.jpg', 'rb')}
params = {
    'convert_to': 'docx',
    'zip': True
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.zip', 'wb') as f:
    f.write(r.content)

NodeJS :

const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'docx'})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});
// Pretvorite datoteku i nabavite ZIP
const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'docx', 'zip': true})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});

CURL :

curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.jpg' \
-F 'data={"convert_to": "docx"}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.docx
// Pretvorite datoteku i nabavite ZIP
curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.jpg' \
-F 'data={"convert_to": "docx", "zip": true}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.zip

PHP :

<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"docx\"}",
        "file_contents" => curl_file_create("testing.jpg")
    );
    $fp = fopen("file.docx", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
// Pretvorite datoteku i nabavite ZIP
<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"docx\", \"zip\": true}",
        "file_contents" => curl_file_create("testing.jpg")
    );
    $fp = fopen("file.zip", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
Parametar Opis
file Morate poslati Word datoteku koju želite pretvoriti.
data
  • convert_to: docx
  • Da biste dobili ZIP datoteku, možete je proslijediti:
    zip: true
  • Da biste izvršili konverziju pomoću OCR-a, morate proći::
    ocr: true

JPEG u DOCX

POST https://word.to/v1/api

Python :

import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.jpeg', 'rb')}
params = {
    'convert_to': 'docx'
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.docx', 'wb') as f:
    f.write(r.content)
# Pretvorite datoteku i nabavite ZIP
import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.jpeg', 'rb')}
params = {
    'convert_to': 'docx',
    'zip': True
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.zip', 'wb') as f:
    f.write(r.content)

NodeJS :

const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'docx'})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});
// Pretvorite datoteku i nabavite ZIP
const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'docx', 'zip': true})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});

CURL :

curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.jpeg' \
-F 'data={"convert_to": "docx"}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.docx
// Pretvorite datoteku i nabavite ZIP
curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.jpeg' \
-F 'data={"convert_to": "docx", "zip": true}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.zip

PHP :

<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"docx\"}",
        "file_contents" => curl_file_create("testing.jpeg")
    );
    $fp = fopen("file.docx", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
// Pretvorite datoteku i nabavite ZIP
<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"docx\", \"zip\": true}",
        "file_contents" => curl_file_create("testing.jpeg")
    );
    $fp = fopen("file.zip", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
Parametar Opis
file Morate poslati Word datoteku koju želite pretvoriti.
data
  • convert_to: docx
  • Da biste dobili ZIP datoteku, možete je proslijediti:
    zip: true
  • Da biste izvršili konverziju pomoću OCR-a, morate proći::
    ocr: true

PNG u DOCX

POST https://word.to/v1/api

Python :

import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.png', 'rb')}
params = {
    'convert_to': 'docx'
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.docx', 'wb') as f:
    f.write(r.content)
# Pretvorite datoteku i nabavite ZIP
import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.png', 'rb')}
params = {
    'convert_to': 'docx',
    'zip': True
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.zip', 'wb') as f:
    f.write(r.content)

NodeJS :

const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'docx'})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});
// Pretvorite datoteku i nabavite ZIP
const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'docx', 'zip': true})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});

CURL :

curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.png' \
-F 'data={"convert_to": "docx"}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.docx
// Pretvorite datoteku i nabavite ZIP
curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.png' \
-F 'data={"convert_to": "docx", "zip": true}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.zip

PHP :

<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"docx\"}",
        "file_contents" => curl_file_create("testing.png")
    );
    $fp = fopen("file.docx", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
// Pretvorite datoteku i nabavite ZIP
<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"docx\", \"zip\": true}",
        "file_contents" => curl_file_create("testing.png")
    );
    $fp = fopen("file.zip", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
Parametar Opis
file Morate poslati Word datoteku koju želite pretvoriti.
data
  • convert_to: docx
  • Da biste dobili ZIP datoteku, možete je proslijediti:
    zip: true
  • Da biste izvršili konverziju pomoću OCR-a, morate proći::
    ocr: true

ICO u DOCX

POST https://word.to/v1/api

Python :

import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.ico', 'rb')}
params = {
    'convert_to': 'docx'
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.docx', 'wb') as f:
    f.write(r.content)
# Pretvorite datoteku i nabavite ZIP
import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.ico', 'rb')}
params = {
    'convert_to': 'docx',
    'zip': True
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.zip', 'wb') as f:
    f.write(r.content)

NodeJS :

const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'docx'})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});
// Pretvorite datoteku i nabavite ZIP
const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'docx', 'zip': true})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});

CURL :

curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.ico' \
-F 'data={"convert_to": "docx"}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.docx
// Pretvorite datoteku i nabavite ZIP
curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.ico' \
-F 'data={"convert_to": "docx", "zip": true}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.zip

PHP :

<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"docx\"}",
        "file_contents" => curl_file_create("testing.ico")
    );
    $fp = fopen("file.docx", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
// Pretvorite datoteku i nabavite ZIP
<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"docx\", \"zip\": true}",
        "file_contents" => curl_file_create("testing.ico")
    );
    $fp = fopen("file.zip", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
Parametar Opis
file Morate poslati Word datoteku koju želite pretvoriti.
data
  • convert_to: docx
  • Da biste dobili ZIP datoteku, možete je proslijediti:
    zip: true
  • Da biste izvršili konverziju pomoću OCR-a, morate proći::
    ocr: true

BMP u DOCX

POST https://word.to/v1/api

Python :

import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.bmp', 'rb')}
params = {
    'convert_to': 'docx'
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.docx', 'wb') as f:
    f.write(r.content)
# Pretvorite datoteku i nabavite ZIP
import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.bmp', 'rb')}
params = {
    'convert_to': 'docx',
    'zip': True
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.zip', 'wb') as f:
    f.write(r.content)

NodeJS :

const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'docx'})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});
// Pretvorite datoteku i nabavite ZIP
const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'docx', 'zip': true})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});

CURL :

curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.bmp' \
-F 'data={"convert_to": "docx"}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.docx
// Pretvorite datoteku i nabavite ZIP
curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.bmp' \
-F 'data={"convert_to": "docx", "zip": true}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.zip

PHP :

<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"docx\"}",
        "file_contents" => curl_file_create("testing.bmp")
    );
    $fp = fopen("file.docx", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
// Pretvorite datoteku i nabavite ZIP
<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"docx\", \"zip\": true}",
        "file_contents" => curl_file_create("testing.bmp")
    );
    $fp = fopen("file.zip", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
Parametar Opis
file Morate poslati Word datoteku koju želite pretvoriti.
data
  • convert_to: docx
  • Da biste dobili ZIP datoteku, možete je proslijediti:
    zip: true
  • Da biste izvršili konverziju pomoću OCR-a, morate proći::
    ocr: true

SVG u DOCX

POST https://word.to/v1/api

Python :

import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.svg', 'rb')}
params = {
    'convert_to': 'docx'
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.docx', 'wb') as f:
    f.write(r.content)
# Pretvorite datoteku i nabavite ZIP
import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.svg', 'rb')}
params = {
    'convert_to': 'docx',
    'zip': True
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.zip', 'wb') as f:
    f.write(r.content)

NodeJS :

const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'docx'})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});
// Pretvorite datoteku i nabavite ZIP
const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'docx', 'zip': true})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});

CURL :

curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.svg' \
-F 'data={"convert_to": "docx"}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.docx
// Pretvorite datoteku i nabavite ZIP
curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.svg' \
-F 'data={"convert_to": "docx", "zip": true}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.zip

PHP :

<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"docx\"}",
        "file_contents" => curl_file_create("testing.svg")
    );
    $fp = fopen("file.docx", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
// Pretvorite datoteku i nabavite ZIP
<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"docx\", \"zip\": true}",
        "file_contents" => curl_file_create("testing.svg")
    );
    $fp = fopen("file.zip", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
Parametar Opis
file Morate poslati Word datoteku koju želite pretvoriti.
data
  • convert_to: docx
  • Da biste dobili ZIP datoteku, možete je proslijediti:
    zip: true
  • Da biste izvršili konverziju pomoću OCR-a, morate proći::
    ocr: true

WebP u DOCX

POST https://word.to/v1/api

Python :

import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.webp', 'rb')}
params = {
    'convert_to': 'docx'
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.docx', 'wb') as f:
    f.write(r.content)
# Pretvorite datoteku i nabavite ZIP
import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.webp', 'rb')}
params = {
    'convert_to': 'docx',
    'zip': True
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.zip', 'wb') as f:
    f.write(r.content)

NodeJS :

const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'docx'})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});
// Pretvorite datoteku i nabavite ZIP
const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'docx', 'zip': true})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});

CURL :

curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.webp' \
-F 'data={"convert_to": "docx"}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.docx
// Pretvorite datoteku i nabavite ZIP
curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.webp' \
-F 'data={"convert_to": "docx", "zip": true}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.zip

PHP :

<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"docx\"}",
        "file_contents" => curl_file_create("testing.webp")
    );
    $fp = fopen("file.docx", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
// Pretvorite datoteku i nabavite ZIP
<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"docx\", \"zip\": true}",
        "file_contents" => curl_file_create("testing.webp")
    );
    $fp = fopen("file.zip", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
Parametar Opis
file Morate poslati Word datoteku koju želite pretvoriti.
data
  • convert_to: docx
  • Da biste dobili ZIP datoteku, možete je proslijediti:
    zip: true
  • Da biste izvršili konverziju pomoću OCR-a, morate proći::
    ocr: true

GIF u DOCX

POST https://word.to/v1/api

Python :

import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.gif', 'rb')}
params = {
    'convert_to': 'docx'
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.docx', 'wb') as f:
    f.write(r.content)
# Pretvorite datoteku i nabavite ZIP
import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.gif', 'rb')}
params = {
    'convert_to': 'docx',
    'zip': True
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.zip', 'wb') as f:
    f.write(r.content)

NodeJS :

const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'docx'})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});
// Pretvorite datoteku i nabavite ZIP
const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'docx', 'zip': true})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});

CURL :

curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.gif' \
-F 'data={"convert_to": "docx"}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.docx
// Pretvorite datoteku i nabavite ZIP
curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.gif' \
-F 'data={"convert_to": "docx", "zip": true}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.zip

PHP :

<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"docx\"}",
        "file_contents" => curl_file_create("testing.gif")
    );
    $fp = fopen("file.docx", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
// Pretvorite datoteku i nabavite ZIP
<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"docx\", \"zip\": true}",
        "file_contents" => curl_file_create("testing.gif")
    );
    $fp = fopen("file.zip", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
Parametar Opis
file Morate poslati Word datoteku koju želite pretvoriti.
data
  • convert_to: gif
  • Da biste dobili ZIP datoteku, možete je proslijediti:
    zip: true
  • Da biste izvršili konverziju pomoću OCR-a, morate proći::
    ocr: true

TIFF u DOCX

POST https://word.to/v1/api

Python :

import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.tiff', 'rb')}
params = {
    'convert_to': 'docx'
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.docx', 'wb') as f:
    f.write(r.content)
# Pretvorite datoteku i nabavite ZIP
import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.tiff', 'rb')}
params = {
    'convert_to': 'docx',
    'zip': True
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.zip', 'wb') as f:
    f.write(r.content)

NodeJS :

const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'docx'})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});
// Pretvorite datoteku i nabavite ZIP
const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'docx', 'zip': true})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});

CURL :

curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.tiff' \
-F 'data={"convert_to": "docx"}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.docx
// Pretvorite datoteku i nabavite ZIP
curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.tiff' \
-F 'data={"convert_to": "docx", "zip": true}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.zip

PHP :

<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"docx\"}",
        "file_contents" => curl_file_create("testing.tiff")
    );
    $fp = fopen("file.docx", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
// Pretvorite datoteku i nabavite ZIP
<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"docx\", \"zip\": true}",
        "file_contents" => curl_file_create("testing.tiff")
    );
    $fp = fopen("file.zip", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
Parametar Opis
file Morate poslati Word datoteku koju želite pretvoriti.
data
  • convert_to: tiff
  • Da biste dobili ZIP datoteku, možete je proslijediti:
    zip: true
  • Da biste izvršili konverziju pomoću OCR-a, morate proći::
    ocr: true

PSD u DOCX

POST https://word.to/v1/api

Python :

import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.psd', 'rb')}
params = {
    'convert_to': 'docx'
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.docx', 'wb') as f:
    f.write(r.content)
# Pretvorite datoteku i nabavite ZIP
import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.psd', 'rb')}
params = {
    'convert_to': 'docx',
    'zip': True
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.zip', 'wb') as f:
    f.write(r.content)

NodeJS :

const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'docx'})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});
// Pretvorite datoteku i nabavite ZIP
const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'docx', 'zip': true})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});

CURL :

curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.psd' \
-F 'data={"convert_to": "docx"}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.docx
// Pretvorite datoteku i nabavite ZIP
curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.psd' \
-F 'data={"convert_to": "docx", "zip": true}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.zip

PHP :

<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"docx\"}",
        "file_contents" => curl_file_create("testing.psd")
    );
    $fp = fopen("file.docx", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
// Pretvorite datoteku i nabavite ZIP
<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"docx\", \"zip\": true}",
        "file_contents" => curl_file_create("testing.psd")
    );
    $fp = fopen("file.zip", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
Parametar Opis
file Morate poslati Word datoteku koju želite pretvoriti.
data
  • convert_to: psd
  • Da biste dobili ZIP datoteku, možete je proslijediti:
    zip: true
  • Da biste izvršili konverziju pomoću OCR-a, morate proći::
    ocr: true

PDF u DOC

POST https://word.to/v1/api

Python :

import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.pdf', 'rb')}
params = {
    'convert_to': 'doc'
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.doc', 'wb') as f:
    f.write(r.content)
# Pretvorite datoteku i nabavite ZIP
import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.pdf', 'rb')}
params = {
    'convert_to': 'doc',
    'zip': True
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.zip', 'wb') as f:
    f.write(r.content)

NodeJS :

const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'doc'})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});
// Pretvorite datoteku i nabavite ZIP
const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'doc', 'zip': true})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});

CURL :

curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.pdf' \
-F 'data={"convert_to": "doc"}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.doc
// Pretvorite datoteku i nabavite ZIP
curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.pdf' \
-F 'data={"convert_to": "doc", "zip": true}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.zip

PHP :

<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"doc\"}",
        "file_contents" => curl_file_create("testing.pdf")
    );
    $fp = fopen("file.doc", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
// Pretvorite datoteku i nabavite ZIP
<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"doc\", \"zip\": true}",
        "file_contents" => curl_file_create("testing.pdf")
    );
    $fp = fopen("file.zip", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
Parametar Opis
file Morate poslati Word datoteku koju želite pretvoriti.
data
  • convert_to: doc
  • Da biste dobili ZIP datoteku, možete je proslijediti:
    zip: true
  • Da biste izvršili konverziju pomoću OCR-a, morate proći::
    ocr: true

JPG u DOC

POST https://word.to/v1/api

Python :

import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.jpg', 'rb')}
params = {
    'convert_to': 'doc'
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.doc', 'wb') as f:
    f.write(r.content)
# Pretvorite datoteku i nabavite ZIP
import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.jpg', 'rb')}
params = {
    'convert_to': 'doc',
    'zip': True
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.zip', 'wb') as f:
    f.write(r.content)

NodeJS :

const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'doc'})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});
// Pretvorite datoteku i nabavite ZIP
const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'doc', 'zip': true})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});

CURL :

curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.jpg' \
-F 'data={"convert_to": "doc"}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.doc
// Pretvorite datoteku i nabavite ZIP
curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.jpg' \
-F 'data={"convert_to": "doc", "zip": true}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.zip

PHP :

<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"doc\"}",
        "file_contents" => curl_file_create("testing.jpg")
    );
    $fp = fopen("file.doc", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
// Pretvorite datoteku i nabavite ZIP
<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"doc\", \"zip\": true}",
        "file_contents" => curl_file_create("testing.jpg")
    );
    $fp = fopen("file.zip", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
Parametar Opis
file Morate poslati Word datoteku koju želite pretvoriti.
data
  • convert_to: doc
  • Da biste dobili ZIP datoteku, možete je proslijediti:
    zip: true
  • Da biste izvršili konverziju pomoću OCR-a, morate proći::
    ocr: true

JPEG u DOC

POST https://word.to/v1/api

Python :

import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.jpeg', 'rb')}
params = {
    'convert_to': 'doc'
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.doc', 'wb') as f:
    f.write(r.content)
# Pretvorite datoteku i nabavite ZIP
import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.jpeg', 'rb')}
params = {
    'convert_to': 'doc',
    'zip': True
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.zip', 'wb') as f:
    f.write(r.content)

NodeJS :

const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'doc'})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});
// Pretvorite datoteku i nabavite ZIP
const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'doc', 'zip': true})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});

CURL :

curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.jpeg' \
-F 'data={"convert_to": "doc"}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.doc
// Pretvorite datoteku i nabavite ZIP
curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.jpeg' \
-F 'data={"convert_to": "doc", "zip": true}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.zip

PHP :

<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"doc\"}",
        "file_contents" => curl_file_create("testing.jpeg")
    );
    $fp = fopen("file.doc", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
// Pretvorite datoteku i nabavite ZIP
<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"doc\", \"zip\": true}",
        "file_contents" => curl_file_create("testing.jpeg")
    );
    $fp = fopen("file.zip", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
Parametar Opis
file Morate poslati Word datoteku koju želite pretvoriti.
data
  • convert_to: doc
  • Da biste dobili ZIP datoteku, možete je proslijediti:
    zip: true
  • Da biste izvršili konverziju pomoću OCR-a, morate proći::
    ocr: true

PNG u DOC

POST https://word.to/v1/api

Python :

import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.png', 'rb')}
params = {
    'convert_to': 'doc'
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.doc', 'wb') as f:
    f.write(r.content)
# Pretvorite datoteku i nabavite ZIP
import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.png', 'rb')}
params = {
    'convert_to': 'doc',
    'zip': True
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.zip', 'wb') as f:
    f.write(r.content)

NodeJS :

const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'doc'})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});
// Pretvorite datoteku i nabavite ZIP
const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'doc', 'zip': true})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});

CURL :

curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.png' \
-F 'data={"convert_to": "doc"}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.doc
// Pretvorite datoteku i nabavite ZIP
curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.png' \
-F 'data={"convert_to": "doc", "zip": true}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.zip

PHP :

<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"doc\"}",
        "file_contents" => curl_file_create("testing.png")
    );
    $fp = fopen("file.doc", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
// Pretvorite datoteku i nabavite ZIP
<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"doc\", \"zip\": true}",
        "file_contents" => curl_file_create("testing.png")
    );
    $fp = fopen("file.zip", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
Parametar Opis
file Morate poslati Word datoteku koju želite pretvoriti.
data
  • convert_to: doc
  • Da biste dobili ZIP datoteku, možete je proslijediti:
    zip: true
  • Da biste izvršili konverziju pomoću OCR-a, morate proći::
    ocr: true

ICO u DOC

POST https://word.to/v1/api

Python :

import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.ico', 'rb')}
params = {
    'convert_to': 'doc'
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.doc', 'wb') as f:
    f.write(r.content)
# Pretvorite datoteku i nabavite ZIP
import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.ico', 'rb')}
params = {
    'convert_to': 'doc',
    'zip': True
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.zip', 'wb') as f:
    f.write(r.content)

NodeJS :

const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'doc'})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});
// Pretvorite datoteku i nabavite ZIP
const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'doc', 'zip': true})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});

CURL :

curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.ico' \
-F 'data={"convert_to": "doc"}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.doc
// Pretvorite datoteku i nabavite ZIP
curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.ico' \
-F 'data={"convert_to": "doc", "zip": true}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.zip

PHP :

<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"doc\"}",
        "file_contents" => curl_file_create("testing.ico")
    );
    $fp = fopen("file.doc", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
// Pretvorite datoteku i nabavite ZIP
<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"doc\", \"zip\": true}",
        "file_contents" => curl_file_create("testing.ico")
    );
    $fp = fopen("file.zip", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
Parametar Opis
file Morate poslati Word datoteku koju želite pretvoriti.
data
  • convert_to: doc
  • Da biste dobili ZIP datoteku, možete je proslijediti:
    zip: true
  • Da biste izvršili konverziju pomoću OCR-a, morate proći::
    ocr: true

BMP u DOC

POST https://word.to/v1/api

Python :

import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.bmp', 'rb')}
params = {
    'convert_to': 'doc'
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.doc', 'wb') as f:
    f.write(r.content)
# Pretvorite datoteku i nabavite ZIP
import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.bmp', 'rb')}
params = {
    'convert_to': 'doc',
    'zip': True
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.zip', 'wb') as f:
    f.write(r.content)

NodeJS :

const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'doc'})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});
// Pretvorite datoteku i nabavite ZIP
const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'doc', 'zip': true})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});

CURL :

curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.bmp' \
-F 'data={"convert_to": "doc"}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.doc
// Pretvorite datoteku i nabavite ZIP
curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.bmp' \
-F 'data={"convert_to": "doc", "zip": true}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.zip

PHP :

<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"doc\"}",
        "file_contents" => curl_file_create("testing.bmp")
    );
    $fp = fopen("file.doc", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
// Pretvorite datoteku i nabavite ZIP
<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"doc\", \"zip\": true}",
        "file_contents" => curl_file_create("testing.bmp")
    );
    $fp = fopen("file.zip", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
Parametar Opis
file Morate poslati Word datoteku koju želite pretvoriti.
data
  • convert_to: doc
  • Da biste dobili ZIP datoteku, možete je proslijediti:
    zip: true
  • Da biste izvršili konverziju pomoću OCR-a, morate proći::
    ocr: true

SVG u DOC

POST https://word.to/v1/api

Python :

import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.svg', 'rb')}
params = {
    'convert_to': 'doc'
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.doc', 'wb') as f:
    f.write(r.content)
# Pretvorite datoteku i nabavite ZIP
import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.svg', 'rb')}
params = {
    'convert_to': 'doc',
    'zip': True
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.zip', 'wb') as f:
    f.write(r.content)

NodeJS :

const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'doc'})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});
// Pretvorite datoteku i nabavite ZIP
const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'doc', 'zip': true})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});

CURL :

curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.svg' \
-F 'data={"convert_to": "doc"}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.doc
// Pretvorite datoteku i nabavite ZIP
curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.svg' \
-F 'data={"convert_to": "doc", "zip": true}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.zip

PHP :

<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"doc\"}",
        "file_contents" => curl_file_create("testing.svg")
    );
    $fp = fopen("file.doc", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
// Pretvorite datoteku i nabavite ZIP
<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"doc\", \"zip\": true}",
        "file_contents" => curl_file_create("testing.svg")
    );
    $fp = fopen("file.zip", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
Parametar Opis
file Morate poslati Word datoteku koju želite pretvoriti.
data
  • convert_to: doc
  • Da biste dobili ZIP datoteku, možete je proslijediti:
    zip: true
  • Da biste izvršili konverziju pomoću OCR-a, morate proći::
    ocr: true

WebP u DOC

POST https://word.to/v1/api

Python :

import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.webp', 'rb')}
params = {
    'convert_to': 'doc'
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.doc', 'wb') as f:
    f.write(r.content)
# Pretvorite datoteku i nabavite ZIP
import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.webp', 'rb')}
params = {
    'convert_to': 'doc',
    'zip': True
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.zip', 'wb') as f:
    f.write(r.content)

NodeJS :

const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'doc'})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});
// Pretvorite datoteku i nabavite ZIP
const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'doc', 'zip': true})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});

CURL :

curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.webp' \
-F 'data={"convert_to": "doc"}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.doc
// Pretvorite datoteku i nabavite ZIP
curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.webp' \
-F 'data={"convert_to": "doc", "zip": true}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.zip

PHP :

<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"doc\"}",
        "file_contents" => curl_file_create("testing.webp")
    );
    $fp = fopen("file.doc", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
// Pretvorite datoteku i nabavite ZIP
<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"doc\", \"zip\": true}",
        "file_contents" => curl_file_create("testing.webp")
    );
    $fp = fopen("file.zip", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
Parametar Opis
file Morate poslati Word datoteku koju želite pretvoriti.
data
  • convert_to: doc
  • Da biste dobili ZIP datoteku, možete je proslijediti:
    zip: true
  • Da biste izvršili konverziju pomoću OCR-a, morate proći::
    ocr: true

GIF u DOC

POST https://word.to/v1/api

Python :

import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.gif', 'rb')}
params = {
    'convert_to': 'doc'
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.doc', 'wb') as f:
    f.write(r.content)
# Pretvorite datoteku i nabavite ZIP
import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.gif', 'rb')}
params = {
    'convert_to': 'doc',
    'zip': True
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.zip', 'wb') as f:
    f.write(r.content)

NodeJS :

const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'doc'})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});
// Pretvorite datoteku i nabavite ZIP
const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'doc', 'zip': true})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});

CURL :

curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.gif' \
-F 'data={"convert_to": "doc"}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.doc
// Pretvorite datoteku i nabavite ZIP
curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.gif' \
-F 'data={"convert_to": "doc", "zip": true}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.zip

PHP :

<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"doc\"}",
        "file_contents" => curl_file_create("testing.gif")
    );
    $fp = fopen("file.doc", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
// Pretvorite datoteku i nabavite ZIP
<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"doc\", \"zip\": true}",
        "file_contents" => curl_file_create("testing.gif")
    );
    $fp = fopen("file.zip", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
Parametar Opis
file Morate poslati Word datoteku koju želite pretvoriti.
data
  • convert_to: doc
  • Da biste dobili ZIP datoteku, možete je proslijediti:
    zip: true
  • Da biste izvršili konverziju pomoću OCR-a, morate proći::
    ocr: true

TIFF u DOC

POST https://word.to/v1/api

Python :

import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.tiff', 'rb')}
params = {
    'convert_to': 'doc'
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.doc', 'wb') as f:
    f.write(r.content)
# Pretvorite datoteku i nabavite ZIP
import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.tiff', 'rb')}
params = {
    'convert_to': 'doc',
    'zip': True
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.zip', 'wb') as f:
    f.write(r.content)

NodeJS :

const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'doc'})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});
// Pretvorite datoteku i nabavite ZIP
const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'doc', 'zip': true})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});

CURL :

curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.tiff' \
-F 'data={"convert_to": "doc"}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.doc
// Pretvorite datoteku i nabavite ZIP
curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.tiff' \
-F 'data={"convert_to": "doc", "zip": true}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.zip

PHP :

<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"doc\"}",
        "file_contents" => curl_file_create("testing.tiff")
    );
    $fp = fopen("file.doc", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
// Pretvorite datoteku i nabavite ZIP
<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"doc\", \"zip\": true}",
        "file_contents" => curl_file_create("testing.tiff")
    );
    $fp = fopen("file.zip", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
Parametar Opis
file Morate poslati Word datoteku koju želite pretvoriti.
data
  • convert_to: doc
  • Da biste dobili ZIP datoteku, možete je proslijediti:
    zip: true
  • Da biste izvršili konverziju pomoću OCR-a, morate proći::
    ocr: true

PSD u DOC

POST https://word.to/v1/api

Python :

import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.psd', 'rb')}
params = {
    'convert_to': 'doc'
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.doc', 'wb') as f:
    f.write(r.content)
# Pretvorite datoteku i nabavite ZIP
import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.psd', 'rb')}
params = {
    'convert_to': 'doc',
    'zip': True
}
data = {'data': json.dumps(params)}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.zip', 'wb') as f:
    f.write(r.content)

NodeJS :

const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'doc'})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});
// Pretvorite datoteku i nabavite ZIP
const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'convert_to': 'doc', 'zip': true})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});

CURL :

curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.psd' \
-F 'data={"convert_to": "doc"}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.doc
// Pretvorite datoteku i nabavite ZIP
curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.psd' \
-F 'data={"convert_to": "doc", "zip": true}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.zip

PHP :

<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"doc\"}",
        "file_contents" => curl_file_create("testing.psd")
    );
    $fp = fopen("file.doc", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
// Pretvorite datoteku i nabavite ZIP
<?php
    $post_data = array(
        "data" => "{\"convert_to\": \"doc\", \"zip\": true}",
        "file_contents" => curl_file_create("testing.psd")
    );
    $fp = fopen("file.zip", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>
Parametar Opis
file Morate poslati Word datoteku koju želite pretvoriti.
data
  • convert_to: doc
  • Da biste dobili ZIP datoteku, možete je proslijediti:
    zip: true
  • Da biste izvršili konverziju pomoću OCR-a, morate proći::
    ocr: true

API alati

POST https://word.to/v1/api

Python :

import requests
import json

url = 'https://word.to/v1/api'
files = {'file': open('testing.pdf', 'rb')}
params = {'tool': 'organize'}
data = {
    'data': json.dumps(params)
}
headers = {'Authorization': '<YOUR_API_KEY>'}

r = requests.post(
    url,
    files=files,
    data=data,
    headers=headers
)

with open('file.docx', 'wb') as f:
    f.write(r.content)

CURL :

curl -POST 'https://word.to/v1/api' \
-F 'data=@/testing.pdf' \
-F 'data={"tool": "organize"}' \
-H 'Authorization: <YOUR_API_KEY>' \
--output file.pdf

NodeJS :

const request = require('request');
const fs = require('fs');

let req = request.post({
    url: 'https://word.to/v1/api',
    headers: {
        'Authorization': '<YOUR_API_KEY>'
    },
    formData: {
        file: fs.createReadStream('testing.pdf'),
        data: JSON.stringify({'tool': 'organize', 'zip': true})
    }
});

req.on('response', function(response) {
    response.pipe(fs.createWriteStream('testing.zip'));
});

PHP :

<?php
    $post_data = array(
        "data" => "{\"tool\": \"organize\", \"zip\": true}",
        "file_contents" => curl_file_create("testing.pdf")
    );
    $fp = fopen("file.zip", "w+");
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://word.to/v1/api");
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        "Authorization: <YOUR_API_KEY>"
    ));
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
    curl_setopt($curl, CURLOPT_FILE, $fp);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    $content = curl_exec($curl);
    curl_close($curl);
    fclose($fp);
?>

Datoteke odgovora možete zipovati na bilo koji zahtjev dodavanjem zip: true na podatke.

Parametar Opis
file
data

Ovaj parametar treba sadržavati informacije o alatu koji se koristi i stranice za izmjenu poput:

  • zip: true