Docs

REST API

Convert HWP/HWPX documents via HTTP

Endpoint

POST https://hwpx.io/api/v1/convert

Authentication

Include your API key in the X-API-Key header.

X-API-Key: YOUR_API_KEY

Parameters

ParameterTypeDescription
fileFileThe .hwp or .hwpx file to convert
formatStringOutput format: "md" (Markdown) or "html"

Request

Send a multipart/form-data POST request with the file and desired output format.

curl

curl -X POST "https://hwpx.io/api/v1/convert" \
  -H "X-API-Key: YOUR_API_KEY" \
  -F "file=@document.hwpx" \
  -F "format=md" \
  -o result.zip

Python

import requests

response = requests.post(
    "https://hwpx.io/api/v1/convert",
    headers={"X-API-Key": "YOUR_API_KEY"},
    files={"file": open("document.hwpx", "rb")},
    data={"format": "md"}
)

with open("result.zip", "wb") as f:
    f.write(response.content)

JavaScript (Node.js)

const form = new FormData();
form.append("file", fs.createReadStream("document.hwpx"));
form.append("format", "md");

const response = await fetch("https://hwpx.io/api/v1/convert", {
  method: "POST",
  headers: { "X-API-Key": "YOUR_API_KEY" },
  body: form,
});

const buffer = await response.arrayBuffer();
fs.writeFileSync("result.zip", Buffer.from(buffer));

Response

A ZIP file containing the converted document and any extracted images.

Rate Limits

20 requests per day per authenticated user.

Error Codes

CodeDescription
400Invalid file type or format
401Missing or invalid API key
429Daily rate limit exceeded
500Internal server error