API 요청
/rest/pdf_to_docx요청 파라미터 1개 · 필수 1
pdf응답 필드 파일
정상 응답은 파일 본문입니다. 실패 시 JSON 오류가 올 수 있으므로 HTTP 상태와 Content-Type을 먼저 확인하세요.
PDF 파일 한 개를 올리면 편집할 수 있는 DOCX(Word) 파일을 돌려줍니다. 응답은 JSON이 아닌 DOCX 파일입니다.
https://apick.app/rest/pdf_to_docx왜 PDF 파일 DOCX 변환인가
받은 PDF를 고치려고 내용을 처음부터 다시 타이핑하는 일은 사무실의 흔한 낭비입니다. PDF를 DOCX로 변환해 문서 편집기에서 바로 고쳐 쓸 수 있게 합니다.
REQUEST_TOO_LARGE 오류가 반환되며 과금되지 않습니다.
계약서·보고서 PDF를 받아 내용을 고쳐 써야 할 때 사용합니다. 결과 레이아웃은 원본 PDF의 구성에 따라 달라질 수 있으므로 변환 후 내용을 확인하세요.
PDF 형식만 받습니다. 암호가 걸린 PDF는 암호를 해제한 뒤 올리세요.
요금은 변환한 PDF 페이지당 30P입니다. 실패·시간 초과 응답은 과금되지 않습니다. 실제 차감액은 응답 헤더 cost로 확인하세요. 처리 시간은 페이지 수에 비례해 늘어납니다.
/rest/pdf_to_docxpdf정상 응답은 파일 본문입니다. 실패 시 JSON 오류가 올 수 있으므로 HTTP 상태와 Content-Type을 먼저 확인하세요.
POST https://apick.app/rest/pdf_to_docxAuthorization: Bearer 내 계정의 API 인증키multipart/form-data상황별로 보내는 값과 응답에서 확인할 값을 모았습니다. 언어 탭에서 그대로 복사해 쓸 수 있습니다.
PDF 문서를 편집 가능한 DOCX로 받습니다.
/rest/pdf_to_docxcurl --fail-with-body --request POST 'https://apick.app/rest/pdf_to_docx' \
--header "Authorization: Bearer $APICK_API_KEY" \
--form 'pdf=@./contract.pdf' \
--dump-header response.headers --output result.bin
# response.headers의 Content-Type을 확인한 뒤 파일을 사용하세요.import { readFile } from "node:fs/promises";
const form = new FormData();
form.append("pdf", new Blob([await readFile("./contract.pdf")]), "contract.pdf");
const response = await fetch("https://apick.app/rest/pdf_to_docx", {
method: "POST",
headers: { Authorization: "Bearer " + process.env.APICK_API_KEY },
body: form,
signal: AbortSignal.timeout(120_000),
});
if (!response.ok) throw new Error(`HTTP ${response.status}: ${await response.text()}`);
if ((response.headers.get("content-type") || "").includes("json")) {
throw new Error(JSON.stringify(await response.json()));
}
const { writeFile } = await import("node:fs/promises");
await writeFile("result.bin", new Uint8Array(await response.arrayBuffer()));import os
import requests
parts = [
("pdf", ("contract.pdf", open("./contract.pdf", "rb"))),
]
response = requests.request("POST", "https://apick.app/rest/pdf_to_docx",
headers={"Authorization": "Bearer " + os.environ["APICK_API_KEY"]},
files=parts,
timeout=(10, 120), stream=True)
response.raise_for_status()
if "json" in response.headers.get("Content-Type", ""):
raise RuntimeError(response.json())
with open("result.bin", "wb") as output:
for chunk in response.iter_content(65536):
output.write(chunk)<?php
$headers = ["Authorization: Bearer " . getenv("APICK_API_KEY")];
$form = [
'pdf' => new CURLFile('./contract.pdf'),
];
$curl = curl_init('https://apick.app/rest/pdf_to_docx');
curl_setopt_array($curl, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => $headers,
CURLOPT_POSTFIELDS => $form,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CONNECTTIMEOUT => 10, CURLOPT_TIMEOUT => 120,
]);
$body = curl_exec($curl);
if ($body === false) { throw new RuntimeException(curl_error($curl)); }
$status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
$type = curl_getinfo($curl, CURLINFO_CONTENT_TYPE) ?: "";
curl_close($curl);
if ($status >= 400) { throw new RuntimeException($body); }
if (strpos($type, "json") !== false) { throw new RuntimeException($body); }
file_put_contents('result.bin', $body);Content-Type이 DOCX이면 output.docx로 저장합니다. JSON이면 data.error를 확인하세요.cost는 페이지 수 × 페이지당 요금입니다.수백 페이지 문서가 시간 초과되면 PDF를 장 단위로 나눠 여러 번 요청합니다.
/rest/pdf_to_docxcurl --fail-with-body --request POST 'https://apick.app/rest/pdf_to_docx' \
--header "Authorization: Bearer $APICK_API_KEY" \
--form 'pdf=@./report_part1.pdf' \
--dump-header response.headers --output result.bin
# response.headers의 Content-Type을 확인한 뒤 파일을 사용하세요.import { readFile } from "node:fs/promises";
const form = new FormData();
form.append("pdf", new Blob([await readFile("./report_part1.pdf")]), "report_part1.pdf");
const response = await fetch("https://apick.app/rest/pdf_to_docx", {
method: "POST",
headers: { Authorization: "Bearer " + process.env.APICK_API_KEY },
body: form,
signal: AbortSignal.timeout(120_000),
});
if (!response.ok) throw new Error(`HTTP ${response.status}: ${await response.text()}`);
if ((response.headers.get("content-type") || "").includes("json")) {
throw new Error(JSON.stringify(await response.json()));
}
const { writeFile } = await import("node:fs/promises");
await writeFile("result.bin", new Uint8Array(await response.arrayBuffer()));import os
import requests
parts = [
("pdf", ("report_part1.pdf", open("./report_part1.pdf", "rb"))),
]
response = requests.request("POST", "https://apick.app/rest/pdf_to_docx",
headers={"Authorization": "Bearer " + os.environ["APICK_API_KEY"]},
files=parts,
timeout=(10, 120), stream=True)
response.raise_for_status()
if "json" in response.headers.get("Content-Type", ""):
raise RuntimeError(response.json())
with open("result.bin", "wb") as output:
for chunk in response.iter_content(65536):
output.write(chunk)<?php
$headers = ["Authorization: Bearer " . getenv("APICK_API_KEY")];
$form = [
'pdf' => new CURLFile('./report_part1.pdf'),
];
$curl = curl_init('https://apick.app/rest/pdf_to_docx');
curl_setopt_array($curl, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => $headers,
CURLOPT_POSTFIELDS => $form,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CONNECTTIMEOUT => 10, CURLOPT_TIMEOUT => 120,
]);
$body = curl_exec($curl);
if ($body === false) { throw new RuntimeException(curl_error($curl)); }
$status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
$type = curl_getinfo($curl, CURLINFO_CONTENT_TYPE) ?: "";
curl_close($curl);
if ($status >= 400) { throw new RuntimeException($body); }
if (strpos($type, "json") !== false) { throw new RuntimeException($body); }
file_put_contents('result.bin', $body);data.success 3이면 시간 초과이며 과금되지 않습니다. 파일을 더 작게 나누세요.HTTP 성공과 업무 결과를 구분하세요. 경로별 응답 필드와 예시는 위 요청과 응답에 함께 있습니다.
성공하면 DOCX 본문이 바로 옵니다. 내려받기 파일명은 output.docx입니다.
1이면 변환에 성공한 것입니다.application/vnd.openxmlformats-officedocument.wordprocessingml.document응답을 아래 순서로 확인하세요. 결과 유무와 과금 여부는 서로 다릅니다.
실패하면 파일 대신 JSON이 옵니다. HTTP 상태와 Content-Type을 먼저 확인하고, JSON이면 data.error 문구를 기록하세요. 실패 응답의 api.cost는 0입니다.
pdf로 보냈는지 확인하세요.data.success가 3입니다. 페이지를 나눠 여러 번 요청하세요.FORM_DATA_INVALIDFORM_DATA_FIELD_CONFLICTMULTIPART_LIMIT_OR_PARSE_ERROR실제 차감 금액은 응답의 api.cost로 확인하세요. 상세 요금은 요금정책에서 볼 수 있습니다.
같은 요청을 JavaScript와 Python으로 옮긴 예시입니다. 키는 환경변수 APICK_API_KEY 에서 읽습니다.