# 유튜브 계정 정보 수집



유튜브에 계정 정보와 최신 게시한 동영상 정보를 수집합니다.



인증: Authorization: Bearer $APICK_API_KEY

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

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



## POST /rest/crawl_youtube 응답 필드

- `data` (object): 조회 데이터

- `data.type` (integer): 요청 타입(12, 고정)

- `data.result` (integer): 조회 결과1: 성공

- `data.user` (object): 사용자(채널) 정보

- `data.user.id` (string): 요청한 사용자(채널) 아이디

- `data.user.channel_id` (string): 채널 ID(UC로 시작)

- `data.user.name` (string): 채널 이름

- `data.user.handle` (string): 채널 핸들(@이름). 없으면 null null 허용.

- `data.user.link` (string): 채널 URL

- `data.user.subscribe` (string): 구독자 수(읽기 쉬운 표기, 예: 1660만명). 비공개면 null null 허용.

- `data.user.subscriber_count` (integer): 구독자 수(숫자). 비공개면 null null 허용.

- `data.user.description` (string): 채널 설명

- `data.user.is_verified` (boolean): 인증 배지 여부

- `data.user.thumbnail` (string): 채널 프로필 이미지 URL

- `data.user.posts` (array): 최근 업로드 영상 목록(최대 60개, 최신순)

- `data.user.posts[].video_id` (string): 영상 ID

- `data.user.posts[].thumbnail_link` (string): 영상 URL

- `data.user.posts[].contents` (string): 영상 제목

- `data.user.posts[].view_count` (string): 조회수. 확인되지 않으면 null null 허용.

- `data.user.posts[].duration` (integer): 영상 길이(초). 확인되지 않으면 null null 허용.

- `data.user.posts[].thumbnail` (string): 썸네일 이미지 URL

- `data.success` (integer): 과금 여부0: 실패1: 성공

- `api` (object): API 호출 공통 데이터

- `api.success` (boolean): API 서버 정상 응답 여부

- `api.cost` (integer): API 호출 요금

- `api.ms` (integer): API 응답 시간

- `api.pl_id` (integer): API 결제 로그 ID

## API 요청: POST /rest/crawl_youtube



### 입력

- `user_id` (string, 필수): 수집할 유튜브 채널 아이디(예: CNN)·핸들(@CNN)·채널 ID(UC…) 또는 채널 URL



### 응답 명세

```json

{
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "type": {
          "type": "integer",
          "description": "요청 타입(12, 고정)"
        },
        "result": {
          "type": "integer",
          "description": "조회 결과1: 성공"
        },
        "user": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "description": "요청한 사용자(채널) 아이디"
            },
            "channel_id": {
              "type": "string",
              "description": "채널 ID(UC로 시작)"
            },
            "name": {
              "type": "string",
              "description": "채널 이름"
            },
            "handle": {
              "type": "string",
              "description": "채널 핸들(@이름). 없으면 null",
              "nullable": true
            },
            "link": {
              "type": "string",
              "description": "채널 URL"
            },
            "subscribe": {
              "type": "string",
              "description": "구독자 수(읽기 쉬운 표기, 예: 1660만명). 비공개면 null",
              "nullable": true
            },
            "subscriber_count": {
              "type": "integer",
              "description": "구독자 수(숫자). 비공개면 null",
              "nullable": true
            },
            "description": {
              "type": "string",
              "description": "채널 설명"
            },
            "is_verified": {
              "type": "boolean",
              "description": "인증 배지 여부"
            },
            "thumbnail": {
              "type": "string",
              "description": "채널 프로필 이미지 URL"
            },
            "posts": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "video_id": {
                    "type": "string",
                    "description": "영상 ID"
                  },
                  "thumbnail_link": {
                    "type": "string",
                    "description": "영상 URL"
                  },
                  "contents": {
                    "type": "string",
                    "description": "영상 제목"
                  },
                  "view_count": {
                    "type": "string",
                    "description": "조회수. 확인되지 않으면 null",
                    "nullable": true
                  },
                  "duration": {
                    "type": "integer",
                    "description": "영상 길이(초). 확인되지 않으면 null",
                    "nullable": true
                  },
                  "thumbnail": {
                    "type": "string",
                    "description": "썸네일 이미지 URL"
                  }
                }
              },
              "description": "최근 업로드 영상 목록(최대 60개, 최신순)"
            }
          },
          "description": "사용자(채널) 정보"
        },
        "success": {
          "type": "integer",
          "description": "과금 여부0: 실패1: 성공"
        }
      },
      "description": "조회 데이터"
    },
    "api": {
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean",
          "description": "API 서버 정상 응답 여부"
        },
        "cost": {
          "type": "integer",
          "description": "API 호출 요금"
        },
        "ms": {
          "type": "integer",
          "description": "API 응답 시간"
        },
        "pl_id": {
          "type": "integer",
          "description": "API 결제 로그 ID"
        }
      },
      "description": "API 호출 공통 데이터"
    }
  }
}

```

### 정적 응답 예시

```json

{
  "data": {
    "type": 12,
    "result": 1,
    "user": {
      "id": "CNN",
      "channel_id": "UCupvZG-5ko_eiXAupbDfxWw",
      "name": "CNN",
      "handle": "@CNN",
      "link": "https://www.youtube.com/@CNN",
      "subscribe": "1840만명",
      "subscriber_count": 18400000,
      "description": "CNN is the world leader in news and information and seeks to inform, engage and empower the world.",
      "is_verified": true,
      "thumbnail": "https://yt3.googleusercontent.com/...",
      "posts": [
        {
          "video_id": "obAFI1Anj90",
          "thumbnail_link": "https://www.youtube.com/watch?v=obAFI1Anj90",
          "contents": "Watch CNN's live coverage",
          "view_count": "4031",
          "duration": 512,
          "thumbnail": "https://i.ytimg.com/vi/obAFI1Anj90/hqdefault.jpg"
        }
      ]
    },
    "success": 1
  },
  "api": {
    "success": true,
    "cost": 40,
    "ms": 3120,
    "pl_id": 9697516
  }
}

```

### curl

```curl

curl --fail-with-body --request POST 'https://apick.app/rest/crawl_youtube' \
  --header "Authorization: Bearer $APICK_API_KEY" \
  --form-string 'user_id=CNN'

```

### Node.js (서버 ESM)

```javascript

const form = new FormData();
form.append("user_id", "CNN");
const response = await fetch("https://apick.app/rest/crawl_youtube", {
  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()}`);
const result = await response.json();
console.log(result);

```

### python

```python

import os
import requests
parts = [
    ("user_id", (None, "CNN")),
]
response = requests.request("POST", "https://apick.app/rest/crawl_youtube",
    headers={"Authorization": "Bearer " + os.environ["APICK_API_KEY"]},
    files=parts,
    timeout=(10, 120))
response.raise_for_status()
result = response.json()
print(result)

```

### php

```php

<?php
$headers = ["Authorization: Bearer " . getenv("APICK_API_KEY")];
$form = [
    'user_id' => 'CNN',
];
$curl = curl_init('https://apick.app/rest/crawl_youtube');
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);
curl_close($curl);
if ($status >= 400) { throw new RuntimeException($body); }
$result = json_decode($body, true, 512, JSON_THROW_ON_ERROR);
print_r($result);

```

## 코드·오류

## 상세 기능·요금

Method URL POST https://apick.app/rest/crawl_youtube

## 상세 요청

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

## 상세 응답

Body 이름 타입 설명 data Object 조회 데이터 type Integer 요청 타입(12, 고정) result Integer 조회 결과1: 성공 user Object 사용자(채널) 정보 id String 요청한 사용자(채널) 아이디 channel_id String 채널 ID(UC로 시작) name String 채널 이름 handle String 채널 핸들(@이름). 없으면 null link String 채널 URL subscribe String 구독자 수(읽기 쉬운 표기, 예: 1660만명). 비공개면 null subscriber_count Integer 구독자 수(숫자). 비공개면 null description String 채널 설명 is_verified Boolean 인증 배지 여부 thumbnail String 채널 프로필 이미지 URL posts Array 최근 업로드 영상 목록(최대 60개, 최신순) {} Object 영상 정보 video_id String 영상 ID thumbnail_link String 영상 URL contents String 영상 제목 view_count String 조회수. 확인되지 않으면 null duration Integer 영상 길이(초). 확인되지 않으면 null thumbnail String 썸네일 이미지 URL success Integer 과금 여부0: 실패1: 성공 api Object API 호출 공통 데이터 success Boolean API 서버 정상 응답 여부 cost Integer API 호출 요금 ms Integer API 응답 시간 pl_id Integer API 결제 로그 ID

## 상세 예제

요청 예시 form-data 전체 예제 보기 응답 예시 { "data": { "type": 12, "result": 1, "user": { "id": "CNN", "channel_id": "UCupvZG-5ko_eiXAupbDfxWw", "name": "CNN", "handle": "@CNN", "link": "https://www.youtube.com/@CNN", "subscribe": "1840만명", "subscriber_count": 18400000, "description": "CNN is the world leader in news and information and seeks to inform, engage and empower the world.", "is_verified": true, "thumbnail": "https://yt3.googleusercontent.com/...", "posts": [ { "video_id": "obAFI1Anj90", "thumbnail_link": "https://www.youtube.com/watch?v=obAFI1Anj90", "contents": "Watch CNN's live coverage", "view_count": "4031", "duration": 512, "thumbnail": "https://i.ytimg.com/vi/obAFI1Anj90/hqdefault.jpg" } ] }, "success": 1 }, "api": { "success": true, "cost": 40, "ms": 3120, "pl_id": 9697516 } }
