influship 0.2.0 → 0.3.2
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/CHANGELOG.md +62 -30
- package/LICENSE +1 -1
- package/README.md +88 -43
- package/client.d.mts +49 -29
- package/client.d.mts.map +1 -1
- package/client.d.ts +49 -29
- package/client.d.ts.map +1 -1
- package/client.js +89 -56
- package/client.js.map +1 -1
- package/client.mjs +89 -56
- package/client.mjs.map +1 -1
- package/core/api-promise.d.mts +2 -2
- package/core/api-promise.d.mts.map +1 -1
- package/core/api-promise.d.ts +2 -2
- package/core/api-promise.d.ts.map +1 -1
- package/core/api-promise.js.map +1 -1
- package/core/api-promise.mjs.map +1 -1
- package/core/error.d.mts +2 -2
- package/core/error.d.mts.map +1 -1
- package/core/error.d.ts +2 -2
- package/core/error.d.ts.map +1 -1
- package/core/error.js +4 -4
- package/core/error.js.map +1 -1
- package/core/error.mjs +2 -2
- package/core/error.mjs.map +1 -1
- package/core/pagination.d.mts +75 -0
- package/core/pagination.d.mts.map +1 -0
- package/core/pagination.d.ts +75 -0
- package/core/pagination.d.ts.map +1 -0
- package/core/pagination.js +139 -0
- package/core/pagination.js.map +1 -0
- package/core/pagination.mjs +132 -0
- package/core/pagination.mjs.map +1 -0
- package/core/resource.d.mts +3 -3
- package/core/resource.d.mts.map +1 -1
- package/core/resource.d.ts +3 -3
- package/core/resource.d.ts.map +1 -1
- package/core/resource.js.map +1 -1
- package/core/resource.mjs.map +1 -1
- package/index.d.mts +4 -3
- package/index.d.mts.map +1 -1
- package/index.d.ts +4 -3
- package/index.d.ts.map +1 -1
- package/index.js +6 -4
- package/index.js.map +1 -1
- package/index.mjs +4 -3
- package/index.mjs.map +1 -1
- package/internal/parse.d.mts +2 -2
- package/internal/parse.d.mts.map +1 -1
- package/internal/parse.d.ts +2 -2
- package/internal/parse.d.ts.map +1 -1
- package/internal/parse.js +5 -0
- package/internal/parse.js.map +1 -1
- package/internal/parse.mjs +5 -0
- package/internal/parse.mjs.map +1 -1
- package/internal/shims.js +1 -1
- package/internal/shims.js.map +1 -1
- package/internal/shims.mjs +1 -1
- package/internal/shims.mjs.map +1 -1
- package/internal/tslib.js +17 -17
- package/internal/uploads.d.mts +4 -4
- package/internal/uploads.d.mts.map +1 -1
- package/internal/uploads.d.ts +4 -4
- package/internal/uploads.d.ts.map +1 -1
- package/internal/uploads.js.map +1 -1
- package/internal/uploads.mjs.map +1 -1
- package/internal/utils/base64.js +2 -2
- package/internal/utils/base64.js.map +1 -1
- package/internal/utils/base64.mjs +3 -3
- package/internal/utils/base64.mjs.map +1 -1
- package/internal/utils/log.d.mts +3 -3
- package/internal/utils/log.d.mts.map +1 -1
- package/internal/utils/log.d.ts +3 -3
- package/internal/utils/log.d.ts.map +1 -1
- package/internal/utils/log.js.map +1 -1
- package/internal/utils/log.mjs.map +1 -1
- package/internal/utils/path.js +1 -1
- package/internal/utils/path.js.map +1 -1
- package/internal/utils/path.mjs +2 -2
- package/internal/utils/path.mjs.map +1 -1
- package/internal/utils/query.d.mts +2 -0
- package/internal/utils/query.d.mts.map +1 -0
- package/internal/utils/query.d.ts +2 -0
- package/internal/utils/query.d.ts.map +1 -0
- package/internal/utils/query.js +10 -0
- package/internal/utils/query.js.map +1 -0
- package/internal/utils/query.mjs +6 -0
- package/internal/utils/query.mjs.map +1 -0
- package/internal/utils/values.js +5 -5
- package/internal/utils/values.js.map +1 -1
- package/internal/utils/values.mjs +6 -6
- package/internal/utils/values.mjs.map +1 -1
- package/internal/utils.d.mts +1 -0
- package/internal/utils.d.ts +1 -0
- package/internal/utils.js +1 -0
- package/internal/utils.js.map +1 -1
- package/internal/utils.mjs +1 -0
- package/package.json +24 -3
- package/pagination.d.mts +2 -0
- package/pagination.d.mts.map +1 -0
- package/pagination.d.ts +2 -0
- package/pagination.d.ts.map +1 -0
- package/pagination.js +6 -0
- package/pagination.js.map +1 -0
- package/pagination.mjs +2 -0
- package/pagination.mjs.map +1 -0
- package/resources/creators.d.mts +326 -247
- package/resources/creators.d.mts.map +1 -1
- package/resources/creators.d.ts +326 -247
- package/resources/creators.d.ts.map +1 -1
- package/resources/creators.js +80 -63
- package/resources/creators.js.map +1 -1
- package/resources/creators.mjs +80 -63
- package/resources/creators.mjs.map +1 -1
- package/resources/health.d.mts +13 -1
- package/resources/health.d.mts.map +1 -1
- package/resources/health.d.ts +13 -1
- package/resources/health.d.ts.map +1 -1
- package/resources/health.js +4 -1
- package/resources/health.js.map +1 -1
- package/resources/health.mjs +4 -1
- package/resources/health.mjs.map +1 -1
- package/resources/index.d.mts +6 -7
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +6 -7
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +5 -7
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +2 -3
- package/resources/index.mjs.map +1 -1
- package/resources/posts.d.mts +82 -202
- package/resources/posts.d.mts.map +1 -1
- package/resources/posts.d.ts +82 -202
- package/resources/posts.d.ts.map +1 -1
- package/resources/posts.js +17 -38
- package/resources/posts.js.map +1 -1
- package/resources/posts.mjs +17 -38
- package/resources/posts.mjs.map +1 -1
- package/resources/profiles.d.mts +208 -58
- package/resources/profiles.d.mts.map +1 -1
- package/resources/profiles.d.ts +208 -58
- package/resources/profiles.d.ts.map +1 -1
- package/resources/profiles.js +37 -41
- package/resources/profiles.js.map +1 -1
- package/resources/profiles.mjs +37 -41
- package/resources/profiles.mjs.map +1 -1
- package/resources/raw/index.d.mts +4 -0
- package/resources/raw/index.d.mts.map +1 -0
- package/resources/raw/index.d.ts +4 -0
- package/resources/raw/index.d.ts.map +1 -0
- package/resources/raw/index.js +11 -0
- package/resources/raw/index.js.map +1 -0
- package/resources/raw/index.mjs +5 -0
- package/resources/raw/index.mjs.map +1 -0
- package/resources/raw/instagram.d.mts +215 -0
- package/resources/raw/instagram.d.mts.map +1 -0
- package/resources/raw/instagram.d.ts +215 -0
- package/resources/raw/instagram.d.ts.map +1 -0
- package/resources/raw/instagram.js +31 -0
- package/resources/raw/instagram.js.map +1 -0
- package/resources/raw/instagram.mjs +27 -0
- package/resources/raw/instagram.mjs.map +1 -0
- package/resources/raw/raw.d.mts +14 -0
- package/resources/raw/raw.d.mts.map +1 -0
- package/resources/raw/raw.d.ts +14 -0
- package/resources/raw/raw.d.ts.map +1 -0
- package/resources/raw/raw.js +21 -0
- package/resources/raw/raw.js.map +1 -0
- package/resources/raw/raw.mjs +16 -0
- package/resources/raw/raw.mjs.map +1 -0
- package/resources/raw/youtube.d.mts +455 -0
- package/resources/raw/youtube.d.mts.map +1 -0
- package/resources/raw/youtube.d.ts +455 -0
- package/resources/raw/youtube.d.ts.map +1 -0
- package/resources/raw/youtube.js +61 -0
- package/resources/raw/youtube.js.map +1 -0
- package/resources/raw/youtube.mjs +57 -0
- package/resources/raw/youtube.mjs.map +1 -0
- package/resources/raw.d.mts +2 -0
- package/resources/raw.d.mts.map +1 -0
- package/resources/raw.d.ts +2 -0
- package/resources/raw.d.ts.map +1 -0
- package/resources/raw.js +6 -0
- package/resources/raw.js.map +1 -0
- package/resources/raw.mjs +3 -0
- package/resources/raw.mjs.map +1 -0
- package/resources/search.d.mts +126 -117
- package/resources/search.d.mts.map +1 -1
- package/resources/search.d.ts +126 -117
- package/resources/search.d.ts.map +1 -1
- package/resources/search.js +46 -13
- package/resources/search.js.map +1 -1
- package/resources/search.mjs +46 -13
- package/resources/search.mjs.map +1 -1
- package/resources/shared.d.mts +55 -0
- package/resources/shared.d.mts.map +1 -0
- package/resources/shared.d.ts +55 -0
- package/resources/shared.d.ts.map +1 -0
- package/resources/shared.js +4 -0
- package/resources/shared.js.map +1 -0
- package/resources/shared.mjs +3 -0
- package/resources/shared.mjs.map +1 -0
- package/src/client.ts +153 -127
- package/src/core/api-promise.ts +4 -4
- package/src/core/error.ts +2 -2
- package/src/core/pagination.ts +232 -0
- package/src/core/resource.ts +3 -3
- package/src/index.ts +4 -3
- package/src/internal/parse.ts +8 -2
- package/src/internal/shims.ts +1 -1
- package/src/internal/uploads.ts +5 -5
- package/src/internal/utils/base64.ts +3 -3
- package/src/internal/utils/log.ts +3 -3
- package/src/internal/utils/path.ts +2 -2
- package/src/internal/utils/query.ts +7 -0
- package/src/internal/utils/values.ts +6 -6
- package/src/internal/utils.ts +1 -0
- package/src/pagination.ts +2 -0
- package/src/resources/creators.ts +369 -271
- package/src/resources/health.ts +13 -1
- package/src/resources/index.ts +22 -41
- package/src/resources/posts.ts +89 -232
- package/src/resources/profiles.ts +252 -59
- package/src/resources/raw/index.ts +16 -0
- package/src/resources/raw/instagram.ts +271 -0
- package/src/resources/raw/raw.ts +47 -0
- package/src/resources/raw/youtube.ts +585 -0
- package/src/resources/raw.ts +3 -0
- package/src/resources/search.ts +145 -131
- package/src/resources/shared.ts +66 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
- package/resources/brand-safety.d.mts +0 -234
- package/resources/brand-safety.d.mts.map +0 -1
- package/resources/brand-safety.d.ts +0 -234
- package/resources/brand-safety.d.ts.map +0 -1
- package/resources/brand-safety.js +0 -75
- package/resources/brand-safety.js.map +0 -1
- package/resources/brand-safety.mjs +0 -71
- package/resources/brand-safety.mjs.map +0 -1
- package/resources/lookalike.d.mts +0 -142
- package/resources/lookalike.d.mts.map +0 -1
- package/resources/lookalike.d.ts +0 -142
- package/resources/lookalike.d.ts.map +0 -1
- package/resources/lookalike.js +0 -28
- package/resources/lookalike.js.map +0 -1
- package/resources/lookalike.mjs +0 -24
- package/resources/lookalike.mjs.map +0 -1
- package/resources/match.d.mts +0 -90
- package/resources/match.d.mts.map +0 -1
- package/resources/match.d.ts +0 -90
- package/resources/match.d.ts.map +0 -1
- package/resources/match.js +0 -22
- package/resources/match.js.map +0 -1
- package/resources/match.mjs +0 -18
- package/resources/match.mjs.map +0 -1
- package/src/resources/brand-safety.ts +0 -304
- package/src/resources/lookalike.ts +0 -186
- package/src/resources/match.ts +0 -115
|
@@ -0,0 +1,585 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../core/resource';
|
|
4
|
+
import * as YoutubeAPI from './youtube';
|
|
5
|
+
import { APIPromise } from '../../core/api-promise';
|
|
6
|
+
import { RequestOptions } from '../../internal/request-options';
|
|
7
|
+
import { path } from '../../internal/utils/path';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Fetch fresh data directly from social platforms in real-time. Use when you need the most current information or data for profiles not yet in our database.
|
|
11
|
+
*/
|
|
12
|
+
export class Youtube extends APIResource {
|
|
13
|
+
/**
|
|
14
|
+
* Fetch fresh YouTube channel data including subscriber count, video count, and
|
|
15
|
+
* total views.
|
|
16
|
+
*
|
|
17
|
+
* **Pricing**: 0.5 credits per channel scraped ($0.005)
|
|
18
|
+
*/
|
|
19
|
+
getChannel(
|
|
20
|
+
handle: string,
|
|
21
|
+
query: YoutubeGetChannelParams | null | undefined = {},
|
|
22
|
+
options?: RequestOptions,
|
|
23
|
+
): APIPromise<YoutubeGetChannelResponse> {
|
|
24
|
+
return this._client.get(path`/v1/raw/youtube/channel/${handle}`, { query, ...options });
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Fetch transcripts for multiple videos from a YouTube channel. Videos can be
|
|
29
|
+
* sorted by popularity, newest, or oldest before selection.
|
|
30
|
+
*
|
|
31
|
+
* **Features:**
|
|
32
|
+
*
|
|
33
|
+
* - Fetches up to 20 video transcripts per request
|
|
34
|
+
* - Sort by popular (most views), newest, or oldest
|
|
35
|
+
* - Partial success — individual video failures don't block the response
|
|
36
|
+
* - Optional timestamped segments for each transcript
|
|
37
|
+
*
|
|
38
|
+
* **Pricing**: 0.5 credits per transcript fetched ($0.005)
|
|
39
|
+
*/
|
|
40
|
+
getChannelTranscripts(
|
|
41
|
+
handle: string,
|
|
42
|
+
query: YoutubeGetChannelTranscriptsParams | null | undefined = {},
|
|
43
|
+
options?: RequestOptions,
|
|
44
|
+
): APIPromise<YoutubeGetChannelTranscriptsResponse> {
|
|
45
|
+
return this._client.get(path`/v1/raw/youtube/channel-transcripts/${handle}`, { query, ...options });
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Fetch YouTube video transcript/captions. Returns timestamped segments and full
|
|
50
|
+
* text. Useful for content analysis.
|
|
51
|
+
*
|
|
52
|
+
* **Supported sources:**
|
|
53
|
+
*
|
|
54
|
+
* - Manual captions (highest quality)
|
|
55
|
+
* - Auto-generated captions
|
|
56
|
+
* - Multiple language tracks
|
|
57
|
+
*
|
|
58
|
+
* **Pricing**: 0.5 credits per transcript ($0.005)
|
|
59
|
+
*/
|
|
60
|
+
getTranscript(
|
|
61
|
+
videoID: string,
|
|
62
|
+
query: YoutubeGetTranscriptParams | null | undefined = {},
|
|
63
|
+
options?: RequestOptions,
|
|
64
|
+
): APIPromise<YoutubeGetTranscriptResponse> {
|
|
65
|
+
return this._client.get(path`/v1/raw/youtube/transcript/${videoID}`, { query, ...options });
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Search YouTube videos and channels.
|
|
70
|
+
*
|
|
71
|
+
* **Pricing**: 0.5 credits per result returned ($0.005)
|
|
72
|
+
*/
|
|
73
|
+
search(query: YoutubeSearchParams, options?: RequestOptions): APIPromise<YoutubeSearchResponse> {
|
|
74
|
+
return this._client.get('/v1/raw/youtube/search', { query, ...options });
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export interface TranscriptSegment {
|
|
79
|
+
/**
|
|
80
|
+
* Duration in seconds
|
|
81
|
+
*/
|
|
82
|
+
duration: number;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Start time in seconds
|
|
86
|
+
*/
|
|
87
|
+
start: number;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Segment text
|
|
91
|
+
*/
|
|
92
|
+
text: string;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export interface YoutubeGetChannelResponse {
|
|
96
|
+
data: YoutubeGetChannelResponse.Data;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export namespace YoutubeGetChannelResponse {
|
|
100
|
+
export interface Data {
|
|
101
|
+
/**
|
|
102
|
+
* Channel avatar URL
|
|
103
|
+
*/
|
|
104
|
+
avatar_url: string | null;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Channel description
|
|
108
|
+
*/
|
|
109
|
+
description: string | null;
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Channel handle
|
|
113
|
+
*/
|
|
114
|
+
handle: string;
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Channel name
|
|
118
|
+
*/
|
|
119
|
+
name: string;
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* When this data was scraped
|
|
123
|
+
*/
|
|
124
|
+
scraped_at: string;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Subscriber count
|
|
128
|
+
*/
|
|
129
|
+
subscribers: number;
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Total video count
|
|
133
|
+
*/
|
|
134
|
+
videos_count: number;
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Total view count
|
|
138
|
+
*/
|
|
139
|
+
views_total: number;
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Recent videos (only included when include_videos=true)
|
|
143
|
+
*/
|
|
144
|
+
videos?: Array<Data.Video>;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export namespace Data {
|
|
148
|
+
export interface Video {
|
|
149
|
+
/**
|
|
150
|
+
* Video ID
|
|
151
|
+
*/
|
|
152
|
+
id: string;
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Comment count
|
|
156
|
+
*/
|
|
157
|
+
comments: number | null;
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Video duration in seconds
|
|
161
|
+
*/
|
|
162
|
+
duration_seconds: number | null;
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Like count
|
|
166
|
+
*/
|
|
167
|
+
likes: number | null;
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Publish timestamp
|
|
171
|
+
*/
|
|
172
|
+
published_at: string;
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Thumbnail URL
|
|
176
|
+
*/
|
|
177
|
+
thumbnail_url: string | null;
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Video title
|
|
181
|
+
*/
|
|
182
|
+
title: string;
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Video URL
|
|
186
|
+
*/
|
|
187
|
+
url: string;
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* View count
|
|
191
|
+
*/
|
|
192
|
+
views: number | null;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
export interface YoutubeGetChannelTranscriptsResponse {
|
|
198
|
+
data: YoutubeGetChannelTranscriptsResponse.Data;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
export namespace YoutubeGetChannelTranscriptsResponse {
|
|
202
|
+
export interface Data {
|
|
203
|
+
/**
|
|
204
|
+
* YouTube channel ID
|
|
205
|
+
*/
|
|
206
|
+
channel_id: string;
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* Channel name
|
|
210
|
+
*/
|
|
211
|
+
channel_name: string;
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* Channel handle
|
|
215
|
+
*/
|
|
216
|
+
handle: string;
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* Per-video transcript results
|
|
220
|
+
*/
|
|
221
|
+
items: Array<Data.Item>;
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* When this data was scraped
|
|
225
|
+
*/
|
|
226
|
+
scraped_at: string;
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* Number of transcripts that failed to fetch
|
|
230
|
+
*/
|
|
231
|
+
transcripts_failed: number;
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Number of transcripts successfully fetched
|
|
235
|
+
*/
|
|
236
|
+
transcripts_fetched: number;
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* Total videos found on channel
|
|
240
|
+
*/
|
|
241
|
+
videos_found: number;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
export namespace Data {
|
|
245
|
+
export interface Item {
|
|
246
|
+
/**
|
|
247
|
+
* Error message if transcript fetch failed for this video
|
|
248
|
+
*/
|
|
249
|
+
error: string | null;
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* Full transcript as plain text
|
|
253
|
+
*/
|
|
254
|
+
full_text: string | null;
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* Transcript language code
|
|
258
|
+
*/
|
|
259
|
+
language: string | null;
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* Relative publish time
|
|
263
|
+
*/
|
|
264
|
+
published_text: string | null;
|
|
265
|
+
|
|
266
|
+
/**
|
|
267
|
+
* Caption source type
|
|
268
|
+
*/
|
|
269
|
+
source: 'manual' | 'auto_generated' | null;
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* Video title
|
|
273
|
+
*/
|
|
274
|
+
title: string;
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* Timestamped segments (only if include_segments=true)
|
|
278
|
+
*/
|
|
279
|
+
transcript: Array<YoutubeAPI.TranscriptSegment> | null;
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* Video URL
|
|
283
|
+
*/
|
|
284
|
+
url: string;
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* YouTube video ID
|
|
288
|
+
*/
|
|
289
|
+
video_id: string;
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* View count
|
|
293
|
+
*/
|
|
294
|
+
view_count: number | null;
|
|
295
|
+
|
|
296
|
+
/**
|
|
297
|
+
* Word count of transcript
|
|
298
|
+
*/
|
|
299
|
+
word_count: number | null;
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
export interface YoutubeGetTranscriptResponse {
|
|
305
|
+
data: YoutubeGetTranscriptResponse.Data;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
export namespace YoutubeGetTranscriptResponse {
|
|
309
|
+
export interface Data {
|
|
310
|
+
/**
|
|
311
|
+
* Available transcript languages
|
|
312
|
+
*/
|
|
313
|
+
available_languages: Array<string>;
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* Full transcript as plain text
|
|
317
|
+
*/
|
|
318
|
+
full_text: string;
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
* Transcript language code
|
|
322
|
+
*/
|
|
323
|
+
language: string;
|
|
324
|
+
|
|
325
|
+
/**
|
|
326
|
+
* Video title
|
|
327
|
+
*/
|
|
328
|
+
title: string;
|
|
329
|
+
|
|
330
|
+
/**
|
|
331
|
+
* Transcript segments
|
|
332
|
+
*/
|
|
333
|
+
transcript: Array<YoutubeAPI.TranscriptSegment>;
|
|
334
|
+
|
|
335
|
+
/**
|
|
336
|
+
* Video URL
|
|
337
|
+
*/
|
|
338
|
+
url: string;
|
|
339
|
+
|
|
340
|
+
/**
|
|
341
|
+
* Video ID
|
|
342
|
+
*/
|
|
343
|
+
video_id: string;
|
|
344
|
+
|
|
345
|
+
/**
|
|
346
|
+
* Total word count
|
|
347
|
+
*/
|
|
348
|
+
word_count: number;
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
export interface YoutubeSearchResponse {
|
|
353
|
+
data: YoutubeSearchResponse.Data;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
export namespace YoutubeSearchResponse {
|
|
357
|
+
export interface Data {
|
|
358
|
+
/**
|
|
359
|
+
* Estimated total results count
|
|
360
|
+
*/
|
|
361
|
+
estimated_results: number | null;
|
|
362
|
+
|
|
363
|
+
/**
|
|
364
|
+
* The search query
|
|
365
|
+
*/
|
|
366
|
+
query: string;
|
|
367
|
+
|
|
368
|
+
/**
|
|
369
|
+
* Search results (videos and channels)
|
|
370
|
+
*/
|
|
371
|
+
results: Array<Data.YouTubeSearchVideoResult | Data.YouTubeSearchChannelResult>;
|
|
372
|
+
|
|
373
|
+
/**
|
|
374
|
+
* When this search was performed
|
|
375
|
+
*/
|
|
376
|
+
scraped_at: string;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
export namespace Data {
|
|
380
|
+
export interface YouTubeSearchVideoResult {
|
|
381
|
+
/**
|
|
382
|
+
* Channel handle (e.g., @username)
|
|
383
|
+
*/
|
|
384
|
+
channel_handle: string | null;
|
|
385
|
+
|
|
386
|
+
/**
|
|
387
|
+
* Channel ID
|
|
388
|
+
*/
|
|
389
|
+
channel_id: string;
|
|
390
|
+
|
|
391
|
+
/**
|
|
392
|
+
* Channel name
|
|
393
|
+
*/
|
|
394
|
+
channel_name: string;
|
|
395
|
+
|
|
396
|
+
/**
|
|
397
|
+
* Whether channel is verified
|
|
398
|
+
*/
|
|
399
|
+
channel_verified: boolean;
|
|
400
|
+
|
|
401
|
+
/**
|
|
402
|
+
* Video description snippet
|
|
403
|
+
*/
|
|
404
|
+
description: string | null;
|
|
405
|
+
|
|
406
|
+
/**
|
|
407
|
+
* Video duration in seconds
|
|
408
|
+
*/
|
|
409
|
+
duration_seconds: number | null;
|
|
410
|
+
|
|
411
|
+
/**
|
|
412
|
+
* Video duration text (e.g., "12:34")
|
|
413
|
+
*/
|
|
414
|
+
duration_text: string | null;
|
|
415
|
+
|
|
416
|
+
/**
|
|
417
|
+
* Approximate publish timestamp
|
|
418
|
+
*/
|
|
419
|
+
published_at: string | null;
|
|
420
|
+
|
|
421
|
+
/**
|
|
422
|
+
* Relative publish time (e.g., "2 days ago")
|
|
423
|
+
*/
|
|
424
|
+
published_text: string | null;
|
|
425
|
+
|
|
426
|
+
/**
|
|
427
|
+
* Video thumbnail URL
|
|
428
|
+
*/
|
|
429
|
+
thumbnail_url: string | null;
|
|
430
|
+
|
|
431
|
+
/**
|
|
432
|
+
* Video title
|
|
433
|
+
*/
|
|
434
|
+
title: string;
|
|
435
|
+
|
|
436
|
+
type: 'video';
|
|
437
|
+
|
|
438
|
+
/**
|
|
439
|
+
* Full YouTube video URL
|
|
440
|
+
*/
|
|
441
|
+
url: string;
|
|
442
|
+
|
|
443
|
+
/**
|
|
444
|
+
* YouTube video ID
|
|
445
|
+
*/
|
|
446
|
+
video_id: string;
|
|
447
|
+
|
|
448
|
+
/**
|
|
449
|
+
* Number of views
|
|
450
|
+
*/
|
|
451
|
+
view_count: number | null;
|
|
452
|
+
|
|
453
|
+
/**
|
|
454
|
+
* View count text (e.g., "1.2M views")
|
|
455
|
+
*/
|
|
456
|
+
view_count_text: string | null;
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
export interface YouTubeSearchChannelResult {
|
|
460
|
+
/**
|
|
461
|
+
* Channel handle (e.g., @username)
|
|
462
|
+
*/
|
|
463
|
+
channel_handle: string | null;
|
|
464
|
+
|
|
465
|
+
/**
|
|
466
|
+
* Channel ID
|
|
467
|
+
*/
|
|
468
|
+
channel_id: string;
|
|
469
|
+
|
|
470
|
+
/**
|
|
471
|
+
* Channel name
|
|
472
|
+
*/
|
|
473
|
+
channel_name: string;
|
|
474
|
+
|
|
475
|
+
/**
|
|
476
|
+
* Whether channel is verified
|
|
477
|
+
*/
|
|
478
|
+
channel_verified: boolean;
|
|
479
|
+
|
|
480
|
+
/**
|
|
481
|
+
* Channel description snippet
|
|
482
|
+
*/
|
|
483
|
+
description: string | null;
|
|
484
|
+
|
|
485
|
+
/**
|
|
486
|
+
* Subscriber count
|
|
487
|
+
*/
|
|
488
|
+
subscriber_count: number | null;
|
|
489
|
+
|
|
490
|
+
/**
|
|
491
|
+
* Channel avatar URL
|
|
492
|
+
*/
|
|
493
|
+
thumbnail_url: string | null;
|
|
494
|
+
|
|
495
|
+
type: 'channel';
|
|
496
|
+
|
|
497
|
+
/**
|
|
498
|
+
* Full YouTube channel URL
|
|
499
|
+
*/
|
|
500
|
+
url: string;
|
|
501
|
+
|
|
502
|
+
/**
|
|
503
|
+
* Number of videos on the channel
|
|
504
|
+
*/
|
|
505
|
+
video_count: number | null;
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
export interface YoutubeGetChannelParams {
|
|
511
|
+
/**
|
|
512
|
+
* Include recent videos in response
|
|
513
|
+
*/
|
|
514
|
+
include_videos?: boolean;
|
|
515
|
+
|
|
516
|
+
/**
|
|
517
|
+
* Number of videos to include
|
|
518
|
+
*/
|
|
519
|
+
video_limit?: number;
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
export interface YoutubeGetChannelTranscriptsParams {
|
|
523
|
+
/**
|
|
524
|
+
* Include timestamped transcript segments in response
|
|
525
|
+
*/
|
|
526
|
+
include_segments?: boolean;
|
|
527
|
+
|
|
528
|
+
/**
|
|
529
|
+
* Language code for transcripts
|
|
530
|
+
*/
|
|
531
|
+
language?: string;
|
|
532
|
+
|
|
533
|
+
/**
|
|
534
|
+
* How to sort channel videos before selecting
|
|
535
|
+
*/
|
|
536
|
+
sort_by?: 'popular' | 'newest' | 'oldest';
|
|
537
|
+
|
|
538
|
+
/**
|
|
539
|
+
* Number of videos to fetch transcripts for (max 20)
|
|
540
|
+
*/
|
|
541
|
+
video_limit?: number;
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
export interface YoutubeGetTranscriptParams {
|
|
545
|
+
/**
|
|
546
|
+
* Language code or "auto" for automatic detection
|
|
547
|
+
*/
|
|
548
|
+
language?: string;
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
export interface YoutubeSearchParams {
|
|
552
|
+
/**
|
|
553
|
+
* Search query
|
|
554
|
+
*/
|
|
555
|
+
q: string;
|
|
556
|
+
|
|
557
|
+
/**
|
|
558
|
+
* Country code for localized results (ISO 3166-1 alpha-2)
|
|
559
|
+
*/
|
|
560
|
+
country_code?: string;
|
|
561
|
+
|
|
562
|
+
/**
|
|
563
|
+
* Language code for results
|
|
564
|
+
*/
|
|
565
|
+
language_code?: string;
|
|
566
|
+
|
|
567
|
+
/**
|
|
568
|
+
* Maximum number of results to return
|
|
569
|
+
*/
|
|
570
|
+
limit?: number;
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
export declare namespace Youtube {
|
|
574
|
+
export {
|
|
575
|
+
type TranscriptSegment as TranscriptSegment,
|
|
576
|
+
type YoutubeGetChannelResponse as YoutubeGetChannelResponse,
|
|
577
|
+
type YoutubeGetChannelTranscriptsResponse as YoutubeGetChannelTranscriptsResponse,
|
|
578
|
+
type YoutubeGetTranscriptResponse as YoutubeGetTranscriptResponse,
|
|
579
|
+
type YoutubeSearchResponse as YoutubeSearchResponse,
|
|
580
|
+
type YoutubeGetChannelParams as YoutubeGetChannelParams,
|
|
581
|
+
type YoutubeGetChannelTranscriptsParams as YoutubeGetChannelTranscriptsParams,
|
|
582
|
+
type YoutubeGetTranscriptParams as YoutubeGetTranscriptParams,
|
|
583
|
+
type YoutubeSearchParams as YoutubeSearchParams,
|
|
584
|
+
};
|
|
585
|
+
}
|