apick-api 4.3.0 → 4.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/index.d.ts CHANGED
@@ -1,890 +1,872 @@
1
- export interface ApickClientOptions {
2
- apiKey: string;
3
- baseUrl?: string;
4
- timeoutMs?: number;
5
- /** Requests with a body use native FormData; GET requests have no body. */
6
- fetch?: typeof fetch;
7
- }
8
-
9
- export interface ApickMeta {
10
- readonly cost: number | null;
11
- readonly durationMs: number | null;
12
- }
13
-
14
- export interface ApickResult<T = Record<string, unknown>> {
15
- readonly data: T;
16
- readonly meta: ApickMeta;
17
- }
18
-
19
- export interface SearchList<T> {
20
- readonly keyword: string;
21
- readonly page?: number;
22
- readonly count: number;
23
- readonly items: readonly T[];
24
- }
25
-
26
- export interface NewsItem {
27
- readonly rank: number;
28
- readonly title: string;
29
- readonly link: string;
30
- readonly source: string;
31
- readonly published: string;
32
- readonly description: string;
33
- readonly image_url: string;
34
- }
35
-
36
- export interface ShoppingItem {
37
- readonly rank: number;
38
- readonly title: string;
39
- readonly price: string;
40
- readonly old_price: string;
41
- readonly shop: string;
42
- readonly rating: number | null;
43
- readonly reviews: number | null;
44
- readonly link: string;
45
- readonly image_url: string;
46
- }
47
-
48
- export interface PlaceItem {
49
- readonly rank: number;
50
- readonly name: string;
51
- readonly address: string;
52
- readonly phone: string;
53
- readonly categories: readonly string[];
54
- readonly rating: number | null;
55
- readonly reviews: number | null;
56
- readonly price_range: string;
57
- readonly open_status: string;
58
- readonly open_hours: Readonly<Record<string, string>>;
59
- readonly website: string;
60
- readonly latitude: number | null;
61
- readonly longitude: number | null;
62
- readonly place_id: string;
63
- readonly map_link: string;
64
- readonly thumbnail: string;
65
- }
66
-
67
- export interface RankCheck {
68
- readonly keyword: string;
69
- readonly domain: string;
70
- readonly found: boolean;
71
- readonly rank: number | null;
72
- readonly matches: readonly { readonly rank: number; readonly title: string; readonly link: string }[];
73
- readonly checked_results: number;
74
- /** 확인한 10위 구간 수(최대 10). */
75
- readonly checked_pages: number;
76
- /** 1~100위를 모두 확인했거나 앞에서부터 끊김 없이 확인한 구간에서 찾았으면 true. false 면 확인한 구간 비율만큼만 과금된다. */
77
- readonly complete: boolean;
78
- /** 확인하지 못한 순위 구간(예: "41-50"). */
79
- readonly unchecked_ranks: readonly string[];
80
- }
81
-
82
- export interface AmazonProduct {
83
- readonly asin: string;
84
- readonly url: string;
85
- readonly title: string;
86
- readonly brand: string;
87
- readonly price: number | null;
88
- readonly original_price: number | null;
89
- readonly currency: string;
90
- readonly rating: number | null;
91
- readonly reviews_count: number | null;
92
- readonly availability: string;
93
- readonly is_available: boolean;
94
- readonly bought_past_month: number | null;
95
- readonly seller_name: string;
96
- readonly categories: readonly string[];
97
- readonly features: readonly string[];
98
- readonly customers_say: string;
99
- readonly image_url: string;
100
- readonly image_urls: readonly string[];
101
- readonly date_first_available: string;
102
- readonly model_number: string;
103
- }
104
-
105
- export interface XPostSummary {
106
- readonly post_id: string;
107
- readonly url: string;
108
- readonly text: string;
109
- readonly posted_at: string;
110
- readonly likes: number | null;
111
- readonly reposts: number | null;
112
- readonly replies: number | null;
113
- readonly views: number | null;
114
- readonly hashtags: readonly string[];
115
- }
116
-
117
- export interface XProfile {
118
- readonly username: string;
119
- readonly name: string;
120
- readonly biography: string;
121
- readonly followers: number | null;
122
- readonly following: number | null;
123
- readonly posts_count: number | null;
124
- readonly is_verified: boolean;
125
- readonly is_business_account: boolean;
126
- readonly is_government_account: boolean;
127
- readonly location: string;
128
- readonly website: string;
129
- readonly joined_at: string;
130
- readonly profile_image_url: string;
131
- readonly banner_image_url: string;
132
- readonly profile_url: string;
133
- readonly recent_posts: readonly XPostSummary[];
134
- }
135
-
136
- export interface XPost {
137
- readonly post_id: string;
138
- readonly url: string;
139
- readonly username: string;
140
- readonly name: string;
141
- readonly text: string;
142
- readonly posted_at: string;
143
- readonly likes: number | null;
144
- readonly reposts: number | null;
145
- readonly replies: number | null;
146
- readonly quotes: number | null;
147
- readonly views: number | null;
148
- readonly bookmarks: number | null;
149
- readonly hashtags: readonly string[];
150
- readonly is_repost: boolean;
151
- readonly photo_urls: readonly string[];
152
- readonly video_urls: readonly string[];
153
- readonly author: { readonly followers: number | null; readonly is_verified: boolean };
154
- }
155
-
156
- export interface TiktokVideo {
157
- readonly video_id: string;
158
- readonly url: string;
159
- readonly username: string;
160
- readonly description: string;
161
- readonly posted_at: string;
162
- readonly views: number | null;
163
- readonly likes: number | null;
164
- readonly comments: number | null;
165
- readonly shares: number | null;
166
- readonly saves: number | null;
167
- readonly duration_sec: number | null;
168
- readonly hashtags: readonly string[];
169
- readonly region: string;
170
- readonly cover_image_url: string;
171
- readonly author: { readonly followers: number | null; readonly is_verified: boolean };
172
- }
173
-
174
- /** 댓글 작성자는 공개 사용자명만 제공한다. */
175
- export interface SocialComment {
176
- readonly comment_id: string;
177
- readonly username: string;
178
- readonly text: string;
179
- readonly posted_at: string;
180
- readonly likes: number | null;
181
- readonly replies: number | null;
182
- }
183
-
184
- export interface AmazonReview {
185
- readonly review_id: string;
186
- readonly rating: number | null;
187
- readonly title: string;
188
- readonly text: string;
189
- readonly author: string;
190
- readonly posted_at: string;
191
- readonly country: string;
192
- readonly is_verified_purchase: boolean;
193
- readonly helpful_count: number | null;
194
- readonly variant: string;
195
- }
196
-
197
- export interface GoogleMapsPlace {
198
- readonly name: string;
199
- readonly category: string;
200
- readonly categories: readonly string[];
201
- readonly address: string;
202
- readonly country_code: string;
203
- readonly phone: string;
204
- readonly website: string;
205
- readonly description: string;
206
- readonly rating: number | null;
207
- readonly reviews_count: number | null;
208
- /** 별점별 리뷰 수. */
209
- readonly rating_distribution: Readonly<Record<"1" | "2" | "3" | "4" | "5", number | null>>;
210
- /** 대표 리뷰(최대 10건). 작성자는 공개 표시 이름만. */
211
- readonly top_reviews: readonly { readonly reviewer_name: string; readonly rating: number | null; readonly posted_at: string; readonly text: string }[];
212
- readonly open_hours: Readonly<Record<string, string>>;
213
- /** day: 1=월 … 7=일 */
214
- readonly popular_times: readonly { readonly day: number | null; readonly hours: readonly { readonly hour: string; readonly busy_percent: number | null }[] }[];
215
- readonly similar_places: readonly { readonly name: string; readonly category: string; readonly rating: number | null; readonly reviews_count: number | null }[];
216
- readonly photo_urls: readonly string[];
217
- readonly main_image_url: string;
218
- readonly is_claimed: boolean;
219
- readonly permanently_closed: boolean;
220
- readonly temporarily_closed: boolean;
221
- readonly latitude: number | null;
222
- readonly longitude: number | null;
223
- readonly place_id: string;
224
- readonly map_url: string;
225
- }
226
-
227
- export type ScrapeJobProduct = "instagram_posts" | "instagram_comments" | "tiktok_search" | "tiktok_video" | "tiktok_comments" | "amazon_reviews" | "google_maps_place";
228
-
229
- export interface ScrapeJobOptions {
230
- /** 최대 결과 수. 이 수 × 단가를 예약하고 실제 결과 건수만 차감한다(instagram_comments 15, tiktok_search 50, 그 밖 100). */
231
- readonly maxResults?: number;
232
- /** 응답을 못 받아 다시 보낼 때 같은 접수로 처리할 키(8~128자). */
233
- readonly idempotencyKey?: string;
234
- }
235
-
236
- export interface ScrapeJob<T = unknown> {
237
- readonly job_id: string;
238
- readonly product: ScrapeJobProduct;
239
- readonly status: "waiting" | "processing" | "completed" | "failed";
240
- readonly max_results: number;
241
- readonly unit_point: number;
242
- readonly reserved_point: number;
243
- readonly charged_point: number;
244
- readonly result_count: number;
245
- readonly created_at: string;
246
- readonly completed_at: string | null;
247
- /** 결과 보관 기한(완료 후 72시간). */
248
- readonly result_expires_at?: string;
249
- readonly result_expired?: boolean;
250
- readonly items?: readonly T[];
251
- readonly error?: { readonly code: string; readonly message: string };
252
- }
253
-
254
- export interface InstagramProfile {
255
- readonly username: string;
256
- readonly full_name: string;
257
- readonly biography: string;
258
- readonly followers: number | null;
259
- readonly following: number | null;
260
- readonly posts_count: number | null;
261
- readonly is_verified: boolean;
262
- readonly is_private: boolean;
263
- readonly external_urls: readonly string[];
264
- readonly highlights_count: number | null;
265
- readonly profile_image_url: string;
266
- readonly profile_url: string;
267
- readonly recent_posts: readonly { readonly url: string; readonly content_type: string; readonly caption: string; readonly posted_at: string; readonly image_url: string; readonly hashtags: readonly string[] }[];
268
- }
269
-
270
- export interface InstagramPost {
271
- readonly url: string;
272
- readonly shortcode: string;
273
- readonly username: string;
274
- readonly caption: string;
275
- readonly content_type: string;
276
- readonly posted_at: string;
277
- readonly likes: number | null;
278
- readonly comments: number | null;
279
- readonly views: number | null;
280
- readonly duration_sec: number | null;
281
- readonly hashtags: readonly string[];
282
- readonly is_paid_partnership: boolean;
283
- readonly coauthors: readonly string[];
284
- readonly thumbnail_url: string;
285
- readonly image_urls: readonly string[];
286
- readonly video_url: string;
287
- readonly author: { readonly followers: number | null; readonly is_verified: boolean; readonly profile_url: string };
288
- }
289
-
290
- export interface TiktokProfile {
291
- readonly username: string;
292
- readonly nickname: string;
293
- readonly biography: string;
294
- readonly followers: number | null;
295
- readonly following: number | null;
296
- readonly likes: number | null;
297
- readonly videos_count: number | null;
298
- readonly is_verified: boolean;
299
- readonly is_private: boolean;
300
- readonly bio_link: string;
301
- readonly engagement_rate: number | null;
302
- readonly created_at: string;
303
- readonly profile_image_url: string;
304
- readonly profile_url: string;
305
- readonly recent_videos: readonly { readonly video_id: string; readonly url: string; readonly views: number | null; readonly likes: number | null; readonly comments: number | null; readonly shares: number | null; readonly posted_at: string; readonly cover_image_url: string }[];
306
- }
307
-
308
- export interface BinaryInput {
309
- readonly size?: number;
310
- readonly type?: string;
311
- readonly name?: string;
312
- arrayBuffer(): Promise<ArrayBuffer>;
313
- }
314
-
315
- export interface OcrOptions {
316
- filename?: string;
317
- contentType?: 'image/png' | 'image/jpeg';
318
- }
319
-
320
- export type ImageAiFormat = 'png' | 'jpeg' | 'webp';
321
- export type ImageAiBackground = 'auto' | 'opaque' | 'transparent';
322
- export type ImageAiSize = '1024x1024' | '1536x1024' | '1024x1536' | '1152x864' | '864x1152';
323
- /** basic 40P(default) · advanced 350P · premium 1,400P per image */
324
- export type ImageAiQuality = 'basic' | 'advanced' | 'premium';
325
- export type ImageAiStatus = 'waiting' | 'processing' | 'completed' | 'completed_partial' | 'failed';
326
- export type ApickImageErrorCode = `APICK_IMAGE_${string}`;
327
- export interface ImageAiOptions { imageCount?: number; size?: ImageAiSize; outputFormat?: ImageAiFormat; background?: ImageAiBackground; quality?: ImageAiQuality;
328
- /** @deprecated Ignored. Every image request is generated and charged as a new request. */
329
- idempotencyKey?: string; }
330
- export interface ImageAiGenerateOptions extends ImageAiOptions { referenceImage?: string|BinaryInput|ArrayBuffer|ArrayBufferView; referenceFilename?: string; referenceContentType?: 'image/png'|'image/jpeg'|'image/webp'; }
331
- export interface ImageAiEditOptions extends ImageAiOptions { filename?: string; contentType?: 'image/png'|'image/jpeg'|'image/webp'; }
332
- export interface ImageAiResultImage { index:number; b64_json:string; mime_type:'image/png'|'image/jpeg'|'image/webp'; width:number; height:number; }
333
- export interface ImageAiResultData { request_id:string; image_count:number; images:ImageAiResultImage[]; idempotent_replay?:boolean; }
334
- export interface ImageAiPendingData {request_id:string;job_id:string;status:'processing';billing_status:'pending';reserved_point:number;}
335
- export interface ImageAiJobData { job_id:string; status:ImageAiStatus; requested_count:number; completed_count?:number; failed_count?:number; prepaid_point?:number; charged_point?:number; refunded_point?:number; result_available?:boolean; expires_at?:string|null; error_code?:ApickImageErrorCode|null; }
336
-
337
- export interface MaskResidentNumberOptions extends OcrOptions {
338
- type: 1 | 2 | 3 | 4;
339
- }
340
-
341
- export const AUTH_PROVIDERS: readonly [
342
- 'kakao', 'naver', 'toss', 'pass', 'samsung', 'kb', 'shinhan', 'hana', 'woori', 'ibk', 'nh', 'kakaobank', 'banksalad'
343
- ];
344
- export type AuthProvider = typeof AUTH_PROVIDERS[number];
345
-
346
- /** 간편인증 기반 조회 상품(재직·소득·연금·면허·건강검진 등)의 공통 입력. */
347
- export interface DataRequestInput {
348
- name: string;
349
- birthDate: string;
350
- phone: string;
351
- authProvider: AuthProvider;
352
- }
353
- export interface RequestEmploymentInput extends DataRequestInput { insuranceYears?: number; }
354
- export interface RequestPersonalIncomeInput extends DataRequestInput { incomeYears?: number; }
355
- export interface RequestNpsJoinHistoryInput extends DataRequestInput { from?: string; to?: string; }
356
- export interface RequestDrivingLicenseInput extends DataRequestInput {}
357
- export interface RequestHealthCheckupInput extends DataRequestInput {}
358
- export interface RequestCashReceiptDeductionInput extends DataRequestInput { incomeYears?: number; }
359
- export interface RequestTaxReturnHistoryInput extends DataRequestInput { years?: number; }
360
-
361
- export type DataRequestStatus =
362
- | 'AUTH_REQUESTED' | 'AUTH_WAITING' | 'AUTH_COMPLETED' | 'AUTH_REJECTED' | 'AUTH_EXPIRED'
363
- | 'COLLECTING' | 'COLLECTED' | 'PARTIAL_SUCCESS' | 'SUCCESS' | 'FAILED';
364
- export type DataRequestErrorCode = 'RESULT_EXPIRED' | 'AUTH_EXPIRED' | 'AUTH_REJECTED' | 'COLLECT_FAILED';
365
- export interface DataRequestSource { source: string; type: string; status: string; }
366
-
367
- /** `request*()` (POST /rest/req_*) 응답의 `data`. */
368
- export interface DataRequestAcceptedData {
369
- schemaVersion: string;
370
- transactionId: string;
371
- product: string;
372
- status: DataRequestStatus;
373
- resultAvailable: boolean;
374
- charged: boolean;
375
- sources: DataRequestSource[];
376
- message: string;
377
- expiresAt: string;
378
- success: number;
379
- approvals?: number;
380
- }
381
-
382
- /** `get*()` (POST /rest/get_*) 응답의 `data`. `result`는 결과가 있을 때만 온다. */
383
- export interface DataRequestResult<T> {
384
- schemaVersion: string;
385
- transactionId: string;
386
- product: string;
387
- status: DataRequestStatus;
388
- resultAvailable: boolean;
389
- charged: boolean;
390
- sources: DataRequestSource[];
391
- message: string;
392
- expiresAt?: string;
393
- success: number;
394
- progress?: { total: number; completed: number };
395
- checkedAt?: string;
396
- resultExpiresAt?: string;
397
- result?: T;
398
- errorCode?: DataRequestErrorCode;
399
- }
400
-
401
- export interface EmploymentHistoryEntry { 사업장: string; 취득일: string; 상실일: string; 자격구분: string; }
402
- export interface EmploymentPremiumEntry {
403
- 사업장: string; 고지년월: string; 보수월액: number;
404
- '건강보험 산정보험료': number; '건강보험 정산보험료': number; '건강보험 고지보험료': number; '건강보험 연말정산보험료': number;
405
- '장기요양 산정보험료': number; '장기요양 정산보험료': number; '장기요양 고지보험료': number; '장기요양 연말정산보험료': number;
406
- 가입자부담금: number;
407
- }
408
- export interface EmploymentInfo {
409
- 재직상태: 'EMPLOYED' | 'UNEMPLOYED' | 'UNKNOWN';
410
- 현재사업장?: string;
411
- 취득일?: string;
412
- 이력: EmploymentHistoryEntry[];
413
- 보험료연도: string[];
414
- 보험료: EmploymentPremiumEntry[];
415
- }
416
- export interface EmploymentResultPayload { employment: EmploymentInfo; }
417
-
418
- export interface PersonalIncomeAmount { 건수: number; 소득금액: number; 소득세: number; 지방소득세: number; 농어촌특별세: number; 세액합계: number; }
419
- export interface PersonalIncomeYear {
420
- 귀속연도: string;
421
- 소득종류별: { 이자소득?: PersonalIncomeAmount; 배당소득?: PersonalIncomeAmount };
422
- 합계: PersonalIncomeAmount;
423
- }
424
- export interface PersonalIncomeInfo { 조회연도: string[]; 연도별: PersonalIncomeYear[]; }
425
- export interface PersonalIncomeResultPayload { personalIncome: PersonalIncomeInfo; }
426
-
427
- export interface NpsJoinHistoryEntry {
428
- 시작: string; 종료: string; 기준소득월액: number;
429
- 납부개월: number; 납부금액: number; 미납개월: number; 미납금액: number;
430
- 가입자구분: string; 사업장: string;
431
- }
432
- export interface NpsJoinHistoryInfo {
433
- 조회기간: { 시작: string; 종료: string };
434
- 합계: { 납부개월: number; 납부금액: number; 미납개월: number; 미납금액: number };
435
- 가입내역: NpsJoinHistoryEntry[];
436
- }
437
- export interface NpsJoinHistoryResultPayload { npsJoinHistory: NpsJoinHistoryInfo; }
438
-
439
- export interface DrivingLicenseAcquisition {
440
- 면허종류코드: string; 발급일자: string; 합격일자: string; 발급지역: string; 발급일련번호: string;
441
- 학원명: string; 졸업일자: string; 공고시험장: string; 등록일자: string; 면허조건: string;
442
- }
443
- export interface DrivingLicenseInfo {
444
- 이름?: string; 주소?: string; 면허번호?: string; 관할경찰서?: string; 국적?: string; 면허상태?: string;
445
- 취소일자?: string; 적성검사일자?: string; 적성검사기관?: string; 적성검사유효기간?: string;
446
- 적성검사시작?: string; 적성검사종료?: string; 정지기간?: string; 정지사유?: string;
447
- 재교부일자?: string; 재교부사유?: string;
448
- subList?: unknown[];
449
- 취득이력?: DrivingLicenseAcquisition[];
450
- 조회결과?: string;
451
- }
452
- export interface DrivingLicenseResultPayload { drivingLicense: DrivingLicenseInfo; }
453
-
454
- export interface HealthCheckupEntry { 검진연도: string; 검진종류: string; 검진일자: string; 검진기관: string; }
455
- export interface HealthCheckupInfo { 이름: string; 건수: number; 검진내역: HealthCheckupEntry[]; }
456
- export interface HealthCheckupResultPayload { healthCheckup: HealthCheckupInfo; }
457
-
458
- export interface CashReceiptTotals { 건수: number; 사용금액: number; 소득공제건수: number; 소득공제금액: number; }
459
- export interface CashReceiptEntry {
460
- 거래일시: string; 가맹점: string; 금액: number; 승인번호: string;
461
- 거래구분: string; 거래상태: string; 소득공제대상: boolean; 소득공제반영: boolean;
462
- }
463
- export interface CashReceiptYear { 귀속연도: string; 합계: CashReceiptTotals; 사용내역: CashReceiptEntry[]; }
464
- export interface CashReceiptDeductionInfo { 조회연도: string[]; 전체합계: CashReceiptTotals; 연도별: CashReceiptYear[]; }
465
- export interface CashReceiptDeductionResultPayload { cashReceiptDeduction: CashReceiptDeductionInfo; }
466
-
467
- export interface TaxReturnEntry {
468
- 신고일: string; 과세기간: string; 신고서: string; 신고구분: string; 신고상세: string;
469
- 세목: string; 작성방법: string; 납부년월: string; 납부금액: number; 고지금액: number;
470
- }
471
- export interface TaxReturnHistoryInfo {
472
- 조회기간: { 시작: string; 끝: string };
473
- 합계: { 건수: number; 납부금액: number; 고지금액: number };
474
- 신고내역: TaxReturnEntry[];
475
- }
476
- export interface TaxReturnHistoryResultPayload { taxReturnHistory: TaxReturnHistoryInfo; }
477
-
478
- export interface YoutubeThumbnail { url: string; width: number; height: number; }
479
- export interface YoutubeChapter { title: string; start_time: number | null; end_time: number | null; }
480
- export interface YoutubeMetadata {
481
- video_id: string; url: string; title: string | null; description: string;
482
- channel: { id: string | null; name: string | null; url: string | null; handle: string | null; follower_count: number | null; is_verified: boolean };
483
- upload_date: string | null; duration: number | null; view_count: number | null; like_count: number | null; comment_count: number | null;
484
- categories: string[]; tags: string[]; language: string | null; live_status: string | null; availability: string | null;
485
- age_limit: number | null; chapters: YoutubeChapter[]; thumbnail: string | null; thumbnails: YoutubeThumbnail[];
486
- subtitle_languages: string[]; automatic_caption_count: number;
487
- }
488
- /** translated=true 인 자동 번역 자막은 유튜브 제한으로 받지 못할 수 있다. 수동 자막이나 원어 자동 자막을 권장한다. */
489
- export interface YoutubeSubtitleTrack { lang: string; name: string | null; auto: boolean; formats: string[]; translated?: boolean; }
490
- export interface YoutubeSubtitleList {
491
- video_id: string; title: string | null; original_language: string | null;
492
- subtitle_count: number; automatic_caption_count: number;
493
- subtitles: YoutubeSubtitleTrack[]; automatic_captions: YoutubeSubtitleTrack[];
494
- }
495
- export interface YoutubeSubtitleOptions { format?: 'vtt' | 'srt' | 'txt'; type?: 'any' | 'manual' | 'auto'; }
496
- export interface YoutubeChannelRef { id: string | null; name: string | null; url: string | null; handle: string | null; }
497
- export interface YoutubeListItem {
498
- type: 'video' | 'short' | 'channel' | 'playlist'; id: string; url: string; title: string | null; thumbnail: string | null;
499
- description?: string | null; duration?: number | null; view_count?: number | null; live_status?: string | null; published_at?: string | null;
500
- channel?: YoutubeChannelRef | null; handle?: string | null; follower_count?: number | null; is_verified?: boolean; video_count?: number | null;
501
- }
502
- export interface YoutubeSearchOptions {
503
- count?: number; sort?: 'relevance' | 'date' | 'views' | 'rating'; type?: 'any' | 'video' | 'channel' | 'playlist' | 'movie';
504
- uploadDate?: 'any' | 'hour' | 'today' | 'week' | 'month' | 'year'; duration?: 'any' | 'short' | 'medium' | 'long';
505
- }
506
- export interface YoutubeSearchResult { query: string; count: number; results: YoutubeListItem[]; }
507
- export interface YoutubeChannelResult {
508
- channel: YoutubeChannelRef & { description: string; follower_count: number | null; is_verified: boolean; tags: string[]; thumbnail: string | null };
509
- tab: 'videos' | 'shorts' | 'streams' | 'playlists'; count: number; items: YoutubeListItem[];
510
- }
511
- export interface YoutubePlaylistResult {
512
- playlist_id: string; url: string; title: string | null; description: string; channel: YoutubeChannelRef | null;
513
- video_count: number | null; view_count: number | null; modified_date: string | null; count: number; videos: YoutubeListItem[];
514
- }
515
- export interface YoutubeHashtagResult { hashtag: string; count: number; videos: YoutubeListItem[]; }
516
- export interface YoutubeVideoFormat { quality: string; width: number | null; height: number; fps: number | null; codec: string | null; hdr: boolean; has_audio: boolean; bitrate_kbps: number | null; filesize: number | null; filesize_estimated: boolean; }
517
- export interface YoutubeAudioFormat { codec: string | null; bitrate_kbps: number | null; sample_rate: number | null; channels: number | null; language: string | null; filesize: number | null; filesize_estimated: boolean; }
518
- export interface YoutubeFormats {
519
- video_id: string; title: string | null; duration: number | null; live_status: string | null; downloadable: boolean;
520
- video_formats: YoutubeVideoFormat[]; audio_formats: YoutubeAudioFormat[];
521
- download_options: { video: { quality: string; estimated_size: number; estimated_cost: number }[]; audio: { format: 'mp3' | 'm4a' | 'opus'; bitrate: number | null; estimated_size: number; estimated_cost: number }[] };
522
- }
523
- export interface YoutubeComment {
524
- id: string; parent_id: string | null; text: string; author: string | null; author_channel_id: string | null; author_url: string | null; author_thumbnail: string | null;
525
- author_is_uploader: boolean; author_is_verified: boolean; like_count: number | null; is_pinned: boolean; is_hearted: boolean; published_at: string | null;
526
- }
527
- export interface YoutubeComments { video_id: string; title: string | null; sort: 'top' | 'new'; include_replies: boolean; count: number; comments: YoutubeComment[]; }
528
- export interface YoutubeCommentsOptions { count?: number; sort?: 'top' | 'new'; replies?: boolean; }
529
- export interface YoutubeDownloadLink {
530
- video_id: string | null; title: string | null; duration: number | null; size: number; size_units: number; content_type: string; filename: string;
531
- download_url: string; expires_at: string; quality?: string | null; format?: 'mp3' | 'm4a' | 'opus'; bitrate?: number | null;
532
- billing: { base: number; size_unit_cost: number; size_cost: number; total: number };
533
- }
534
- export interface YoutubeVideoDownloadOptions { quality?: 'best' | '2160' | '1440' | '1080' | '720' | '480' | '360' | '240' | '144' | number; codec?: 'any' | 'h264'; start?: string | number; end?: string | number; }
535
- export interface YoutubeAudioDownloadOptions { format?: 'mp3' | 'm4a' | 'opus'; bitrate?: 128 | 192 | 320 | '128' | '192' | '320'; start?: string | number; end?: string | number; }
536
-
537
- /** @deprecated Retired APICK voice IDs. Query listGeminiTtsVoices or listOpenAiTtsVoices. */
538
- export const TTS_VOICE_IDS: readonly [
539
- 'v2_ann_m_30s_01', 'v2_ann_m_30s_02', 'v2_ann_m_30s_04', 'v2_ann_m_30s_05', 'v2_ann_f_30s_02', 'v2_ann_f_30s_03', 'v2_ann_f_30s_04', 'v2_ann_f_30s_05', 'v2_m_teen_01', 'v2_m_young_01', 'v2_m_mid_01', 'v2_m_senior_01', 'v2_f_young_01', 'v2_f_senior_01'
540
- ];
541
- export type TtsVoiceId = string;
542
- /** @deprecated Automatic fallback is no longer supported. */
543
- export type TtsFallbackPolicy = 'never' | 'queue_full' | 'busy';
544
- export interface TtsFallbackOptions { voice_id?: string; style?: string; }
545
- /** @deprecated Retired APICK request shape. Use GeminiTtsInput or OpenAiTtsInput. */
546
- export interface ApickTtsInput { voice_id: TtsVoiceId; text?: string; utterances?: Array<{text:string;emotion?:string;speed?:number;pause_after_ms?:number}>; normalize_text?:boolean; fallback_policy?:TtsFallbackPolicy; fallback_options?:TtsFallbackOptions; }
547
- export interface TtsStyleOptions { style?:string; emotion?:'neutral'|'calm'|'cheerful'|'excited'|'sad'|'serious'|'friendly'|'empathetic'|'confident'|'gentle'|'whisper'|'narration'; tone?:'narration'|'news'|'audiobook'|'documentary'|'ad'|'conversation'|'announcement'|'tutorial'|'storytelling'; accent?:'standard'|'seoul'|'gyeongsang'|'jeolla'|'chungcheong'; pace?:number; pitch?:number; volume_gain_db?:number; }
548
- export interface TtsSpeakerOptions extends TtsStyleOptions { voice_id?:string; }
549
- export interface TtsUtterance extends TtsSpeakerOptions { text:string; speaker?:string; }
550
- export interface GeminiTtsInput extends TtsStyleOptions { voice_id?:string; text?:string; utterances?:TtsUtterance[]; speakers?:Record<string,TtsSpeakerOptions>; multi_speaker?:boolean; normalize_text?:boolean; language_code?:'ko'|'ko-KR'; }
551
- export interface OpenAiTtsInput extends GeminiTtsInput {}
552
- export interface TtsOptions { voiceId?:TtsVoiceId; normalizeText?:boolean; idempotencyKey?:string; }
553
- export interface GeminiTtsVoice { voice_id:string; name:string; gender:string|null; tone:string; age_band:string|null; age_years?:number|null; age_verified?:boolean; age_basis?:'catalog_description'|'reviewed'; age_source?:string; description?:string; language_code?:string|null; reviewed_at?:string; library:string; }
554
- export interface TtsQuote { synthesis:number; normalization:number; estimated_total:number; maximum:number; synthesis_maximum:number; normalization_maximum:number; estimated_only:true; currency:'POINT'; fallback_price_may_change:boolean; }
555
-
556
- export interface TtsJobData {
557
- job_id: string;
558
- status: 'waiting' | 'processing' | 'completed' | 'cancelled' | 'failed';
559
- voice_id?: string;
560
- synthesis?: {engine:'apick'|'gemini'|'openai';model:string;voice_id:string;fallback_reason:string|null;age_verified:boolean;notice:string|null};
561
- normalization?: {enabled:boolean;run_id:string|null;status:string;skill_id:string|null};
562
- billing?: {status:string;synthesis:number;skill:number;total:number;reserved:number;refunded:number;released:number;currency:'POINT'};
563
- expires_at?:string|null;
564
- character_count?: number;
565
- result_available?: boolean;
566
- subtitles_available?: boolean;
567
- resume_revision?: number;
568
- operation_revision?: number;
569
- quality?: TtsQualityData | null;
570
- }
571
-
572
- export interface TtsQualityData {
573
- job_id?: string;
574
- resume_revision?: number;
575
- phase?: string;
576
- accepted_utterances?: number;
577
- failed_utterances?: number;
578
- total_utterances?: number;
579
- utterances?: Array<{ id: string; status: string; attempt?: number; reasons?: string[];
580
- speech_rate?: { chars: number; duration_sec: number; cps: number; expected_sec: number; duration_ratio: number | null; status: string } }>;
581
- candidates?: Array<{ candidate_id: string; utterance_id: string; status: string; attempt: number; audio_available?: boolean }>;
582
- }
583
-
584
- export class ApickApiError extends Error {
585
- readonly status: number;
586
- readonly code: string;
587
- readonly serviceCode?: string;
588
- /** Skills 오류의 부가 정보. 예: INVALID_INPUT 의 `errors` 목록 */
589
- readonly details?: Record<string, unknown>;
590
- toJSON(): {
591
- name: string;
592
- message: string;
593
- status: number;
594
- code: string;
595
- serviceCode?: string;
596
- };
597
- }
598
-
599
- export class ApickBinaryResult {
600
- readonly bytes: Uint8Array;
601
- readonly contentType: string;
602
- readonly filename: string;
603
- readonly meta: ApickMeta;
604
- readonly size: number;
605
- toArrayBuffer(): ArrayBuffer;
606
- toBlob(): Blob;
607
- save(filePath: string): Promise<string>;
608
- }
609
-
610
- export const DEFAULT_BASE_URL: 'https://apick.app';
611
-
612
- export const SERVICES: Readonly<Record<string, Readonly<{
613
- endpoint: string;
614
- output: 'json' | 'binary';
615
- }>>>;
616
-
617
- export class ApickClient {
618
- createVideoJob(model: VideoModel, prompt: string, options?: VideoJobOptions): Promise<ApickResult<VideoJobData>>;
619
- getVideoJob(model: VideoModel, jobId: string): Promise<ApickResult<VideoJobData>>;
620
- downloadVideoResult(model: VideoModel, jobId: string): Promise<ApickBinaryResult>;
621
- constructor(apiKeyOrOptions: string | ApickClientOptions);
622
- businessDetails(businessNumber: string): Promise<ApickResult>;
623
- ventureBusiness(businessNumber: string): Promise<ApickResult>;
624
- trackParcel(carrier: string, trackingNumber: string): Promise<ApickResult>;
625
- trackParcelAuto(trackingNumber: string): Promise<ApickResult>;
626
- validateEmail(email: string): Promise<ApickResult>;
627
- validatePhone(number: string): Promise<ApickResult>;
628
- holidays(year: number | string, month: number | string): Promise<ApickResult>;
629
- searchAddress(query: string, options?: { page?: number }): Promise<ApickResult>;
630
- ocr(image: string | BinaryInput | ArrayBuffer | ArrayBufferView, options?: OcrOptions): Promise<ApickResult>;
631
- maskResidentNumber(image: string | BinaryInput | ArrayBuffer | ArrayBufferView, options: MaskResidentNumberOptions): Promise<ApickBinaryResult>;
632
- maskResidenceCard(image: string | BinaryInput | ArrayBuffer | ArrayBufferView, options?: OcrOptions): Promise<ApickResult>;
633
- maskPassport(image: string | BinaryInput | ArrayBuffer | ArrayBufferView, options?: OcrOptions): Promise<ApickResult>;
634
- maskIdCard(image: string | BinaryInput | ArrayBuffer | ArrayBufferView, options?: OcrOptions): Promise<ApickResult>;
635
- maskDriverLicense(image: string | BinaryInput | ArrayBuffer | ArrayBufferView, options?: OcrOptions): Promise<ApickResult>;
636
- dnsLookup(domain: string): Promise<ApickResult>;
637
- geolocate(address: string): Promise<ApickResult>;
638
- whois(address: string): Promise<ApickResult>;
639
- googleSearch(keyword: string, options?: { page?: number }): Promise<ApickResult>;
640
- googleImageSearch(keyword: string, options?: { page?: number }): Promise<ApickResult>;
641
- googleNewsSearch(keyword: string, options?: { page?: number }): Promise<ApickResult<SearchList<NewsItem>>>;
642
- googleShoppingSearch(keyword: string, options?: { page?: number }): Promise<ApickResult<SearchList<ShoppingItem>>>;
643
- googleMapsSearch(keyword: string): Promise<ApickResult<SearchList<PlaceItem>>>;
644
- googleRankCheck(keyword: string, domain: string): Promise<ApickResult<RankCheck>>;
645
- instagramProfile(usernameOrUrl: string): Promise<ApickResult<InstagramProfile>>;
646
- instagramPost(url: string): Promise<ApickResult<InstagramPost>>;
647
- tiktokProfile(usernameOrUrl: string): Promise<ApickResult<TiktokProfile>>;
648
- amazonProduct(urlOrAsin: string): Promise<ApickResult<AmazonProduct>>;
649
- xProfile(usernameOrUrl: string): Promise<ApickResult<XProfile>>;
650
- xPost(url: string): Promise<ApickResult<XPost>>;
651
- createInstagramPostsJob(usernameOrUrl: string, options?: ScrapeJobOptions): Promise<ApickResult<ScrapeJob<InstagramPost>>>;
652
- createInstagramCommentsJob(url: string, options?: ScrapeJobOptions): Promise<ApickResult<ScrapeJob<SocialComment>>>;
653
- createTiktokSearchJob(keyword: string, options?: ScrapeJobOptions): Promise<ApickResult<ScrapeJob<TiktokVideo>>>;
654
- createTiktokVideoJob(url: string, options?: Pick<ScrapeJobOptions, "idempotencyKey">): Promise<ApickResult<ScrapeJob<TiktokVideo>>>;
655
- createTiktokCommentsJob(url: string, options?: ScrapeJobOptions): Promise<ApickResult<ScrapeJob<SocialComment>>>;
656
- createAmazonReviewsJob(urlOrAsin: string, options?: ScrapeJobOptions): Promise<ApickResult<ScrapeJob<AmazonReview>>>;
657
- createGoogleMapsPlaceJob(placeIdOrUrl: string, options?: Pick<ScrapeJobOptions, "idempotencyKey">): Promise<ApickResult<ScrapeJob<GoogleMapsPlace>>>;
658
- getScrapeJob<T = unknown>(jobId: string): Promise<ApickResult<ScrapeJob<T>>>;
659
- waitForScrapeJob<T = unknown>(jobId: string, options?: { intervalMs?: number; timeoutMs?: number }): Promise<ApickResult<ScrapeJob<T>>>;
660
- screenshot(url: string): Promise<ApickBinaryResult>;
661
- youtubeMetadata(url: string): Promise<ApickResult<YoutubeMetadata>>;
662
- youtubeThumbnail(url: string): Promise<ApickBinaryResult>;
663
- youtubeSubtitleList(url: string): Promise<ApickResult<YoutubeSubtitleList>>;
664
- youtubeSubtitle(url: string, lang: string, options?: YoutubeSubtitleOptions): Promise<ApickBinaryResult>;
665
- youtubeSearch(query: string, options?: YoutubeSearchOptions): Promise<ApickResult<YoutubeSearchResult>>;
666
- youtubeChannel(channel: string, options?: { tab?: 'videos' | 'shorts' | 'streams' | 'playlists'; count?: number }): Promise<ApickResult<YoutubeChannelResult>>;
667
- youtubePlaylist(url: string, options?: { count?: number }): Promise<ApickResult<YoutubePlaylistResult>>;
668
- youtubeHashtag(hashtag: string, options?: { count?: number }): Promise<ApickResult<YoutubeHashtagResult>>;
669
- youtubeFormats(url: string): Promise<ApickResult<YoutubeFormats>>;
670
- youtubeComments(url: string, options?: YoutubeCommentsOptions): Promise<ApickResult<YoutubeComments>>;
671
- downloadYoutubeVideo(url: string, options?: YoutubeVideoDownloadOptions): Promise<ApickResult<YoutubeDownloadLink>>;
672
- downloadYoutubeAudio(url: string, options?: YoutubeAudioDownloadOptions): Promise<ApickResult<YoutubeDownloadLink>>;
673
- createTtsJob(text: string | GeminiTtsInput, options?: TtsOptions): Promise<ApickResult<TtsJobData>>;
674
- createGeminiTtsJob(input:GeminiTtsInput, options?:{idempotencyKey?:string}):Promise<ApickResult<TtsJobData>>;
675
- listGeminiTtsVoices():Promise<ApickResult<{voices:GeminiTtsVoice[];complete:boolean;checked_at:string|null}>>;
676
- createOpenAiTtsJob(input:OpenAiTtsInput, options?:{idempotencyKey?:string}):Promise<ApickResult<TtsJobData>>;
677
- listOpenAiTtsVoices():Promise<ApickResult<{voices:GeminiTtsVoice[];complete:boolean;checked_at:string|null}>>;
678
- getTtsOptions():Promise<ApickResult<{engines:Record<'gemini'|'openai',Record<string,unknown>>}>>;
679
- quoteTts(input:GeminiTtsInput&{engine?:'gemini'|'openai'}):Promise<ApickResult<TtsQuote>>;
680
- getTtsJob(jobId: string): Promise<ApickResult<TtsJobData>>;
681
- cancelTtsJob(jobId: string): Promise<ApickResult<TtsJobData>>;
682
- downloadTtsResult(jobId: string): Promise<ApickBinaryResult>;
683
- downloadTtsSubtitles(jobId: string): Promise<ApickBinaryResult>;
684
- /** @deprecated Retired endpoint; the service returns HTTP 409. */
685
- getTtsQuality(jobId: string): Promise<ApickResult<TtsQualityData>>;
686
- /** @deprecated Retired endpoint; the service returns HTTP 409. */
687
- retryTtsJob(jobId: string, utteranceIds: string[], idempotencyKey: string): Promise<ApickResult<TtsJobData>>;
688
- /** @deprecated Retired endpoint; the service returns HTTP 409. */
689
- downloadTtsCandidate(jobId: string, candidateId: string): Promise<ApickBinaryResult>;
690
- htmlToPdf(html: string, options?: { pagination?: boolean }): Promise<ApickBinaryResult>;
691
- jsonToExcel(data: unknown[], options?: { sheetName?: string }): Promise<ApickBinaryResult>;
692
- summarize(text: string): Promise<ApickResult>;
693
- polish(text: string): Promise<ApickResult>;
694
- generateImages(prompt:string, options?:ImageAiGenerateOptions): Promise<ApickResult<ImageAiResultData|ImageAiPendingData>>;
695
- editImages(image:string|BinaryInput|ArrayBuffer|ArrayBufferView, prompt:string, options?:ImageAiEditOptions): Promise<ApickResult<ImageAiResultData|ImageAiPendingData>>;
696
- createImageGenerationJob(prompt:string, options?:ImageAiGenerateOptions): Promise<ApickResult<ImageAiJobData>>;
697
- createImageEditJob(image:string|BinaryInput|ArrayBuffer|ArrayBufferView, prompt:string, options?:ImageAiEditOptions): Promise<ApickResult<ImageAiJobData>>;
698
- getImageJob(jobId:string): Promise<ApickResult<ImageAiJobData>>;
699
- downloadImageJobImage(jobId:string,index:number): Promise<ApickBinaryResult>;
700
- downloadImageJobArchive(jobId:string): Promise<ApickBinaryResult>;
701
- requestEmployment(input: RequestEmploymentInput): Promise<ApickResult<DataRequestAcceptedData>>;
702
- getEmployment(transactionId: string): Promise<ApickResult<DataRequestResult<EmploymentResultPayload>>>;
703
- requestPersonalIncome(input: RequestPersonalIncomeInput): Promise<ApickResult<DataRequestAcceptedData>>;
704
- getPersonalIncome(transactionId: string): Promise<ApickResult<DataRequestResult<PersonalIncomeResultPayload>>>;
705
- requestNpsJoinHistory(input: RequestNpsJoinHistoryInput): Promise<ApickResult<DataRequestAcceptedData>>;
706
- getNpsJoinHistory(transactionId: string): Promise<ApickResult<DataRequestResult<NpsJoinHistoryResultPayload>>>;
707
- requestDrivingLicense(input: RequestDrivingLicenseInput): Promise<ApickResult<DataRequestAcceptedData>>;
708
- getDrivingLicense(transactionId: string): Promise<ApickResult<DataRequestResult<DrivingLicenseResultPayload>>>;
709
- requestHealthCheckup(input: RequestHealthCheckupInput): Promise<ApickResult<DataRequestAcceptedData>>;
710
- getHealthCheckup(transactionId: string): Promise<ApickResult<DataRequestResult<HealthCheckupResultPayload>>>;
711
- requestCashReceiptDeduction(input: RequestCashReceiptDeductionInput): Promise<ApickResult<DataRequestAcceptedData>>;
712
- getCashReceiptDeduction(transactionId: string): Promise<ApickResult<DataRequestResult<CashReceiptDeductionResultPayload>>>;
713
- requestTaxReturnHistory(input: RequestTaxReturnHistoryInput): Promise<ApickResult<DataRequestAcceptedData>>;
714
- getTaxReturnHistory(transactionId: string): Promise<ApickResult<DataRequestResult<TaxReturnHistoryResultPayload>>>;
715
- searchSkills(options?: SkillSearchOptions): Promise<ApickResult<SkillPage<SkillSummary>>>;
716
- /** Public measured results and methods; model scores are not accuracy guarantees. */
717
- getSkillPerformance(): Promise<ApickResult<SkillPerformanceReport>>;
718
- subagentStatus(): Promise<ApickResult<Record<string, unknown>>>;
719
- subagentUsage(): Promise<ApickResult<Record<string, unknown>>>;
720
- createSubagentFile(input: {path:string;bytes:number;sha256:string;retention?:'seven_days'|'none'}): Promise<ApickResult<SubagentFile>>;
721
- getSubagentFile(fileId:string): Promise<ApickResult<SubagentFile>>;
722
- uploadSubagentPart(fileId:string,partNo:number,data:string): Promise<ApickResult<Record<string,unknown>>>;
723
- completeSubagentFile(fileId:string): Promise<ApickResult<SubagentFile>>;
724
- deleteSubagentFile(fileId:string): Promise<ApickResult<Record<string,unknown>>>;
725
- dispatchSubagent(input:SubagentTask,options:{idempotencyKey:string}): Promise<ApickResult<SubagentJob>>;
726
- collectSubagent(jobId:string,options?:{cursor?:string}): Promise<ApickResult<SubagentJob>>;
727
- subagentEvidence(jobId:string,evidenceIds:string[]): Promise<ApickResult<Record<string,unknown>>>;
728
- reviewSubagent(jobId:string,resultHash:string,decision:'accepted'|'rejected'): Promise<ApickResult<Record<string,unknown>>>;
729
- cancelSubagent(jobId:string): Promise<ApickResult<SubagentJob>>;
730
- deleteSubagentJob(jobId:string): Promise<ApickResult<Record<string,unknown>>>;
731
- getSkill(skillId: string): Promise<ApickResult<SkillDetail>>;
732
- quoteSkill(skillId: string, input: Record<string, unknown>, options?: { version?: string }): Promise<ApickResult<SkillQuote>>;
733
- runSkill<T = Record<string, unknown>>(skillId: string, input: Record<string, unknown>, options: SkillRunOptions): Promise<ApickResult<SkillRun<T>>>;
734
- getSkillRun<T = Record<string, unknown>>(runId: string): Promise<ApickResult<SkillRun<T>>>;
735
- getSkillRunResult<T = Record<string, unknown>>(runId: string): Promise<ApickResult<SkillRunResult<T>>>;
736
- /** 본인 실행의 결과 파일을 인증해 내려받습니다. / Download an artifact owned by this API key. */
737
- getSkillArtifact(runId: string, fileId: string): Promise<ApickBinaryResult>;
738
- cancelSkillRun(runId: string): Promise<ApickResult<SkillRun>>;
739
- skillUsage(options?: { cursor?: string; limit?: number }): Promise<ApickResult<SkillPage<SkillRun>>>;
740
- }
741
-
742
- export const SKILL_CATEGORIES: readonly ['data', 'ai', 'dev', 'document', 'marketing', 'finance', 'productivity', 'video', 'etc'];
743
- export type SkillCategory = typeof SKILL_CATEGORIES[number];
744
- /** 검색 순서. 생략하면 등록 순서 / search order; registration order when omitted */
745
- export const SKILL_SORTS: readonly ['recommended', 'popular', 'used', 'likes', 'rating', 'new', 'mine', 'liked'];
746
- export type SkillSort = typeof SKILL_SORTS[number];
747
- export interface SkillPerformanceRate {
748
- passed: number; total: number; percent: number; interval95: [number, number];
749
- }
750
- export interface SkillPerformanceReport {
751
- schema_version: 1;
752
- updated_at: string;
753
- inventory_verified: boolean;
754
- method: { minimum_cases: number; min_score: number; mean_score: number; min_improvement: number; critical_failures: number; description: string; limitations: string[]; interval_note: string; split: { normal: number; boundary: number; adversarial: number } };
755
- calibration: { at: string; cases: number; true_positive: number; false_negative: number; false_positive: number; true_negative: number; automatic_release_allowed: boolean } | null;
756
- additional_calibrations: Array<{ label: string; at: string; cases: number; detected: number; missed: number; false_positive: number; uncertain: number; automatic_release_allowed: boolean; scope: string }>;
757
- skills: Array<{
758
- key: string; title: string; group: string; origin: 'new' | 'existing'; published: boolean | null; url: string | null;
759
- current: {
760
- state: 'not_tested' | 'partial' | 'held' | 'passed' | 'stale'; at?: string;
761
- cases: number; planned_cases: number; score: number | null; baseline_score: number | null;
762
- score_samples?: number; evaluation_errors?: number;
763
- delivery: SkillPerformanceRate | null; machine: SkillPerformanceRate | null;
764
- median_seconds: number | null; p95_seconds: number | null; timing_samples?: number;
765
- reasons: string[]; method?: string; sample_type?: string;
766
- baseline_format_valid?: boolean;
767
- evaluation_stage?: 'preliminary' | 'holdout';
768
- dataset_composition?: { normal: number; boundary: number; adversarial: number; misplaced_rejections: number; valid: boolean };
769
- min_score?: number | null; critical_cases?: number | null;
770
- case_split?: { standard: number; boundary: number; adversarial: number };
771
- extra_checks?: Array<{ name: string; passed: number; total: number }>;
772
- tool_calls?: Array<{ label: string; samples: number; total: number | null; median: number | null; p95: number | null }>;
773
- case_results?: Array<{ index: number; name: string; kind: 'standard' | 'boundary' | 'adversarial'; status: 'tested' | 'evaluation_error' | 'machine_only' | 'not_tested'; expected: 'success' | 'reject' | null; machine_pass: boolean; score: number | null; baseline_score: number | null; failed_checks: string[]; reason: string | null }>;
774
- };
775
- legacy: { cases: number; score: number; baseline_score: number; method: string; independent_holdout: false; at?: string } | null;
776
- }>;
777
- }
778
- export type SkillRunStatus = 'queued' | 'running' | 'completing' | 'succeeded' | 'failed' | 'timed_out' | 'cancelled';
779
- export type SkillBillingStatus = 'reserved' | 'captured' | 'released' | 'partially_refunded' | 'refunded';
780
- export type SkillFailureCode = 'EXECUTION_FAILED' | 'OUTPUT_INVALID' | 'TIMED_OUT' | 'CANCELLED' | 'UPSTREAM_UNAVAILABLE';
781
- /** `ApickApiError.serviceCode` 로 돌아오는 Skills 오류 코드 */
782
- export type SkillErrorCode =
783
- | 'INVALID_INPUT' | 'AUTH_REQUIRED' | 'NOT_ALLOWED' | 'PAYMENT_REQUIRED' | 'SKILL_OR_RUN_NOT_FOUND'
784
- | 'IDEMPOTENCY_KEY_REQUIRED' | 'IDEMPOTENCY_CONFLICT' | 'QUOTE_EXPIRED' | 'VERSION_UNAVAILABLE'
785
- | 'PRICE_EXCEEDS_LIMIT' | 'RUN_NOT_CANCELLABLE' | 'RESULT_NOT_READY' | 'RESULT_EXPIRED'
786
- | 'INSUFFICIENT_POINTS' | 'RATE_LIMITED' | 'BUDGET_EXCEEDED' | 'TEMPORARILY_UNAVAILABLE';
787
- export interface SkillSearchOptions {
788
- query?: string; category?: SkillCategory;
789
- /** `mine`·`liked` 는 인증키의 계정 기준 / `mine` and `liked` are scoped to the API key's account */
790
- sort?: SkillSort;
791
- cursor?: string; limit?: number;
792
- }
793
- export interface SkillRunOptions {
794
- /** 이 실행을 구분하는 고유 값. 재시도할 때 같은 값을 씁니다. 영문·숫자와 `. _ : -` 1~128자 */
795
- idempotencyKey: string;
796
- version?: string;
797
- quoteId?: string;
798
- /** 가격이 이 값보다 높으면 실행하지 않습니다 */
799
- maxCostPoints?: number;
800
- /** 결과를 기다릴 시간(0~20초, 기본 20) */
801
- waitSeconds?: number;
802
- }
803
- export interface SkillPage<T> { items: T[]; next_cursor: string | null; }
804
- export interface SkillLimits { max_input_chars: number; timeout_seconds: number; }
805
- export interface SkillSummary {
806
- execution_info?: SkillExecutionInfo;
807
- price_label?: string;
808
- skill_id: string; slug: string; title: string; summary: string;
809
- category: SkillCategory; category_label: string; version: string;
810
- /** 실행마다 같은 기본 금액 / base amount charged on every run */
811
- price_points: number;
812
- /** 사용량까지 더한 예상 금액 / estimated amount including usage */
813
- estimated_points: number | null;
814
- /** true 면 실행마다 실제 사용량만큼 금액이 달라집니다 / amount varies per run with actual usage */
815
- usage_priced: boolean;
816
- seller: { name: string }; uses_generative_ai: boolean;
817
- /** 사용 건수 구간. 예: `1,000회 미만`, `1,000+`, `1만+` / usage tier label, not an exact count */
818
- usage_label: string;
819
- like_count: number;
820
- review_count: number;
821
- /** 평점(1~5, 소수 첫째 자리). 리뷰가 없으면 null / average rating, null without reviews */
822
- rating_average: number | null;
823
- }
824
- export interface SkillDetail extends SkillSummary {
825
- description: string; billing_rule: 'validated_result' | 'subagent_usage'; limits: SkillLimits | null;
826
- delivery?: 'installed_agent'; installation?: {package:string;command:string;api_key_env:string;guide:string;usage:string};
827
- billing?: {markup_percent:number;installation_points:number;base_points:number;complete_cache_points:number;quota:null};
828
- input_schema: Record<string, unknown>; output_schema: Record<string, unknown>;
829
- examples: unknown[]; stats: Record<string, unknown> | null; published_at: string | null;
830
- }
831
- export interface SkillQuote {
832
- execution_info?: SkillExecutionInfo;
833
- quote_id: string; skill_id: string; version: string; price_points: number;
834
- /** 이 입력의 예상 금액 / estimated amount for this input */
835
- estimated_points: number;
836
- /** 예약되는 최대 금액. 실제 차감액은 이 값을 넘지 않습니다 / maximum amount reserved; the charge never exceeds it */
837
- max_points: number;
838
- usage_priced: boolean;
839
- expires_at: string; limits: SkillLimits; billing_rule: 'validated_result';
840
- }
841
- export interface SkillBilling { status: SkillBillingStatus; reserved_points: number; charged_points: number; refunded_points: number; }
842
- export interface SkillExecutionInfo {
843
- price_range: { min_points: number; max_points: number; variable: boolean };
844
- duration: { min_seconds: number; max_seconds: number; basis: string };
845
- tools: Array<{ name: string; typical_calls: number | string; max_calls: number | string; min_calls?: number }>;
846
- billing_note: string;
847
- }
848
- export interface SkillArtifact {
849
- id: string; name: string; mime_type: string; url: string; sha256: string; bytes: number;
850
- label?: string; width?: number; height?: number; seconds?: number;
851
- }
852
- export interface SkillRun<T = Record<string, unknown>> {
853
- run_id: string; status: SkillRunStatus;
854
- skill: { id: string; version: string; title?: string };
855
- billing: SkillBilling; created_at: string | null; completed_at: string | null;
856
- links: { self: string; result?: string };
857
- failure_code?: SkillFailureCode; result_expires_at?: string | null;
858
- /** status 가 succeeded 일 때만 */
859
- result?: T;
860
- }
861
- export interface SkillRunResult<T = Record<string, unknown>> {
862
- run_id: string; skill: { id: string; version: string; title?: string };
863
- result: T; result_expires_at: string | null;
864
- }
865
-
866
- export default ApickClient;
867
-
868
- export type VideoModel = 'seedance' | 'veo' | 'kling';
869
- export interface VideoJobOptions {
870
- version?: string; tier?: string; mode?: 'text' | 'image' | 'reference'; duration?: number;
871
- aspectRatio?: string; resolution?: string; audio?: boolean; negativePrompt?: string;
872
- seed?: number; cfgScale?: number; idempotencyKey?: string;
873
- image?: string | BinaryInput | ArrayBuffer | ArrayBufferView;
874
- lastImage?: string | BinaryInput | ArrayBuffer | ArrayBufferView;
875
- referenceImages?: Array<string | BinaryInput | ArrayBuffer | ArrayBufferView>;
876
- referenceVideos?: Array<string | BinaryInput>;
877
- referenceAudios?: Array<string | BinaryInput>;
878
- }
879
- export interface VideoJobData {
880
- job_id: string; model: VideoModel; version: string; mode: string; tier: string;
881
- status: 'waiting' | 'processing' | 'completed' | 'failed' | 'cancelled';
882
- duration: number; resolution?: string; audio?: boolean; point_per_second?: number;
883
- charged_point?: number; result_available?: boolean; result_url?: string;
884
- result_expires_at?: string | null; idempotent_replay?: boolean;
885
- error?: { code: string; message: string };
886
- }
887
-
888
- export interface SubagentTask { kind:'inventory'|'extract'|'summarize'|'compare';goal:string;file_ids:string[];focus?:string[];acceptance?:string[];retention?:'seven_days'|'none'; }
889
- export interface SubagentFile { file_id:string;path:string;sha256:string;bytes:number;state:string;expires_at:string;part_bytes?:number; }
890
- export interface SubagentJob { job_id:string;kind:SubagentTask['kind'];state:string;billing_state:string;cache_hit:boolean;reserved_points:number;charged_points:number;accrued_points:string;result_hash?:string;result?:Record<string,unknown>; }
1
+ export interface ApickClientOptions {
2
+ apiKey: string;
3
+ baseUrl?: string;
4
+ timeoutMs?: number;
5
+ /** Requests with a body use native FormData; GET requests have no body. */
6
+ fetch?: typeof fetch;
7
+ }
8
+
9
+ export interface ApickMeta {
10
+ readonly cost: number | null;
11
+ readonly durationMs: number | null;
12
+ }
13
+
14
+ export interface ApickResult<T = Record<string, unknown>> {
15
+ readonly data: T;
16
+ readonly meta: ApickMeta;
17
+ }
18
+
19
+ export interface SearchList<T> {
20
+ readonly keyword: string;
21
+ readonly page?: number;
22
+ readonly count: number;
23
+ readonly items: readonly T[];
24
+ }
25
+
26
+ export interface NewsItem {
27
+ readonly rank: number;
28
+ readonly title: string;
29
+ readonly link: string;
30
+ readonly source: string;
31
+ readonly published: string;
32
+ readonly description: string;
33
+ readonly image_url: string;
34
+ }
35
+
36
+ export interface ShoppingItem {
37
+ readonly rank: number;
38
+ readonly title: string;
39
+ readonly price: string;
40
+ readonly old_price: string;
41
+ readonly shop: string;
42
+ readonly rating: number | null;
43
+ readonly reviews: number | null;
44
+ readonly link: string;
45
+ readonly image_url: string;
46
+ }
47
+
48
+ export interface PlaceItem {
49
+ readonly rank: number;
50
+ readonly name: string;
51
+ readonly address: string;
52
+ readonly phone: string;
53
+ readonly categories: readonly string[];
54
+ readonly rating: number | null;
55
+ readonly reviews: number | null;
56
+ readonly price_range: string;
57
+ readonly open_status: string;
58
+ readonly open_hours: Readonly<Record<string, string>>;
59
+ readonly website: string;
60
+ readonly latitude: number | null;
61
+ readonly longitude: number | null;
62
+ readonly place_id: string;
63
+ readonly map_link: string;
64
+ readonly thumbnail: string;
65
+ }
66
+
67
+ export interface RankCheck {
68
+ readonly keyword: string;
69
+ readonly domain: string;
70
+ readonly found: boolean;
71
+ readonly rank: number | null;
72
+ readonly matches: readonly { readonly rank: number; readonly title: string; readonly link: string }[];
73
+ readonly checked_results: number;
74
+ /** 확인한 10위 구간 수(최대 10). */
75
+ readonly checked_pages: number;
76
+ /** 1~100위를 모두 확인했거나 앞에서부터 끊김 없이 확인한 구간에서 찾았으면 true. false 면 확인한 구간 비율만큼만 과금된다. */
77
+ readonly complete: boolean;
78
+ /** 확인하지 못한 순위 구간(예: "41-50"). */
79
+ readonly unchecked_ranks: readonly string[];
80
+ }
81
+
82
+ export interface AmazonProduct {
83
+ readonly asin: string;
84
+ readonly url: string;
85
+ readonly title: string;
86
+ readonly brand: string;
87
+ readonly price: number | null;
88
+ readonly original_price: number | null;
89
+ readonly currency: string;
90
+ readonly rating: number | null;
91
+ readonly reviews_count: number | null;
92
+ readonly availability: string;
93
+ readonly is_available: boolean;
94
+ readonly bought_past_month: number | null;
95
+ readonly seller_name: string;
96
+ readonly categories: readonly string[];
97
+ readonly features: readonly string[];
98
+ readonly customers_say: string;
99
+ readonly image_url: string;
100
+ readonly image_urls: readonly string[];
101
+ readonly date_first_available: string;
102
+ readonly model_number: string;
103
+ }
104
+
105
+ export interface XPostSummary {
106
+ readonly post_id: string;
107
+ readonly url: string;
108
+ readonly text: string;
109
+ readonly posted_at: string;
110
+ readonly likes: number | null;
111
+ readonly reposts: number | null;
112
+ readonly replies: number | null;
113
+ readonly views: number | null;
114
+ readonly hashtags: readonly string[];
115
+ }
116
+
117
+ export interface XProfile {
118
+ readonly username: string;
119
+ readonly name: string;
120
+ readonly biography: string;
121
+ readonly followers: number | null;
122
+ readonly following: number | null;
123
+ readonly posts_count: number | null;
124
+ readonly is_verified: boolean;
125
+ readonly is_business_account: boolean;
126
+ readonly is_government_account: boolean;
127
+ readonly location: string;
128
+ readonly website: string;
129
+ readonly joined_at: string;
130
+ readonly profile_image_url: string;
131
+ readonly banner_image_url: string;
132
+ readonly profile_url: string;
133
+ readonly recent_posts: readonly XPostSummary[];
134
+ }
135
+
136
+ export interface XPost {
137
+ readonly post_id: string;
138
+ readonly url: string;
139
+ readonly username: string;
140
+ readonly name: string;
141
+ readonly text: string;
142
+ readonly posted_at: string;
143
+ readonly likes: number | null;
144
+ readonly reposts: number | null;
145
+ readonly replies: number | null;
146
+ readonly quotes: number | null;
147
+ readonly views: number | null;
148
+ readonly bookmarks: number | null;
149
+ readonly hashtags: readonly string[];
150
+ readonly is_repost: boolean;
151
+ readonly photo_urls: readonly string[];
152
+ readonly video_urls: readonly string[];
153
+ readonly author: { readonly followers: number | null; readonly is_verified: boolean };
154
+ }
155
+
156
+ export interface TiktokVideo {
157
+ readonly video_id: string;
158
+ readonly url: string;
159
+ readonly username: string;
160
+ readonly description: string;
161
+ readonly posted_at: string;
162
+ readonly views: number | null;
163
+ readonly likes: number | null;
164
+ readonly comments: number | null;
165
+ readonly shares: number | null;
166
+ readonly saves: number | null;
167
+ readonly duration_sec: number | null;
168
+ readonly hashtags: readonly string[];
169
+ readonly region: string;
170
+ readonly cover_image_url: string;
171
+ readonly author: { readonly followers: number | null; readonly is_verified: boolean };
172
+ }
173
+
174
+ /** 댓글 작성자는 공개 사용자명만 제공한다. */
175
+ export interface SocialComment {
176
+ readonly comment_id: string;
177
+ readonly username: string;
178
+ readonly text: string;
179
+ readonly posted_at: string;
180
+ readonly likes: number | null;
181
+ readonly replies: number | null;
182
+ }
183
+
184
+ export interface AmazonReview {
185
+ readonly review_id: string;
186
+ readonly rating: number | null;
187
+ readonly title: string;
188
+ readonly text: string;
189
+ readonly author: string;
190
+ readonly posted_at: string;
191
+ readonly country: string;
192
+ readonly is_verified_purchase: boolean;
193
+ readonly helpful_count: number | null;
194
+ readonly variant: string;
195
+ }
196
+
197
+ export interface GoogleMapsPlace {
198
+ readonly name: string;
199
+ readonly category: string;
200
+ readonly categories: readonly string[];
201
+ readonly address: string;
202
+ readonly country_code: string;
203
+ readonly phone: string;
204
+ readonly website: string;
205
+ readonly description: string;
206
+ readonly rating: number | null;
207
+ readonly reviews_count: number | null;
208
+ /** 별점별 리뷰 수. */
209
+ readonly rating_distribution: Readonly<Record<"1" | "2" | "3" | "4" | "5", number | null>>;
210
+ /** 대표 리뷰(최대 10건). 작성자는 공개 표시 이름만. */
211
+ readonly top_reviews: readonly { readonly reviewer_name: string; readonly rating: number | null; readonly posted_at: string; readonly text: string }[];
212
+ readonly open_hours: Readonly<Record<string, string>>;
213
+ /** day: 1=월 … 7=일 */
214
+ readonly popular_times: readonly { readonly day: number | null; readonly hours: readonly { readonly hour: string; readonly busy_percent: number | null }[] }[];
215
+ readonly similar_places: readonly { readonly name: string; readonly category: string; readonly rating: number | null; readonly reviews_count: number | null }[];
216
+ readonly photo_urls: readonly string[];
217
+ readonly main_image_url: string;
218
+ readonly is_claimed: boolean;
219
+ readonly permanently_closed: boolean;
220
+ readonly temporarily_closed: boolean;
221
+ readonly latitude: number | null;
222
+ readonly longitude: number | null;
223
+ readonly place_id: string;
224
+ readonly map_url: string;
225
+ }
226
+
227
+ export type ScrapeJobProduct = "instagram_posts" | "instagram_comments" | "tiktok_search" | "tiktok_video" | "tiktok_comments" | "amazon_reviews" | "google_maps_place";
228
+
229
+ export interface ScrapeJobOptions {
230
+ /** 최대 결과 수. 이 수 × 단가를 예약하고 실제 결과 건수만 차감한다(instagram_comments 15, tiktok_search 50, 그 밖 100). */
231
+ readonly maxResults?: number;
232
+ /** 응답을 못 받아 다시 보낼 때 같은 접수로 처리할 키(8~128자). */
233
+ readonly idempotencyKey?: string;
234
+ }
235
+
236
+ export interface ScrapeJob<T = unknown> {
237
+ readonly job_id: string;
238
+ readonly product: ScrapeJobProduct;
239
+ readonly status: "waiting" | "processing" | "completed" | "failed";
240
+ readonly max_results: number;
241
+ readonly unit_point: number;
242
+ readonly reserved_point: number;
243
+ readonly charged_point: number;
244
+ readonly result_count: number;
245
+ readonly created_at: string;
246
+ readonly completed_at: string | null;
247
+ /** 결과 보관 기한(완료 후 72시간). */
248
+ readonly result_expires_at?: string;
249
+ readonly result_expired?: boolean;
250
+ readonly items?: readonly T[];
251
+ readonly error?: { readonly code: string; readonly message: string };
252
+ }
253
+
254
+ export interface InstagramProfile {
255
+ readonly username: string;
256
+ readonly full_name: string;
257
+ readonly biography: string;
258
+ readonly followers: number | null;
259
+ readonly following: number | null;
260
+ readonly posts_count: number | null;
261
+ readonly is_verified: boolean;
262
+ readonly is_private: boolean;
263
+ readonly external_urls: readonly string[];
264
+ readonly highlights_count: number | null;
265
+ readonly profile_image_url: string;
266
+ readonly profile_url: string;
267
+ readonly recent_posts: readonly { readonly url: string; readonly content_type: string; readonly caption: string; readonly posted_at: string; readonly image_url: string; readonly hashtags: readonly string[] }[];
268
+ }
269
+
270
+ export interface InstagramPost {
271
+ readonly url: string;
272
+ readonly shortcode: string;
273
+ readonly username: string;
274
+ readonly caption: string;
275
+ readonly content_type: string;
276
+ readonly posted_at: string;
277
+ readonly likes: number | null;
278
+ readonly comments: number | null;
279
+ readonly views: number | null;
280
+ readonly duration_sec: number | null;
281
+ readonly hashtags: readonly string[];
282
+ readonly is_paid_partnership: boolean;
283
+ readonly coauthors: readonly string[];
284
+ readonly thumbnail_url: string;
285
+ readonly image_urls: readonly string[];
286
+ readonly video_url: string;
287
+ readonly author: { readonly followers: number | null; readonly is_verified: boolean; readonly profile_url: string };
288
+ }
289
+
290
+ export interface TiktokProfile {
291
+ readonly username: string;
292
+ readonly nickname: string;
293
+ readonly biography: string;
294
+ readonly followers: number | null;
295
+ readonly following: number | null;
296
+ readonly likes: number | null;
297
+ readonly videos_count: number | null;
298
+ readonly is_verified: boolean;
299
+ readonly is_private: boolean;
300
+ readonly bio_link: string;
301
+ readonly engagement_rate: number | null;
302
+ readonly created_at: string;
303
+ readonly profile_image_url: string;
304
+ readonly profile_url: string;
305
+ readonly recent_videos: readonly { readonly video_id: string; readonly url: string; readonly views: number | null; readonly likes: number | null; readonly comments: number | null; readonly shares: number | null; readonly posted_at: string; readonly cover_image_url: string }[];
306
+ }
307
+
308
+ export interface BinaryInput {
309
+ readonly size?: number;
310
+ readonly type?: string;
311
+ readonly name?: string;
312
+ arrayBuffer(): Promise<ArrayBuffer>;
313
+ }
314
+
315
+ export interface OcrOptions {
316
+ filename?: string;
317
+ contentType?: 'image/png' | 'image/jpeg';
318
+ }
319
+
320
+ export type ImageAiFormat = 'png' | 'jpeg' | 'webp';
321
+ export type ImageAiBackground = 'auto' | 'opaque' | 'transparent';
322
+ export type ImageAiSize = '1024x1024' | '1536x1024' | '1024x1536' | '1152x864' | '864x1152';
323
+ /** basic 40P(default) · advanced 350P · premium 1,400P per image */
324
+ export type ImageAiQuality = 'basic' | 'advanced' | 'premium';
325
+ export type ImageAiStatus = 'waiting' | 'processing' | 'completed' | 'completed_partial' | 'failed';
326
+ export type ApickImageErrorCode = `APICK_IMAGE_${string}`;
327
+ export interface ImageAiOptions { imageCount?: number; size?: ImageAiSize; outputFormat?: ImageAiFormat; background?: ImageAiBackground; quality?: ImageAiQuality;
328
+ /** @deprecated Ignored. Every image request is generated and charged as a new request. */
329
+ idempotencyKey?: string; }
330
+ export interface ImageAiGenerateOptions extends ImageAiOptions { referenceImage?: string|BinaryInput|ArrayBuffer|ArrayBufferView; referenceFilename?: string; referenceContentType?: 'image/png'|'image/jpeg'|'image/webp'; }
331
+ export interface ImageAiEditOptions extends ImageAiOptions { filename?: string; contentType?: 'image/png'|'image/jpeg'|'image/webp'; }
332
+ export interface ImageAiResultImage { index:number; b64_json:string; mime_type:'image/png'|'image/jpeg'|'image/webp'; width:number; height:number; }
333
+ export interface ImageAiResultData { request_id:string; image_count:number; images:ImageAiResultImage[]; idempotent_replay?:boolean; }
334
+ export interface ImageAiPendingData {request_id:string;job_id:string;status:'processing';billing_status:'pending';reserved_point:number;}
335
+ export interface ImageAiJobData { job_id:string; status:ImageAiStatus; requested_count:number; completed_count?:number; failed_count?:number; prepaid_point?:number; charged_point?:number; refunded_point?:number; result_available?:boolean; expires_at?:string|null; error_code?:ApickImageErrorCode|null; }
336
+
337
+ export interface MaskResidentNumberOptions extends OcrOptions {
338
+ type: 1 | 2 | 3 | 4;
339
+ }
340
+
341
+ export const AUTH_PROVIDERS: readonly [
342
+ 'kakao', 'naver', 'toss', 'pass', 'samsung', 'kb', 'shinhan', 'hana', 'woori', 'ibk', 'nh', 'kakaobank', 'banksalad'
343
+ ];
344
+ export type AuthProvider = typeof AUTH_PROVIDERS[number];
345
+
346
+ /** 간편인증 기반 조회 상품(재직·소득·연금·면허·건강검진 등)의 공통 입력. */
347
+ export interface DataRequestInput {
348
+ name: string;
349
+ birthDate: string;
350
+ phone: string;
351
+ authProvider: AuthProvider;
352
+ }
353
+ export interface RequestEmploymentInput extends DataRequestInput { insuranceYears?: number; }
354
+ export interface RequestPersonalIncomeInput extends DataRequestInput { incomeYears?: number; }
355
+ export interface RequestNpsJoinHistoryInput extends DataRequestInput { from?: string; to?: string; }
356
+ export interface RequestDrivingLicenseInput extends DataRequestInput {}
357
+ export interface RequestHealthCheckupInput extends DataRequestInput {}
358
+ export interface RequestCashReceiptDeductionInput extends DataRequestInput { incomeYears?: number; }
359
+ export interface RequestTaxReturnHistoryInput extends DataRequestInput { years?: number; }
360
+
361
+ export type DataRequestStatus =
362
+ | 'AUTH_REQUESTED' | 'AUTH_WAITING' | 'AUTH_COMPLETED' | 'AUTH_REJECTED' | 'AUTH_EXPIRED'
363
+ | 'COLLECTING' | 'COLLECTED' | 'PARTIAL_SUCCESS' | 'SUCCESS' | 'FAILED';
364
+ export type DataRequestErrorCode = 'RESULT_EXPIRED' | 'AUTH_EXPIRED' | 'AUTH_REJECTED' | 'COLLECT_FAILED';
365
+ export interface DataRequestSource { source: string; type: string; status: string; }
366
+
367
+ /** `request*()` (POST /rest/req_*) 응답의 `data`. */
368
+ export interface DataRequestAcceptedData {
369
+ schemaVersion: string;
370
+ transactionId: string;
371
+ product: string;
372
+ status: DataRequestStatus;
373
+ resultAvailable: boolean;
374
+ charged: boolean;
375
+ sources: DataRequestSource[];
376
+ message: string;
377
+ expiresAt: string;
378
+ success: number;
379
+ approvals?: number;
380
+ }
381
+
382
+ /** `get*()` (POST /rest/get_*) 응답의 `data`. `result`는 결과가 있을 때만 온다. */
383
+ export interface DataRequestResult<T> {
384
+ schemaVersion: string;
385
+ transactionId: string;
386
+ product: string;
387
+ status: DataRequestStatus;
388
+ resultAvailable: boolean;
389
+ charged: boolean;
390
+ sources: DataRequestSource[];
391
+ message: string;
392
+ expiresAt?: string;
393
+ success: number;
394
+ progress?: { total: number; completed: number };
395
+ checkedAt?: string;
396
+ resultExpiresAt?: string;
397
+ result?: T;
398
+ errorCode?: DataRequestErrorCode;
399
+ }
400
+
401
+ export interface EmploymentHistoryEntry { 사업장: string; 취득일: string; 상실일: string; 자격구분: string; }
402
+ export interface EmploymentPremiumEntry {
403
+ 사업장: string; 고지년월: string; 보수월액: number;
404
+ '건강보험 산정보험료': number; '건강보험 정산보험료': number; '건강보험 고지보험료': number; '건강보험 연말정산보험료': number;
405
+ '장기요양 산정보험료': number; '장기요양 정산보험료': number; '장기요양 고지보험료': number; '장기요양 연말정산보험료': number;
406
+ 가입자부담금: number;
407
+ }
408
+ export interface EmploymentInfo {
409
+ 재직상태: 'EMPLOYED' | 'UNEMPLOYED' | 'UNKNOWN';
410
+ 현재사업장?: string;
411
+ 취득일?: string;
412
+ 이력: EmploymentHistoryEntry[];
413
+ 보험료연도: string[];
414
+ 보험료: EmploymentPremiumEntry[];
415
+ }
416
+ export interface EmploymentResultPayload { employment: EmploymentInfo; }
417
+
418
+ export interface PersonalIncomeAmount { 건수: number; 소득금액: number; 소득세: number; 지방소득세: number; 농어촌특별세: number; 세액합계: number; }
419
+ export interface PersonalIncomeYear {
420
+ 귀속연도: string;
421
+ 소득종류별: { 이자소득?: PersonalIncomeAmount; 배당소득?: PersonalIncomeAmount };
422
+ 합계: PersonalIncomeAmount;
423
+ }
424
+ export interface PersonalIncomeInfo { 조회연도: string[]; 연도별: PersonalIncomeYear[]; }
425
+ export interface PersonalIncomeResultPayload { personalIncome: PersonalIncomeInfo; }
426
+
427
+ export interface NpsJoinHistoryEntry {
428
+ 시작: string; 종료: string; 기준소득월액: number;
429
+ 납부개월: number; 납부금액: number; 미납개월: number; 미납금액: number;
430
+ 가입자구분: string; 사업장: string;
431
+ }
432
+ export interface NpsJoinHistoryInfo {
433
+ 조회기간: { 시작: string; 종료: string };
434
+ 합계: { 납부개월: number; 납부금액: number; 미납개월: number; 미납금액: number };
435
+ 가입내역: NpsJoinHistoryEntry[];
436
+ }
437
+ export interface NpsJoinHistoryResultPayload { npsJoinHistory: NpsJoinHistoryInfo; }
438
+
439
+ export interface DrivingLicenseAcquisition {
440
+ 면허종류코드: string; 발급일자: string; 합격일자: string; 발급지역: string; 발급일련번호: string;
441
+ 학원명: string; 졸업일자: string; 공고시험장: string; 등록일자: string; 면허조건: string;
442
+ }
443
+ export interface DrivingLicenseInfo {
444
+ 이름?: string; 주소?: string; 면허번호?: string; 관할경찰서?: string; 국적?: string; 면허상태?: string;
445
+ 취소일자?: string; 적성검사일자?: string; 적성검사기관?: string; 적성검사유효기간?: string;
446
+ 적성검사시작?: string; 적성검사종료?: string; 정지기간?: string; 정지사유?: string;
447
+ 재교부일자?: string; 재교부사유?: string;
448
+ subList?: unknown[];
449
+ 취득이력?: DrivingLicenseAcquisition[];
450
+ 조회결과?: string;
451
+ }
452
+ export interface DrivingLicenseResultPayload { drivingLicense: DrivingLicenseInfo; }
453
+
454
+ export interface HealthCheckupEntry { 검진연도: string; 검진종류: string; 검진일자: string; 검진기관: string; }
455
+ export interface HealthCheckupInfo { 이름: string; 건수: number; 검진내역: HealthCheckupEntry[]; }
456
+ export interface HealthCheckupResultPayload { healthCheckup: HealthCheckupInfo; }
457
+
458
+ export interface CashReceiptTotals { 건수: number; 사용금액: number; 소득공제건수: number; 소득공제금액: number; }
459
+ export interface CashReceiptEntry {
460
+ 거래일시: string; 가맹점: string; 금액: number; 승인번호: string;
461
+ 거래구분: string; 거래상태: string; 소득공제대상: boolean; 소득공제반영: boolean;
462
+ }
463
+ export interface CashReceiptYear { 귀속연도: string; 합계: CashReceiptTotals; 사용내역: CashReceiptEntry[]; }
464
+ export interface CashReceiptDeductionInfo { 조회연도: string[]; 전체합계: CashReceiptTotals; 연도별: CashReceiptYear[]; }
465
+ export interface CashReceiptDeductionResultPayload { cashReceiptDeduction: CashReceiptDeductionInfo; }
466
+
467
+ export interface TaxReturnEntry {
468
+ 신고일: string; 과세기간: string; 신고서: string; 신고구분: string; 신고상세: string;
469
+ 세목: string; 작성방법: string; 납부년월: string; 납부금액: number; 고지금액: number;
470
+ }
471
+ export interface TaxReturnHistoryInfo {
472
+ 조회기간: { 시작: string; 끝: string };
473
+ 합계: { 건수: number; 납부금액: number; 고지금액: number };
474
+ 신고내역: TaxReturnEntry[];
475
+ }
476
+ export interface TaxReturnHistoryResultPayload { taxReturnHistory: TaxReturnHistoryInfo; }
477
+
478
+ export interface YoutubeThumbnail { url: string; width: number; height: number; }
479
+ export interface YoutubeChapter { title: string; start_time: number | null; end_time: number | null; }
480
+ export interface YoutubeMetadata {
481
+ video_id: string; url: string; title: string | null; description: string;
482
+ channel: { id: string | null; name: string | null; url: string | null; handle: string | null; follower_count: number | null; is_verified: boolean };
483
+ upload_date: string | null; duration: number | null; view_count: number | null; like_count: number | null; comment_count: number | null;
484
+ categories: string[]; tags: string[]; language: string | null; live_status: string | null; availability: string | null;
485
+ age_limit: number | null; chapters: YoutubeChapter[]; thumbnail: string | null; thumbnails: YoutubeThumbnail[];
486
+ subtitle_languages: string[]; automatic_caption_count: number;
487
+ }
488
+ /** translated=true 인 자동 번역 자막은 유튜브 제한으로 받지 못할 수 있다. 수동 자막이나 원어 자동 자막을 권장한다. */
489
+ export interface YoutubeSubtitleTrack { lang: string; name: string | null; auto: boolean; formats: string[]; translated?: boolean; }
490
+ export interface YoutubeSubtitleList {
491
+ video_id: string; title: string | null; original_language: string | null;
492
+ subtitle_count: number; automatic_caption_count: number;
493
+ subtitles: YoutubeSubtitleTrack[]; automatic_captions: YoutubeSubtitleTrack[];
494
+ }
495
+ export interface YoutubeSubtitleOptions { format?: 'vtt' | 'srt' | 'txt'; type?: 'any' | 'manual' | 'auto'; }
496
+ export interface YoutubeChannelRef { id: string | null; name: string | null; url: string | null; handle: string | null; }
497
+ export interface YoutubeListItem {
498
+ type: 'video' | 'short' | 'channel' | 'playlist'; id: string; url: string; title: string | null; thumbnail: string | null;
499
+ description?: string | null; duration?: number | null; view_count?: number | null; live_status?: string | null; published_at?: string | null;
500
+ channel?: YoutubeChannelRef | null; handle?: string | null; follower_count?: number | null; is_verified?: boolean; video_count?: number | null;
501
+ }
502
+ export interface YoutubeSearchOptions {
503
+ count?: number; sort?: 'relevance' | 'date' | 'views' | 'rating'; type?: 'any' | 'video' | 'channel' | 'playlist' | 'movie';
504
+ uploadDate?: 'any' | 'hour' | 'today' | 'week' | 'month' | 'year'; duration?: 'any' | 'short' | 'medium' | 'long';
505
+ }
506
+ export interface YoutubeSearchResult { query: string; count: number; results: YoutubeListItem[]; }
507
+ export interface YoutubeChannelResult {
508
+ channel: YoutubeChannelRef & { description: string; follower_count: number | null; is_verified: boolean; tags: string[]; thumbnail: string | null };
509
+ tab: 'videos' | 'shorts' | 'streams' | 'playlists'; count: number; items: YoutubeListItem[];
510
+ }
511
+ export interface YoutubePlaylistResult {
512
+ playlist_id: string; url: string; title: string | null; description: string; channel: YoutubeChannelRef | null;
513
+ video_count: number | null; view_count: number | null; modified_date: string | null; count: number; videos: YoutubeListItem[];
514
+ }
515
+ export interface YoutubeHashtagResult { hashtag: string; count: number; videos: YoutubeListItem[]; }
516
+ export interface YoutubeComment {
517
+ id: string; parent_id: string | null; text: string; author: string | null; author_channel_id: string | null; author_url: string | null; author_thumbnail: string | null;
518
+ author_is_uploader: boolean; author_is_verified: boolean; like_count: number | null; is_pinned: boolean; is_hearted: boolean; published_at: string | null;
519
+ }
520
+ export interface YoutubeComments { video_id: string; title: string | null; sort: 'top' | 'new'; include_replies: boolean; count: number; comments: YoutubeComment[]; }
521
+ export interface YoutubeCommentsOptions { count?: number; sort?: 'top' | 'new'; replies?: boolean; }
522
+ /** @deprecated Retired APICK voice IDs. Query listGeminiTtsVoices or listOpenAiTtsVoices. */
523
+ export const TTS_VOICE_IDS: readonly [
524
+ 'v2_ann_m_30s_01', 'v2_ann_m_30s_02', 'v2_ann_m_30s_04', 'v2_ann_m_30s_05', 'v2_ann_f_30s_02', 'v2_ann_f_30s_03', 'v2_ann_f_30s_04', 'v2_ann_f_30s_05', 'v2_m_teen_01', 'v2_m_young_01', 'v2_m_mid_01', 'v2_m_senior_01', 'v2_f_young_01', 'v2_f_senior_01'
525
+ ];
526
+ export type TtsVoiceId = string;
527
+ /** @deprecated Automatic fallback is no longer supported. */
528
+ export type TtsFallbackPolicy = 'never' | 'queue_full' | 'busy';
529
+ export interface TtsFallbackOptions { voice_id?: string; style?: string; }
530
+ /** @deprecated Retired APICK request shape. Use GeminiTtsInput or OpenAiTtsInput. */
531
+ export interface ApickTtsInput { voice_id: TtsVoiceId; text?: string; utterances?: Array<{text:string;emotion?:string;speed?:number;pause_after_ms?:number}>; normalize_text?:boolean; fallback_policy?:TtsFallbackPolicy; fallback_options?:TtsFallbackOptions; }
532
+ export interface TtsStyleOptions { style?:string; emotion?:'neutral'|'calm'|'cheerful'|'excited'|'sad'|'serious'|'friendly'|'empathetic'|'confident'|'gentle'|'whisper'|'narration'; tone?:'narration'|'news'|'audiobook'|'documentary'|'ad'|'conversation'|'announcement'|'tutorial'|'storytelling'; accent?:'standard'|'seoul'|'gyeongsang'|'jeolla'|'chungcheong'; pace?:number; pitch?:number; volume_gain_db?:number; }
533
+ export interface TtsSpeakerOptions extends TtsStyleOptions { voice_id?:string; }
534
+ export interface TtsUtterance extends TtsSpeakerOptions { text:string; speaker?:string; }
535
+ export interface GeminiTtsInput extends TtsStyleOptions { voice_id?:string; text?:string; utterances?:TtsUtterance[]; speakers?:Record<string,TtsSpeakerOptions>; multi_speaker?:boolean; normalize_text?:boolean; language_code?:'ko'|'ko-KR'; }
536
+ export interface OpenAiTtsInput extends GeminiTtsInput {}
537
+ export interface TtsOptions { voiceId?:TtsVoiceId; normalizeText?:boolean; idempotencyKey?:string; }
538
+ export interface GeminiTtsVoice { voice_id:string; name:string; gender:string|null; tone:string; age_band:string|null; age_years?:number|null; age_verified?:boolean; age_basis?:'catalog_description'|'reviewed'; age_source?:string; description?:string; language_code?:string|null; reviewed_at?:string; library:string; }
539
+ export interface TtsQuote { synthesis:number; normalization:number; estimated_total:number; maximum:number; synthesis_maximum:number; normalization_maximum:number; estimated_only:true; currency:'POINT'; fallback_price_may_change:boolean; }
540
+
541
+ export interface TtsJobData {
542
+ job_id: string;
543
+ status: 'waiting' | 'processing' | 'completed' | 'cancelled' | 'failed';
544
+ voice_id?: string;
545
+ synthesis?: {engine:'apick'|'gemini'|'openai';model:string;voice_id:string;fallback_reason:string|null;age_verified:boolean;notice:string|null};
546
+ normalization?: {enabled:boolean;run_id:string|null;status:string;skill_id:string|null};
547
+ billing?: {status:string;synthesis:number;skill:number;total:number;reserved:number;refunded:number;released:number;currency:'POINT'};
548
+ expires_at?:string|null;
549
+ character_count?: number;
550
+ result_available?: boolean;
551
+ subtitles_available?: boolean;
552
+ resume_revision?: number;
553
+ operation_revision?: number;
554
+ quality?: TtsQualityData | null;
555
+ }
556
+
557
+ export interface TtsQualityData {
558
+ job_id?: string;
559
+ resume_revision?: number;
560
+ phase?: string;
561
+ accepted_utterances?: number;
562
+ failed_utterances?: number;
563
+ total_utterances?: number;
564
+ utterances?: Array<{ id: string; status: string; attempt?: number; reasons?: string[];
565
+ speech_rate?: { chars: number; duration_sec: number; cps: number; expected_sec: number; duration_ratio: number | null; status: string } }>;
566
+ candidates?: Array<{ candidate_id: string; utterance_id: string; status: string; attempt: number; audio_available?: boolean }>;
567
+ }
568
+
569
+ export class ApickApiError extends Error {
570
+ readonly status: number;
571
+ readonly code: string;
572
+ readonly serviceCode?: string;
573
+ /** Skills 오류의 부가 정보. 예: INVALID_INPUT 의 `errors` 목록 */
574
+ readonly details?: Record<string, unknown>;
575
+ toJSON(): {
576
+ name: string;
577
+ message: string;
578
+ status: number;
579
+ code: string;
580
+ serviceCode?: string;
581
+ };
582
+ }
583
+
584
+ export class ApickBinaryResult {
585
+ readonly bytes: Uint8Array;
586
+ readonly contentType: string;
587
+ readonly filename: string;
588
+ readonly meta: ApickMeta;
589
+ readonly size: number;
590
+ toArrayBuffer(): ArrayBuffer;
591
+ toBlob(): Blob;
592
+ save(filePath: string): Promise<string>;
593
+ }
594
+
595
+ export const DEFAULT_BASE_URL: 'https://apick.app';
596
+
597
+ export const SERVICES: Readonly<Record<string, Readonly<{
598
+ endpoint: string;
599
+ output: 'json' | 'binary';
600
+ }>>>;
601
+
602
+ export class ApickClient {
603
+ createVideoJob(model: VideoModel, prompt: string, options?: VideoJobOptions): Promise<ApickResult<VideoJobData>>;
604
+ getVideoJob(model: VideoModel, jobId: string): Promise<ApickResult<VideoJobData>>;
605
+ downloadVideoResult(model: VideoModel, jobId: string): Promise<ApickBinaryResult>;
606
+ constructor(apiKeyOrOptions: string | ApickClientOptions);
607
+ businessDetails(businessNumber: string): Promise<ApickResult>;
608
+ ventureBusiness(businessNumber: string): Promise<ApickResult>;
609
+ trackParcel(carrier: string, trackingNumber: string): Promise<ApickResult>;
610
+ trackParcelAuto(trackingNumber: string): Promise<ApickResult>;
611
+ validateEmail(email: string): Promise<ApickResult>;
612
+ validatePhone(number: string): Promise<ApickResult>;
613
+ holidays(year: number | string, month: number | string): Promise<ApickResult>;
614
+ searchAddress(query: string, options?: { page?: number }): Promise<ApickResult>;
615
+ ocr(image: string | BinaryInput | ArrayBuffer | ArrayBufferView, options?: OcrOptions): Promise<ApickResult>;
616
+ maskResidentNumber(image: string | BinaryInput | ArrayBuffer | ArrayBufferView, options: MaskResidentNumberOptions): Promise<ApickBinaryResult>;
617
+ maskResidenceCard(image: string | BinaryInput | ArrayBuffer | ArrayBufferView, options?: OcrOptions): Promise<ApickResult>;
618
+ maskPassport(image: string | BinaryInput | ArrayBuffer | ArrayBufferView, options?: OcrOptions): Promise<ApickResult>;
619
+ maskIdCard(image: string | BinaryInput | ArrayBuffer | ArrayBufferView, options?: OcrOptions): Promise<ApickResult>;
620
+ maskDriverLicense(image: string | BinaryInput | ArrayBuffer | ArrayBufferView, options?: OcrOptions): Promise<ApickResult>;
621
+ dnsLookup(domain: string): Promise<ApickResult>;
622
+ geolocate(address: string): Promise<ApickResult>;
623
+ whois(address: string): Promise<ApickResult>;
624
+ googleSearch(keyword: string, options?: { page?: number }): Promise<ApickResult>;
625
+ googleImageSearch(keyword: string, options?: { page?: number }): Promise<ApickResult>;
626
+ googleNewsSearch(keyword: string, options?: { page?: number }): Promise<ApickResult<SearchList<NewsItem>>>;
627
+ googleShoppingSearch(keyword: string, options?: { page?: number }): Promise<ApickResult<SearchList<ShoppingItem>>>;
628
+ googleMapsSearch(keyword: string): Promise<ApickResult<SearchList<PlaceItem>>>;
629
+ googleRankCheck(keyword: string, domain: string): Promise<ApickResult<RankCheck>>;
630
+ instagramProfile(usernameOrUrl: string): Promise<ApickResult<InstagramProfile>>;
631
+ instagramPost(url: string): Promise<ApickResult<InstagramPost>>;
632
+ tiktokProfile(usernameOrUrl: string): Promise<ApickResult<TiktokProfile>>;
633
+ amazonProduct(urlOrAsin: string): Promise<ApickResult<AmazonProduct>>;
634
+ xProfile(usernameOrUrl: string): Promise<ApickResult<XProfile>>;
635
+ xPost(url: string): Promise<ApickResult<XPost>>;
636
+ createInstagramPostsJob(usernameOrUrl: string, options?: ScrapeJobOptions): Promise<ApickResult<ScrapeJob<InstagramPost>>>;
637
+ createInstagramCommentsJob(url: string, options?: ScrapeJobOptions): Promise<ApickResult<ScrapeJob<SocialComment>>>;
638
+ createTiktokSearchJob(keyword: string, options?: ScrapeJobOptions): Promise<ApickResult<ScrapeJob<TiktokVideo>>>;
639
+ createTiktokVideoJob(url: string, options?: Pick<ScrapeJobOptions, "idempotencyKey">): Promise<ApickResult<ScrapeJob<TiktokVideo>>>;
640
+ createTiktokCommentsJob(url: string, options?: ScrapeJobOptions): Promise<ApickResult<ScrapeJob<SocialComment>>>;
641
+ createAmazonReviewsJob(urlOrAsin: string, options?: ScrapeJobOptions): Promise<ApickResult<ScrapeJob<AmazonReview>>>;
642
+ createGoogleMapsPlaceJob(placeIdOrUrl: string, options?: Pick<ScrapeJobOptions, "idempotencyKey">): Promise<ApickResult<ScrapeJob<GoogleMapsPlace>>>;
643
+ getScrapeJob<T = unknown>(jobId: string): Promise<ApickResult<ScrapeJob<T>>>;
644
+ waitForScrapeJob<T = unknown>(jobId: string, options?: { intervalMs?: number; timeoutMs?: number }): Promise<ApickResult<ScrapeJob<T>>>;
645
+ screenshot(url: string): Promise<ApickBinaryResult>;
646
+ youtubeMetadata(url: string): Promise<ApickResult<YoutubeMetadata>>;
647
+ youtubeThumbnail(url: string): Promise<ApickBinaryResult>;
648
+ youtubeSubtitleList(url: string): Promise<ApickResult<YoutubeSubtitleList>>;
649
+ youtubeSubtitle(url: string, lang: string, options?: YoutubeSubtitleOptions): Promise<ApickBinaryResult>;
650
+ youtubeSearch(query: string, options?: YoutubeSearchOptions): Promise<ApickResult<YoutubeSearchResult>>;
651
+ youtubeChannel(channel: string, options?: { tab?: 'videos' | 'shorts' | 'streams' | 'playlists'; count?: number }): Promise<ApickResult<YoutubeChannelResult>>;
652
+ youtubePlaylist(url: string, options?: { count?: number }): Promise<ApickResult<YoutubePlaylistResult>>;
653
+ youtubeHashtag(hashtag: string, options?: { count?: number }): Promise<ApickResult<YoutubeHashtagResult>>;
654
+ youtubeComments(url: string, options?: YoutubeCommentsOptions): Promise<ApickResult<YoutubeComments>>;
655
+ createTtsJob(text: string | GeminiTtsInput, options?: TtsOptions): Promise<ApickResult<TtsJobData>>;
656
+ createGeminiTtsJob(input:GeminiTtsInput, options?:{idempotencyKey?:string}):Promise<ApickResult<TtsJobData>>;
657
+ listGeminiTtsVoices():Promise<ApickResult<{voices:GeminiTtsVoice[];complete:boolean;checked_at:string|null}>>;
658
+ createOpenAiTtsJob(input:OpenAiTtsInput, options?:{idempotencyKey?:string}):Promise<ApickResult<TtsJobData>>;
659
+ listOpenAiTtsVoices():Promise<ApickResult<{voices:GeminiTtsVoice[];complete:boolean;checked_at:string|null}>>;
660
+ getTtsOptions():Promise<ApickResult<{engines:Record<'gemini'|'openai',Record<string,unknown>>}>>;
661
+ quoteTts(input:GeminiTtsInput&{engine?:'gemini'|'openai'}):Promise<ApickResult<TtsQuote>>;
662
+ getTtsJob(jobId: string): Promise<ApickResult<TtsJobData>>;
663
+ cancelTtsJob(jobId: string): Promise<ApickResult<TtsJobData>>;
664
+ downloadTtsResult(jobId: string): Promise<ApickBinaryResult>;
665
+ downloadTtsSubtitles(jobId: string): Promise<ApickBinaryResult>;
666
+ /** @deprecated Retired endpoint; the service returns HTTP 409. */
667
+ getTtsQuality(jobId: string): Promise<ApickResult<TtsQualityData>>;
668
+ /** @deprecated Retired endpoint; the service returns HTTP 409. */
669
+ retryTtsJob(jobId: string, utteranceIds: string[], idempotencyKey: string): Promise<ApickResult<TtsJobData>>;
670
+ /** @deprecated Retired endpoint; the service returns HTTP 409. */
671
+ downloadTtsCandidate(jobId: string, candidateId: string): Promise<ApickBinaryResult>;
672
+ htmlToPdf(html: string, options?: { pagination?: boolean }): Promise<ApickBinaryResult>;
673
+ jsonToExcel(data: unknown[], options?: { sheetName?: string }): Promise<ApickBinaryResult>;
674
+ summarize(text: string): Promise<ApickResult>;
675
+ polish(text: string): Promise<ApickResult>;
676
+ generateImages(prompt:string, options?:ImageAiGenerateOptions): Promise<ApickResult<ImageAiResultData|ImageAiPendingData>>;
677
+ editImages(image:string|BinaryInput|ArrayBuffer|ArrayBufferView, prompt:string, options?:ImageAiEditOptions): Promise<ApickResult<ImageAiResultData|ImageAiPendingData>>;
678
+ createImageGenerationJob(prompt:string, options?:ImageAiGenerateOptions): Promise<ApickResult<ImageAiJobData>>;
679
+ createImageEditJob(image:string|BinaryInput|ArrayBuffer|ArrayBufferView, prompt:string, options?:ImageAiEditOptions): Promise<ApickResult<ImageAiJobData>>;
680
+ getImageJob(jobId:string): Promise<ApickResult<ImageAiJobData>>;
681
+ downloadImageJobImage(jobId:string,index:number): Promise<ApickBinaryResult>;
682
+ downloadImageJobArchive(jobId:string): Promise<ApickBinaryResult>;
683
+ requestEmployment(input: RequestEmploymentInput): Promise<ApickResult<DataRequestAcceptedData>>;
684
+ getEmployment(transactionId: string): Promise<ApickResult<DataRequestResult<EmploymentResultPayload>>>;
685
+ requestPersonalIncome(input: RequestPersonalIncomeInput): Promise<ApickResult<DataRequestAcceptedData>>;
686
+ getPersonalIncome(transactionId: string): Promise<ApickResult<DataRequestResult<PersonalIncomeResultPayload>>>;
687
+ requestNpsJoinHistory(input: RequestNpsJoinHistoryInput): Promise<ApickResult<DataRequestAcceptedData>>;
688
+ getNpsJoinHistory(transactionId: string): Promise<ApickResult<DataRequestResult<NpsJoinHistoryResultPayload>>>;
689
+ requestDrivingLicense(input: RequestDrivingLicenseInput): Promise<ApickResult<DataRequestAcceptedData>>;
690
+ getDrivingLicense(transactionId: string): Promise<ApickResult<DataRequestResult<DrivingLicenseResultPayload>>>;
691
+ requestHealthCheckup(input: RequestHealthCheckupInput): Promise<ApickResult<DataRequestAcceptedData>>;
692
+ getHealthCheckup(transactionId: string): Promise<ApickResult<DataRequestResult<HealthCheckupResultPayload>>>;
693
+ requestCashReceiptDeduction(input: RequestCashReceiptDeductionInput): Promise<ApickResult<DataRequestAcceptedData>>;
694
+ getCashReceiptDeduction(transactionId: string): Promise<ApickResult<DataRequestResult<CashReceiptDeductionResultPayload>>>;
695
+ requestTaxReturnHistory(input: RequestTaxReturnHistoryInput): Promise<ApickResult<DataRequestAcceptedData>>;
696
+ getTaxReturnHistory(transactionId: string): Promise<ApickResult<DataRequestResult<TaxReturnHistoryResultPayload>>>;
697
+ searchSkills(options?: SkillSearchOptions): Promise<ApickResult<SkillPage<SkillSummary>>>;
698
+ /** Public measured results and methods; model scores are not accuracy guarantees. */
699
+ getSkillPerformance(): Promise<ApickResult<SkillPerformanceReport>>;
700
+ subagentStatus(): Promise<ApickResult<Record<string, unknown>>>;
701
+ subagentUsage(): Promise<ApickResult<Record<string, unknown>>>;
702
+ createSubagentFile(input: {path:string;bytes:number;sha256:string;retention?:'seven_days'|'none'}): Promise<ApickResult<SubagentFile>>;
703
+ getSubagentFile(fileId:string): Promise<ApickResult<SubagentFile>>;
704
+ uploadSubagentPart(fileId:string,partNo:number,data:string): Promise<ApickResult<Record<string,unknown>>>;
705
+ completeSubagentFile(fileId:string): Promise<ApickResult<SubagentFile>>;
706
+ deleteSubagentFile(fileId:string): Promise<ApickResult<Record<string,unknown>>>;
707
+ dispatchSubagent(input:SubagentTask,options:{idempotencyKey:string}): Promise<ApickResult<SubagentJob>>;
708
+ collectSubagent(jobId:string,options?:{cursor?:string}): Promise<ApickResult<SubagentJob>>;
709
+ subagentEvidence(jobId:string,evidenceIds:string[]): Promise<ApickResult<Record<string,unknown>>>;
710
+ reviewSubagent(jobId:string,resultHash:string,decision:'accepted'|'rejected'): Promise<ApickResult<Record<string,unknown>>>;
711
+ cancelSubagent(jobId:string): Promise<ApickResult<SubagentJob>>;
712
+ deleteSubagentJob(jobId:string): Promise<ApickResult<Record<string,unknown>>>;
713
+ getSkill(skillId: string): Promise<ApickResult<SkillDetail>>;
714
+ quoteSkill(skillId: string, input: Record<string, unknown>, options?: { version?: string }): Promise<ApickResult<SkillQuote>>;
715
+ runSkill<T = Record<string, unknown>>(skillId: string, input: Record<string, unknown>, options: SkillRunOptions): Promise<ApickResult<SkillRun<T>>>;
716
+ getSkillRun<T = Record<string, unknown>>(runId: string): Promise<ApickResult<SkillRun<T>>>;
717
+ getSkillRunResult<T = Record<string, unknown>>(runId: string): Promise<ApickResult<SkillRunResult<T>>>;
718
+ /** 본인 실행의 결과 파일을 인증해 내려받습니다. / Download an artifact owned by this API key. */
719
+ getSkillArtifact(runId: string, fileId: string): Promise<ApickBinaryResult>;
720
+ cancelSkillRun(runId: string): Promise<ApickResult<SkillRun>>;
721
+ skillUsage(options?: { cursor?: string; limit?: number }): Promise<ApickResult<SkillPage<SkillRun>>>;
722
+ }
723
+
724
+ export const SKILL_CATEGORIES: readonly ['data', 'ai', 'dev', 'document', 'marketing', 'finance', 'productivity', 'video', 'etc'];
725
+ export type SkillCategory = typeof SKILL_CATEGORIES[number];
726
+ /** 검색 순서. 생략하면 등록 순서 / search order; registration order when omitted */
727
+ export const SKILL_SORTS: readonly ['recommended', 'popular', 'used', 'likes', 'rating', 'new', 'mine', 'liked'];
728
+ export type SkillSort = typeof SKILL_SORTS[number];
729
+ export interface SkillPerformanceRate {
730
+ passed: number; total: number; percent: number; interval95: [number, number];
731
+ }
732
+ export interface SkillPerformanceReport {
733
+ schema_version: 1;
734
+ updated_at: string;
735
+ inventory_verified: boolean;
736
+ method: { minimum_cases: number; min_score: number; mean_score: number; min_improvement: number; critical_failures: number; description: string; limitations: string[]; interval_note: string; split: { normal: number; boundary: number; adversarial: number } };
737
+ calibration: { at: string; cases: number; true_positive: number; false_negative: number; false_positive: number; true_negative: number; automatic_release_allowed: boolean } | null;
738
+ additional_calibrations: Array<{ label: string; at: string; cases: number; detected: number; missed: number; false_positive: number; uncertain: number; automatic_release_allowed: boolean; scope: string }>;
739
+ skills: Array<{
740
+ key: string; title: string; group: string; origin: 'new' | 'existing'; published: boolean | null; url: string | null;
741
+ current: {
742
+ state: 'not_tested' | 'partial' | 'held' | 'passed' | 'stale'; at?: string;
743
+ cases: number; planned_cases: number; score: number | null; baseline_score: number | null;
744
+ score_samples?: number; evaluation_errors?: number;
745
+ delivery: SkillPerformanceRate | null; machine: SkillPerformanceRate | null;
746
+ median_seconds: number | null; p95_seconds: number | null; timing_samples?: number;
747
+ reasons: string[]; method?: string; sample_type?: string;
748
+ baseline_format_valid?: boolean;
749
+ evaluation_stage?: 'preliminary' | 'holdout';
750
+ dataset_composition?: { normal: number; boundary: number; adversarial: number; misplaced_rejections: number; valid: boolean };
751
+ min_score?: number | null; critical_cases?: number | null;
752
+ case_split?: { standard: number; boundary: number; adversarial: number };
753
+ extra_checks?: Array<{ name: string; passed: number; total: number }>;
754
+ tool_calls?: Array<{ label: string; samples: number; total: number | null; median: number | null; p95: number | null }>;
755
+ case_results?: Array<{ index: number; name: string; kind: 'standard' | 'boundary' | 'adversarial'; status: 'tested' | 'evaluation_error' | 'machine_only' | 'not_tested'; expected: 'success' | 'reject' | null; machine_pass: boolean; score: number | null; baseline_score: number | null; failed_checks: string[]; reason: string | null }>;
756
+ };
757
+ legacy: { cases: number; score: number; baseline_score: number; method: string; independent_holdout: false; at?: string } | null;
758
+ }>;
759
+ }
760
+ export type SkillRunStatus = 'queued' | 'running' | 'completing' | 'succeeded' | 'failed' | 'timed_out' | 'cancelled';
761
+ export type SkillBillingStatus = 'reserved' | 'captured' | 'released' | 'partially_refunded' | 'refunded';
762
+ export type SkillFailureCode = 'EXECUTION_FAILED' | 'OUTPUT_INVALID' | 'TIMED_OUT' | 'CANCELLED' | 'UPSTREAM_UNAVAILABLE';
763
+ /** `ApickApiError.serviceCode` 로 돌아오는 Skills 오류 코드 */
764
+ export type SkillErrorCode =
765
+ | 'INVALID_INPUT' | 'AUTH_REQUIRED' | 'NOT_ALLOWED' | 'PAYMENT_REQUIRED' | 'SKILL_OR_RUN_NOT_FOUND'
766
+ | 'IDEMPOTENCY_KEY_REQUIRED' | 'IDEMPOTENCY_CONFLICT' | 'QUOTE_EXPIRED' | 'VERSION_UNAVAILABLE'
767
+ | 'PRICE_EXCEEDS_LIMIT' | 'RUN_NOT_CANCELLABLE' | 'RESULT_NOT_READY' | 'RESULT_EXPIRED'
768
+ | 'INSUFFICIENT_POINTS' | 'RATE_LIMITED' | 'BUDGET_EXCEEDED' | 'TEMPORARILY_UNAVAILABLE';
769
+ export interface SkillSearchOptions {
770
+ query?: string; category?: SkillCategory;
771
+ /** `mine`·`liked` 는 인증키의 계정 기준 / `mine` and `liked` are scoped to the API key's account */
772
+ sort?: SkillSort;
773
+ cursor?: string; limit?: number;
774
+ }
775
+ export interface SkillRunOptions {
776
+ /** 이 실행을 구분하는 고유 값. 재시도할 때 같은 값을 씁니다. 영문·숫자와 `. _ : -` 1~128자 */
777
+ idempotencyKey: string;
778
+ version?: string;
779
+ quoteId?: string;
780
+ /** 가격이 이 값보다 높으면 실행하지 않습니다 */
781
+ maxCostPoints?: number;
782
+ /** 결과를 기다릴 시간(0~20초, 기본 20) */
783
+ waitSeconds?: number;
784
+ }
785
+ export interface SkillPage<T> { items: T[]; next_cursor: string | null; }
786
+ export interface SkillLimits { max_input_chars: number; timeout_seconds: number; }
787
+ export interface SkillSummary {
788
+ execution_info?: SkillExecutionInfo;
789
+ price_label?: string;
790
+ skill_id: string; slug: string; title: string; summary: string;
791
+ category: SkillCategory; category_label: string; version: string;
792
+ /** 실행마다 같은 기본 금액 / base amount charged on every run */
793
+ price_points: number;
794
+ /** 사용량까지 더한 예상 금액 / estimated amount including usage */
795
+ estimated_points: number | null;
796
+ /** true 면 실행마다 실제 사용량만큼 금액이 달라집니다 / amount varies per run with actual usage */
797
+ usage_priced: boolean;
798
+ seller: { name: string }; uses_generative_ai: boolean;
799
+ /** 사용 건수 구간. 예: `1,000회 미만`, `1,000+`, `1만+` / usage tier label, not an exact count */
800
+ usage_label: string;
801
+ like_count: number;
802
+ review_count: number;
803
+ /** 평점(1~5, 소수 첫째 자리). 리뷰가 없으면 null / average rating, null without reviews */
804
+ rating_average: number | null;
805
+ }
806
+ export interface SkillDetail extends SkillSummary {
807
+ description: string; billing_rule: 'validated_result' | 'subagent_usage'; limits: SkillLimits | null;
808
+ delivery?: 'installed_agent'; installation?: {package:string;command:string;api_key_env:string;guide:string;usage:string};
809
+ billing?: {markup_percent:number;installation_points:number;base_points:number;complete_cache_points:number;quota:null};
810
+ input_schema: Record<string, unknown>; output_schema: Record<string, unknown>;
811
+ examples: unknown[]; stats: Record<string, unknown> | null; published_at: string | null;
812
+ }
813
+ export interface SkillQuote {
814
+ execution_info?: SkillExecutionInfo;
815
+ quote_id: string; skill_id: string; version: string; price_points: number;
816
+ /** 이 입력의 예상 금액 / estimated amount for this input */
817
+ estimated_points: number;
818
+ /** 예약되는 최대 금액. 실제 차감액은 이 값을 넘지 않습니다 / maximum amount reserved; the charge never exceeds it */
819
+ max_points: number;
820
+ usage_priced: boolean;
821
+ expires_at: string; limits: SkillLimits; billing_rule: 'validated_result';
822
+ }
823
+ export interface SkillBilling { status: SkillBillingStatus; reserved_points: number; charged_points: number; refunded_points: number; }
824
+ export interface SkillExecutionInfo {
825
+ price_range: { min_points: number; max_points: number; variable: boolean };
826
+ duration: { min_seconds: number; max_seconds: number; basis: string };
827
+ tools: Array<{ name: string; typical_calls: number | string; max_calls: number | string; min_calls?: number }>;
828
+ billing_note: string;
829
+ }
830
+ export interface SkillArtifact {
831
+ id: string; name: string; mime_type: string; url: string; sha256: string; bytes: number;
832
+ label?: string; width?: number; height?: number; seconds?: number;
833
+ }
834
+ export interface SkillRun<T = Record<string, unknown>> {
835
+ run_id: string; status: SkillRunStatus;
836
+ skill: { id: string; version: string; title?: string };
837
+ billing: SkillBilling; created_at: string | null; completed_at: string | null;
838
+ links: { self: string; result?: string };
839
+ failure_code?: SkillFailureCode; result_expires_at?: string | null;
840
+ /** status 가 succeeded 일 때만 */
841
+ result?: T;
842
+ }
843
+ export interface SkillRunResult<T = Record<string, unknown>> {
844
+ run_id: string; skill: { id: string; version: string; title?: string };
845
+ result: T; result_expires_at: string | null;
846
+ }
847
+
848
+ export default ApickClient;
849
+
850
+ export type VideoModel = 'seedance' | 'veo' | 'kling';
851
+ export interface VideoJobOptions {
852
+ version?: string; tier?: string; mode?: 'text' | 'image' | 'reference'; duration?: number;
853
+ aspectRatio?: string; resolution?: string; audio?: boolean; negativePrompt?: string;
854
+ seed?: number; cfgScale?: number; idempotencyKey?: string;
855
+ image?: string | BinaryInput | ArrayBuffer | ArrayBufferView;
856
+ lastImage?: string | BinaryInput | ArrayBuffer | ArrayBufferView;
857
+ referenceImages?: Array<string | BinaryInput | ArrayBuffer | ArrayBufferView>;
858
+ referenceVideos?: Array<string | BinaryInput>;
859
+ referenceAudios?: Array<string | BinaryInput>;
860
+ }
861
+ export interface VideoJobData {
862
+ job_id: string; model: VideoModel; version: string; mode: string; tier: string;
863
+ status: 'waiting' | 'processing' | 'completed' | 'failed' | 'cancelled';
864
+ duration: number; resolution?: string; audio?: boolean; point_per_second?: number;
865
+ charged_point?: number; result_available?: boolean; result_url?: string;
866
+ result_expires_at?: string | null; idempotent_replay?: boolean;
867
+ error?: { code: string; message: string };
868
+ }
869
+
870
+ export interface SubagentTask { kind:'inventory'|'extract'|'summarize'|'compare';goal:string;file_ids:string[];focus?:string[];acceptance?:string[];retention?:'seven_days'|'none'; }
871
+ export interface SubagentFile { file_id:string;path:string;sha256:string;bytes:number;state:string;expires_at:string;part_bytes?:number; }
872
+ export interface SubagentJob { job_id:string;kind:SubagentTask['kind'];state:string;billing_state:string;cache_hit:boolean;reserved_points:number;charged_points:number;accrued_points:string;result_hash?:string;result?:Record<string,unknown>; }