문서

REST API

HTTP를 통한 HWP/HWPX 문서 변환

엔드포인트

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

인증

X-API-Key 헤더에 API 키를 포함하세요.

X-API-Key: YOUR_API_KEY

파라미터

ParameterTypeDescription
fileFile변환할 .hwp 또는 .hwpx 파일
formatString출력 형식: "md" (Markdown) 또는 "html"

요청

multipart/form-data POST 요청으로 파일과 출력 형식을 전송합니다.

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));

응답

변환된 문서와 추출된 이미지가 포함된 ZIP 파일.

호출 제한

인증된 사용자당 하루 20회.

에러 코드

CodeDescription
400잘못된 파일 형식 또는 포맷
401API 키 누락 또는 유효하지 않음
429일일 호출 한도 초과
500서버 내부 오류