API 요청
/rest/extract_video_thumbnail요청 파라미터 3개 · 필수 1
videowidth- 예시
480
count- 예시
10
응답 필드 파일
정상 응답은 파일 본문입니다. 실패 시 JSON 오류가 올 수 있으므로 HTTP 상태와 Content-Type을 먼저 확인하세요.
동영상 파일 한 개를 올리면 재생시간을 고르게 나눈 지점마다 장면을 JPEG 이미지로 뽑아 ZIP 파일 하나로 돌려줍니다. 응답은 JSON이 아닌 ZIP 파일입니다.
https://apick.app/rest/extract_video_thumbnail왜 동영상 미리보기 이미지 추출인가
썸네일 하나 고르려고 영상을 처음부터 끝까지 돌려보는 일은 편집자의 시간을 갉아먹습니다. 일정 구간마다 미리보기 이미지를 추출해 장면 탐색·썸네일 선택·검수를 한 번에 해결합니다.
REQUEST_TOO_LARGE 오류가 반환되며 과금되지 않습니다.
영상 목록의 대표 이미지 후보를 고르거나, 재생 바에 올렸을 때 보여 줄 미리보기 장면, 영상 내용 검수용 장면을 만들 때 사용합니다. MP4·MOV·AVI·WEBM·MKV 등 동영상 파일을 받습니다.
장면은 재생시간을 count개 구간으로 나눈 간격마다 한 장씩 뽑습니다. 간격은 최소 1초이므로 짧은 영상은 요청한 개수보다 적게 나올 수 있습니다(예: 30초 영상은 최대 약 29장).
요금은 영상 재생시간 60초당 10P이며 60초 미만은 올림합니다. 뽑는 장수와 관계없습니다. 실패·시간 초과 응답은 과금되지 않습니다.
/rest/extract_video_thumbnailvideowidth480count10정상 응답은 파일 본문입니다. 실패 시 JSON 오류가 올 수 있으므로 HTTP 상태와 Content-Type을 먼저 확인하세요.
POST https://apick.app/rest/extract_video_thumbnailAuthorization: Bearer 내 계정의 API 인증키multipart/form-data상황별로 보내는 값과 응답에서 확인할 값을 모았습니다. 언어 탭에서 그대로 복사해 쓸 수 있습니다.
영상 목록의 대표 이미지를 고르기 위해 고르게 나눈 지점에서 10장을 뽑습니다.
/rest/extract_video_thumbnailcurl --fail-with-body --request POST 'https://apick.app/rest/extract_video_thumbnail' \
--header "Authorization: Bearer $APICK_API_KEY" \
--form 'video=@./clip.mp4' \
--form-string 'width=480' \
--form-string 'count=10' \
--dump-header response.headers --output result.zip
# response.headers의 Content-Type을 확인한 뒤 파일을 사용하세요.import { readFile } from "node:fs/promises";
const form = new FormData();
form.append("video", new Blob([await readFile("./clip.mp4")]), "clip.mp4");
form.append("width", "480");
form.append("count", "10");
const response = await fetch("https://apick.app/rest/extract_video_thumbnail", {
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.zip", new Uint8Array(await response.arrayBuffer()));import os
import requests
parts = [
("video", ("clip.mp4", open("./clip.mp4", "rb"))),
("width", (None, "480")),
("count", (None, "10")),
]
response = requests.request("POST", "https://apick.app/rest/extract_video_thumbnail",
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.zip", "wb") as output:
for chunk in response.iter_content(65536):
output.write(chunk)<?php
$headers = ["Authorization: Bearer " . getenv("APICK_API_KEY")];
$form = [
'video' => new CURLFile('./clip.mp4'),
'width' => '480',
'count' => '10',
];
$curl = curl_init('https://apick.app/rest/extract_video_thumbnail');
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.zip', $body);output.1.jpg … 번호가 재생 순서입니다.video_duration(초) ÷ count가 대략의 장면 간격입니다.상세 화면용 큰 이미지가 필요하면 width를 늘립니다. 원본보다 크게 늘리지는 않습니다.
/rest/extract_video_thumbnailcurl --fail-with-body --request POST 'https://apick.app/rest/extract_video_thumbnail' \
--header "Authorization: Bearer $APICK_API_KEY" \
--form 'video=@./clip.mp4' \
--form-string 'width=1280' \
--form-string 'count=20' \
--dump-header response.headers --output result.zip
# response.headers의 Content-Type을 확인한 뒤 파일을 사용하세요.import { readFile } from "node:fs/promises";
const form = new FormData();
form.append("video", new Blob([await readFile("./clip.mp4")]), "clip.mp4");
form.append("width", "1280");
form.append("count", "20");
const response = await fetch("https://apick.app/rest/extract_video_thumbnail", {
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.zip", new Uint8Array(await response.arrayBuffer()));import os
import requests
parts = [
("video", ("clip.mp4", open("./clip.mp4", "rb"))),
("width", (None, "1280")),
("count", (None, "20")),
]
response = requests.request("POST", "https://apick.app/rest/extract_video_thumbnail",
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.zip", "wb") as output:
for chunk in response.iter_content(65536):
output.write(chunk)<?php
$headers = ["Authorization: Bearer " . getenv("APICK_API_KEY")];
$form = [
'video' => new CURLFile('./clip.mp4'),
'width' => '1280',
'count' => '20',
];
$curl = curl_init('https://apick.app/rest/extract_video_thumbnail');
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.zip', $body);width·count가 범위를 벗어나면 기본값(480, 100)으로 처리됩니다.HTTP 성공과 업무 결과를 구분하세요. 경로별 응답 필드와 예시는 위 요청과 응답에 함께 있습니다.
성공하면 ZIP 본문이 바로 옵니다. 내려받기 파일명은 output.zip이며, 안에는 재생 순서대로 output.1.jpg, output.2.jpg … 가 들어 있습니다.
1이면 추출에 성공한 것입니다.count초입니다.application/zip응답을 아래 순서로 확인하세요. 결과 유무와 과금 여부는 서로 다릅니다.
실패하면 ZIP 대신 JSON이 옵니다. HTTP 상태와 Content-Type을 먼저 확인하고, JSON이면 data.error 문구를 기록하세요. 실패 응답의 api.cost는 0입니다.
video로 보냈는지 확인하세요.data.success가 3입니다. count를 줄이거나 영상을 나눠 요청하세요.FORM_DATA_INVALIDFORM_DATA_FIELD_CONFLICTMULTIPART_LIMIT_OR_PARSE_ERROR실제 차감 금액은 응답의 api.cost로 확인하세요. 상세 요금은 요금정책에서 볼 수 있습니다.
같은 요청을 JavaScript와 Python으로 옮긴 예시입니다. 키는 환경변수 APICK_API_KEY 에서 읽습니다.