Quick Start
Get up and running with the Enconvert API in minutes. This guide walks you through your first conversion request.
Getting Started in 3 Steps
- Sign up -- Create an account at enconvert.com to get your API key.
- Get your API key -- Navigate to the dashboard and generate a private key (
sk_...). Copy it and keep it secure. - Make your first request -- Use the examples below to convert a file or URL.
Example: Convert a URL to PDF
Use the /v1/convert/url-to-pdf endpoint to capture any web page as a PDF document.
cURL
curl -X POST https://api.enconvert.com/v1/convert/url-to-pdf \
-H "X-API-Key: YOUR_PRIVATE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com", "direct_download": false}' \
--output output.pdf
Response
A successful conversion returns the download URL, storage path, and metadata:
{
"presigned_url": "https://econverter.nyc3.cdn.digitaloceanspaces.com/...",
"object_key": "live/files/12345/url-to-pdf/example_20250202_120530123.pdf",
"filename": "example_20250202_120530123.pdf",
"file_size": 45678,
"conversion_time_seconds": 3.21
}
presigned_url-- A temporary, downloadable URL for the converted file.object_key-- The storage path of the file (e.g.,live/files/12345/url-to-pdf/...).filename-- The generated filename.file_size-- The size of the converted file in bytes.conversion_time_seconds-- How long the conversion took.
Example: Convert a File (JSON to XML)
Upload a file for conversion using multipart/form-data.
cURL
curl -X POST https://api.enconvert.com/v1/convert/json-to-xml \
-H "X-API-Key: YOUR_API_KEY" \
-F "file=@data.json" \
--output output.xml
Response
{
"presigned_url": "https://econverter.nyc3.cdn.digitaloceanspaces.com/...",
"object_key": "live/files/12345/json-to-xml/data_20250202_120530123.xml",
"filename": "data_20250202_120530123.xml",
"file_size": 1024,
"conversion_time_seconds": 0.45
}
Python Example
Use the requests library to convert a URL to PDF:
import requests
response = requests.post(
"https://api.enconvert.com/v1/convert/url-to-pdf",
headers={"X-API-Key": "YOUR_API_KEY"},
json={"url": "https://example.com"}
)
with open("output.pdf", "wb") as f:
f.write(response.content)
JavaScript (Node.js) Example
Use the built-in fetch API (Node.js 18+) or any HTTP client:
const fs = require("fs");
const formData = new FormData();
formData.append("file", new Blob([fs.readFileSync("input.json")]), "input.json");
formData.append("direct_download", "true");
const response = await fetch("https://api.enconvert.com/v1/convert/json-to-xml", {
method: "POST",
headers: { "X-API-Key": "YOUR_API_KEY" },
body: formData,
});
const buffer = Buffer.from(await response.arrayBuffer());
fs.writeFileSync("output.xml", buffer);