# 동영상 미리보기 이미지 추출



동영상에서 일정 구간마다 미리보기 이미지를 추출합니다.



인증: Authorization: Bearer $APICK_API_KEY

본문 있는 REST 요청: multipart/form-data. GET 본문 및 MCP JSON-RPC 규격은 해당 명세를 따릅니다.

인증키는 서버에 보관하세요. 모든 예제는 정적 자료입니다.



## POST /rest/extract_video_thumbnail 응답 필드

## API 요청: POST /rest/extract_video_thumbnail



### 입력

- `video` (file, 필수): 동영상 파일

- `width` (string, 선택): 이미지 가로 길이 (범위: 100 ~ 2000, 기본값 480). 세로 길이는 가로 비율에 따라 자동 계산

- `count` (string, 선택): 추출할 이미지 개수 (범위: 0 ~ 200, 기본값 100)



### 응답 명세

```json

{
  "type": "string",
  "format": "binary"
}

```

### curl

```curl

curl --fail-with-body --request POST 'https://apick.app/rest/extract_video_thumbnail' \
  --header "Authorization: Bearer $APICK_API_KEY" \
  --form 'video=@/C:/Users/user/Desktop/sample_video.mp4' \
  --form-string 'width=1920' \
  --form-string 'count=36' \
  --dump-header response.headers --output result.zip
# response.headers의 Content-Type을 확인한 뒤 파일을 사용하세요.

```

### Node.js (서버 ESM)

```javascript

import { readFile } from "node:fs/promises";
const form = new FormData();
form.append("video", new Blob([await readFile("/C:/Users/user/Desktop/sample_video.mp4")]), "sample_video.mp4");
form.append("width", "1920");
form.append("count", "36");
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()));

```

### python

```python

import os
import requests
parts = [
    ("video", ("sample_video.mp4", open("/C:/Users/user/Desktop/sample_video.mp4", "rb"))),
    ("width", (None, "1920")),
    ("count", (None, "36")),
]
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

```php

<?php
$headers = ["Authorization: Bearer " . getenv("APICK_API_KEY")];
$form = [
    'video' => new CURLFile('/C:/Users/user/Desktop/sample_video.mp4'),
    'width' => '1920',
    'count' => '36',
];
$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);

```

## 코드·오류

## 상세 기능·요금

업로드 용량 제한: 1GB multipart/form-data 요청에 포함된 첨부파일 합계는 최대 1GB입니다. 처리시간은 재생시간, 페이지 수와 파일 형식에 따라 늘어날 수 있습니다. 제한을 초과하면 HTTP 413과 REQUEST_TOO_LARGE 오류가 반환되며 과금되지 않습니다. 추출할 썸네일 개수를 최대 200개까지 지정이 가능하며, 재생시간(초)보다 추출할 이미지 개수가 많은 경우 1초당 1개씩 재생시간(초) 만큼 추출됩니다. 추출된 이미지 파일은 압축파일(.zip)로 압축됩니다. Method URL POST https://apick.app/rest/extract_video_thumbnail

## 상세 요청

Header 이름 필수 설명 Authorization O Bearer 인증키

## 상세 응답

Header 이름 필수 설명 success O API 서버 정상 응답 여부 cost O API 호출 요금 ms O API 응답 시간 Content-Type O 응답 바디 데이터 타입 Content-Disposition O 파일명(output 고정) Body 이름 타입 설명 zip 형식의 바이너리 데이터

## 상세 예제

요청 예시 form-data 전체 예제 보기 응답 예시 {zip 형식의 바이너리 데이터}
