getanyapi 0.1.0__py3-none-any.whl
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.
- getanyapi/__init__.py +76 -0
- getanyapi/_account.py +132 -0
- getanyapi/_async_client.py +215 -0
- getanyapi/_client.py +274 -0
- getanyapi/_errors.py +115 -0
- getanyapi/_pagination.py +295 -0
- getanyapi/_transport.py +239 -0
- getanyapi/platforms/__init__.py +89 -0
- getanyapi/platforms/ahrefs.py +384 -0
- getanyapi/platforms/airbnb.py +120 -0
- getanyapi/platforms/alibaba.py +95 -0
- getanyapi/platforms/amazon.py +442 -0
- getanyapi/platforms/appstore.py +95 -0
- getanyapi/platforms/bluesky.py +215 -0
- getanyapi/platforms/booking.py +128 -0
- getanyapi/platforms/coinmarketcap.py +113 -0
- getanyapi/platforms/congress.py +106 -0
- getanyapi/platforms/dexscreener.py +104 -0
- getanyapi/platforms/ebay.py +215 -0
- getanyapi/platforms/email.py +166 -0
- getanyapi/platforms/facebook.py +2324 -0
- getanyapi/platforms/fiverr.py +122 -0
- getanyapi/platforms/github.py +954 -0
- getanyapi/platforms/glassdoor.py +93 -0
- getanyapi/platforms/google.py +232 -0
- getanyapi/platforms/google_ads.py +380 -0
- getanyapi/platforms/google_finance.py +170 -0
- getanyapi/platforms/google_shopping.py +103 -0
- getanyapi/platforms/hackernews.py +276 -0
- getanyapi/platforms/indeed.py +114 -0
- getanyapi/platforms/instagram.py +1868 -0
- getanyapi/platforms/linkedin.py +1064 -0
- getanyapi/platforms/maps.py +412 -0
- getanyapi/platforms/pandaexpress.py +262 -0
- getanyapi/platforms/person.py +96 -0
- getanyapi/platforms/pinterest.py +96 -0
- getanyapi/platforms/playstore.py +99 -0
- getanyapi/platforms/polymarket.py +109 -0
- getanyapi/platforms/realtor.py +104 -0
- getanyapi/platforms/reddit.py +582 -0
- getanyapi/platforms/redfin.py +95 -0
- getanyapi/platforms/rednote.py +807 -0
- getanyapi/platforms/sec.py +118 -0
- getanyapi/platforms/semrush.py +358 -0
- getanyapi/platforms/snapchat.py +146 -0
- getanyapi/platforms/social.py +105 -0
- getanyapi/platforms/spotify.py +588 -0
- getanyapi/platforms/substack.py +142 -0
- getanyapi/platforms/threads.py +358 -0
- getanyapi/platforms/tiktok.py +1827 -0
- getanyapi/platforms/tiktok_shop.py +536 -0
- getanyapi/platforms/tripadvisor.py +180 -0
- getanyapi/platforms/trustpilot.py +114 -0
- getanyapi/platforms/truthsocial.py +226 -0
- getanyapi/platforms/twitter.py +798 -0
- getanyapi/platforms/upwork.py +119 -0
- getanyapi/platforms/walmart.py +93 -0
- getanyapi/platforms/web.py +264 -0
- getanyapi/platforms/whatsapp.py +91 -0
- getanyapi/platforms/yahoo_finance.py +95 -0
- getanyapi/platforms/yelp.py +141 -0
- getanyapi/platforms/youtube.py +1452 -0
- getanyapi/platforms/zillow.py +218 -0
- getanyapi/py.typed +0 -0
- getanyapi/types.py +170 -0
- getanyapi-0.1.0.dist-info/METADATA +155 -0
- getanyapi-0.1.0.dist-info/RECORD +68 -0
- getanyapi-0.1.0.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,1827 @@
|
|
|
1
|
+
# Generated - do not edit. Regenerate with: pnpm generate
|
|
2
|
+
"""Generated namespace module for the tiktok platform."""
|
|
3
|
+
|
|
4
|
+
from __future__ import annotations
|
|
5
|
+
|
|
6
|
+
from typing import TYPE_CHECKING
|
|
7
|
+
|
|
8
|
+
from pydantic import BaseModel, ConfigDict, Field
|
|
9
|
+
from typing_extensions import NotRequired, Required, TypedDict, Unpack
|
|
10
|
+
|
|
11
|
+
from ..types import RequestOptions, RunResult
|
|
12
|
+
from .._pagination import (
|
|
13
|
+
AsyncPaginator,
|
|
14
|
+
Paginator,
|
|
15
|
+
apaginate,
|
|
16
|
+
paginate,
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
if TYPE_CHECKING:
|
|
20
|
+
from .._async_client import AsyncAnyAPI
|
|
21
|
+
from .._client import AnyAPI
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class TiktokAdLibraryAdInput(TypedDict, total=False):
|
|
25
|
+
"""Input for TikTok Ad Library Ad."""
|
|
26
|
+
|
|
27
|
+
adId: Required[str]
|
|
28
|
+
"""TikTok Top Ads material/ad ID, or a Top Ads detail URL (e.g. 7648493525660270600)."""
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class TiktokAdLibrarySearchInput(TypedDict, total=False):
|
|
32
|
+
"""Input for TikTok Ad Library Search."""
|
|
33
|
+
|
|
34
|
+
cursor: NotRequired[str]
|
|
35
|
+
"""Page number for pagination (defaults to 1)."""
|
|
36
|
+
limit: NotRequired[str]
|
|
37
|
+
"""Results per page, max 50 (defaults to 20)."""
|
|
38
|
+
orderBy: NotRequired[str]
|
|
39
|
+
"""Sort metric: for_you, impression, play_2s_rate, play_6s_rate, cvr, ctr, or like."""
|
|
40
|
+
period: NotRequired[str]
|
|
41
|
+
"""Time window for top ads: 7, 30, or 180 days."""
|
|
42
|
+
query: Required[str]
|
|
43
|
+
"""Keyword to search ad titles and content (e.g. spotify)."""
|
|
44
|
+
region: NotRequired[str]
|
|
45
|
+
"""Country code (defaults to US)."""
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
class TiktokAudienceDemographicsInput(TypedDict, total=False):
|
|
49
|
+
"""Input for TikTok Audience Demographics."""
|
|
50
|
+
|
|
51
|
+
handle: Required[str]
|
|
52
|
+
"""TikTok username without the leading @ (e.g. "shakira")."""
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
class TiktokCommentRepliesInput(TypedDict, total=False):
|
|
56
|
+
"""Input for TikTok Comment Replies."""
|
|
57
|
+
|
|
58
|
+
commentId: Required[str]
|
|
59
|
+
"""TikTok comment ID (the comment's cid from the comments endpoint)."""
|
|
60
|
+
cursor: NotRequired[str]
|
|
61
|
+
"""Pagination cursor from a previous response."""
|
|
62
|
+
url: Required[str]
|
|
63
|
+
"""TikTok video URL the comment belongs to."""
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
class TiktokFollowersInput(TypedDict, total=False):
|
|
67
|
+
"""Input for TikTok Followers."""
|
|
68
|
+
|
|
69
|
+
cursor: NotRequired[str]
|
|
70
|
+
"""Pagination cursor from a previous response's nextCursor, to fetch the next page of followers."""
|
|
71
|
+
handle: Required[str]
|
|
72
|
+
"""TikTok username whose followers to list, without the @ prefix (e.g. stoolpresidente)."""
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
class TiktokFollowingInput(TypedDict, total=False):
|
|
76
|
+
"""Input for TikTok Following."""
|
|
77
|
+
|
|
78
|
+
cursor: NotRequired[str]
|
|
79
|
+
"""Pagination cursor from a previous response."""
|
|
80
|
+
handle: Required[str]
|
|
81
|
+
"""TikTok username without the leading @ (e.g. "stoolpresidente")."""
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
class TiktokHashtagVideosInput(TypedDict, total=False):
|
|
85
|
+
"""Input for TikTok Hashtag Videos."""
|
|
86
|
+
|
|
87
|
+
hashtag: Required[str]
|
|
88
|
+
"""TikTok hashtag to fetch videos for, without the # prefix (e.g. booktok)."""
|
|
89
|
+
limit: NotRequired[int]
|
|
90
|
+
"""Maximum number of results to return (1-20, default 20). You are billed per result returned, so a lower limit costs less. Range: 1 to 20."""
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
class TiktokLiveInput(TypedDict, total=False):
|
|
94
|
+
"""Input for TikTok Live."""
|
|
95
|
+
|
|
96
|
+
handle: Required[str]
|
|
97
|
+
"""TikTok username without the leading @ (e.g. "thejustalex")."""
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
class TiktokProfileInput(TypedDict, total=False):
|
|
101
|
+
"""Input for TikTok Profile."""
|
|
102
|
+
|
|
103
|
+
handle: Required[str]
|
|
104
|
+
"""TikTok username without the leading @ (e.g. "stoolpresidente")."""
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
class TiktokProfileRegionInput(TypedDict, total=False):
|
|
108
|
+
"""Input for TikTok Profile Region."""
|
|
109
|
+
|
|
110
|
+
handle: Required[str]
|
|
111
|
+
"""TikTok username without the leading @ (e.g. "stoolpresidente")."""
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
class TiktokProfileVideosInput(TypedDict, total=False):
|
|
115
|
+
"""Input for TikTok Profile Videos."""
|
|
116
|
+
|
|
117
|
+
cursor: NotRequired[str]
|
|
118
|
+
"""Pagination cursor from a previous response's nextCursor."""
|
|
119
|
+
handle: Required[str]
|
|
120
|
+
"""TikTok username without the leading @."""
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
class TiktokSearchHashtagInput(TypedDict, total=False):
|
|
124
|
+
"""Input for TikTok Hashtag Search."""
|
|
125
|
+
|
|
126
|
+
cursor: NotRequired[str]
|
|
127
|
+
"""Pagination cursor from a previous response."""
|
|
128
|
+
query: Required[str]
|
|
129
|
+
"""Hashtag or keyword to search for (without the leading #)."""
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
class TiktokSearchKeywordInput(TypedDict, total=False):
|
|
133
|
+
"""Input for TikTok Keyword Search."""
|
|
134
|
+
|
|
135
|
+
cursor: NotRequired[str]
|
|
136
|
+
"""Pagination cursor from a previous response."""
|
|
137
|
+
datePosted: NotRequired[str]
|
|
138
|
+
"""Time frame filter (e.g. 0=any, 1=past 24h, 7=past week)."""
|
|
139
|
+
query: Required[str]
|
|
140
|
+
"""The keyword to search TikTok for."""
|
|
141
|
+
sortBy: NotRequired[str]
|
|
142
|
+
"""Sort order (e.g. 0=relevance, 1=most liked)."""
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
class TiktokSearchTopInput(TypedDict, total=False):
|
|
146
|
+
"""Input for TikTok Top Search."""
|
|
147
|
+
|
|
148
|
+
cursor: NotRequired[str]
|
|
149
|
+
"""Pagination cursor from a previous response."""
|
|
150
|
+
publishTime: NotRequired[str]
|
|
151
|
+
"""Time-frame filter: yesterday, this-week, this-month, last-3-months, last-6-months, all-time."""
|
|
152
|
+
query: Required[str]
|
|
153
|
+
"""Keyword to search for (e.g. "funny")."""
|
|
154
|
+
region: NotRequired[str]
|
|
155
|
+
"""2-letter country code for the proxy location (e.g. US, GB, FR)."""
|
|
156
|
+
sortBy: NotRequired[str]
|
|
157
|
+
"""Sort order: relevance, most-liked, date-posted."""
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
class TiktokSearchUsersInput(TypedDict, total=False):
|
|
161
|
+
"""Input for TikTok User Search."""
|
|
162
|
+
|
|
163
|
+
cursor: NotRequired[str]
|
|
164
|
+
"""Pagination cursor from a previous response's nextCursor."""
|
|
165
|
+
query: Required[str]
|
|
166
|
+
"""The keyword to search TikTok accounts for."""
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
class TiktokSongInput(TypedDict, total=False):
|
|
170
|
+
"""Input for TikTok Song."""
|
|
171
|
+
|
|
172
|
+
clipId: Required[str]
|
|
173
|
+
"""The clip identifier for the song, found in TikTok music URLs (e.g. 7439295283975702544)."""
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
class TiktokSongVideosInput(TypedDict, total=False):
|
|
177
|
+
"""Input for TikTok Song Videos."""
|
|
178
|
+
|
|
179
|
+
clipId: Required[str]
|
|
180
|
+
"""The song ID found in TikTok music URLs (e.g. 7439295283975702544)."""
|
|
181
|
+
cursor: NotRequired[str]
|
|
182
|
+
"""Pagination cursor for retrieving the next page of results."""
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
class TiktokTrendingFeedInput(TypedDict, total=False):
|
|
186
|
+
"""Input for TikTok Trending Feed."""
|
|
187
|
+
|
|
188
|
+
region: Required[str]
|
|
189
|
+
"""2-letter country code for the proxy location (e.g. "US")."""
|
|
190
|
+
trim: NotRequired[str]
|
|
191
|
+
"""Set to true to return a simplified response."""
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
class TiktokVideoInput(TypedDict, total=False):
|
|
195
|
+
"""Input for TikTok Video."""
|
|
196
|
+
|
|
197
|
+
url: Required[str]
|
|
198
|
+
"""Full TikTok video URL."""
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
class TiktokVideoCommentsInput(TypedDict, total=False):
|
|
202
|
+
"""Input for TikTok Video Comments."""
|
|
203
|
+
|
|
204
|
+
cursor: NotRequired[str]
|
|
205
|
+
"""Pagination cursor from a previous response's nextCursor."""
|
|
206
|
+
url: Required[str]
|
|
207
|
+
"""Full TikTok video URL."""
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
class TiktokVideoTranscriptInput(TypedDict, total=False):
|
|
211
|
+
"""Input for TikTok Video Transcript."""
|
|
212
|
+
|
|
213
|
+
url: Required[str]
|
|
214
|
+
"""Full TikTok video URL."""
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
class TiktokAdLibraryAdData(BaseModel):
|
|
218
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
219
|
+
|
|
220
|
+
ad_id: str = Field(alias="adId")
|
|
221
|
+
ad_title: str = Field(alias="adTitle")
|
|
222
|
+
brand_name: str = Field(alias="brandName")
|
|
223
|
+
comments: int
|
|
224
|
+
cost: float
|
|
225
|
+
cover_url: str = Field(alias="coverUrl")
|
|
226
|
+
ctr: float
|
|
227
|
+
industry: str
|
|
228
|
+
landing_page: str = Field(alias="landingPage")
|
|
229
|
+
likes: int
|
|
230
|
+
objective: str
|
|
231
|
+
shares: int
|
|
232
|
+
video_url: str = Field(alias="videoUrl")
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
class TiktokAdLibrarySearchData(BaseModel):
|
|
236
|
+
model_config = ConfigDict(populate_by_name=True)
|
|
237
|
+
|
|
238
|
+
ads: list[TiktokAdLibrarySearchAd]
|
|
239
|
+
has_more: bool = Field(alias="hasMore")
|
|
240
|
+
next_cursor: str = Field(alias="nextCursor")
|
|
241
|
+
total: int
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
class TiktokAdLibrarySearchAd(BaseModel):
|
|
245
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
246
|
+
|
|
247
|
+
ad_id: str = Field(alias="adId")
|
|
248
|
+
ad_title: str = Field(alias="adTitle")
|
|
249
|
+
brand_name: str = Field(alias="brandName")
|
|
250
|
+
cost: float
|
|
251
|
+
cover_url: str = Field(alias="coverUrl")
|
|
252
|
+
ctr: float
|
|
253
|
+
industry: str
|
|
254
|
+
likes: int
|
|
255
|
+
objective: str
|
|
256
|
+
video_url: str = Field(alias="videoUrl")
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
class TiktokAudienceDemographicsData(BaseModel):
|
|
260
|
+
model_config = ConfigDict(populate_by_name=True)
|
|
261
|
+
|
|
262
|
+
audience_locations: list[TiktokAudienceDemographicsAudienceLocation] = Field(
|
|
263
|
+
alias="audienceLocations"
|
|
264
|
+
)
|
|
265
|
+
|
|
266
|
+
|
|
267
|
+
class TiktokAudienceDemographicsAudienceLocation(BaseModel):
|
|
268
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
269
|
+
|
|
270
|
+
count: int
|
|
271
|
+
country: str
|
|
272
|
+
country_code: str = Field(alias="countryCode")
|
|
273
|
+
percentage: str
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
class TiktokCommentRepliesData(BaseModel):
|
|
277
|
+
model_config = ConfigDict(populate_by_name=True)
|
|
278
|
+
|
|
279
|
+
comments: list[TiktokCommentRepliesComment]
|
|
280
|
+
next_cursor: str = Field(alias="nextCursor")
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
class TiktokCommentRepliesComment(BaseModel):
|
|
284
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
285
|
+
|
|
286
|
+
author: str
|
|
287
|
+
created_at: int = Field(alias="createdAt")
|
|
288
|
+
id: str
|
|
289
|
+
likes: int
|
|
290
|
+
text: str
|
|
291
|
+
|
|
292
|
+
|
|
293
|
+
class TiktokFollowersData(BaseModel):
|
|
294
|
+
model_config = ConfigDict(populate_by_name=True)
|
|
295
|
+
|
|
296
|
+
followers: list[TiktokFollowersFollower]
|
|
297
|
+
next_cursor: str = Field(alias="nextCursor")
|
|
298
|
+
total: int
|
|
299
|
+
|
|
300
|
+
|
|
301
|
+
class TiktokFollowersFollower(BaseModel):
|
|
302
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
303
|
+
|
|
304
|
+
avatar_url: str = Field(alias="avatarUrl")
|
|
305
|
+
follower_count: int = Field(alias="followerCount")
|
|
306
|
+
following_count: int = Field(alias="followingCount")
|
|
307
|
+
nickname: str
|
|
308
|
+
region: str
|
|
309
|
+
user_id: str = Field(alias="userId")
|
|
310
|
+
username: str
|
|
311
|
+
|
|
312
|
+
|
|
313
|
+
class TiktokFollowingData(BaseModel):
|
|
314
|
+
following: list[TiktokFollowingFollowing]
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
class TiktokFollowingFollowing(BaseModel):
|
|
318
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
319
|
+
|
|
320
|
+
bio: str
|
|
321
|
+
display_name: str = Field(alias="displayName")
|
|
322
|
+
followers: int
|
|
323
|
+
handle: str
|
|
324
|
+
id: str
|
|
325
|
+
region: str
|
|
326
|
+
videos: int
|
|
327
|
+
|
|
328
|
+
|
|
329
|
+
class TiktokHashtagVideosData(BaseModel):
|
|
330
|
+
items: list[TiktokHashtagVideosItem] = Field(
|
|
331
|
+
description="Video records: creator, caption, hashtags, play/like/share/comment counts, and video URL."
|
|
332
|
+
)
|
|
333
|
+
|
|
334
|
+
|
|
335
|
+
class TiktokHashtagVideosItem(BaseModel):
|
|
336
|
+
model_config = ConfigDict(extra="allow")
|
|
337
|
+
|
|
338
|
+
id: str
|
|
339
|
+
text: str
|
|
340
|
+
url: str
|
|
341
|
+
|
|
342
|
+
|
|
343
|
+
class TiktokLiveData(BaseModel):
|
|
344
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
345
|
+
|
|
346
|
+
cover_url: str = Field(alias="coverUrl")
|
|
347
|
+
display_name: str = Field(alias="displayName")
|
|
348
|
+
enter_count: int = Field(alias="enterCount")
|
|
349
|
+
handle: str
|
|
350
|
+
room_id: str = Field(alias="roomId")
|
|
351
|
+
start_time: int = Field(alias="startTime")
|
|
352
|
+
status: int
|
|
353
|
+
title: str
|
|
354
|
+
viewers: int
|
|
355
|
+
|
|
356
|
+
|
|
357
|
+
class TiktokProfileData(BaseModel):
|
|
358
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
359
|
+
|
|
360
|
+
avatar_url: str = Field(alias="avatarUrl")
|
|
361
|
+
bio: str
|
|
362
|
+
display_name: str = Field(alias="displayName")
|
|
363
|
+
followers: int
|
|
364
|
+
following: int
|
|
365
|
+
handle: str
|
|
366
|
+
likes: int
|
|
367
|
+
verified: bool
|
|
368
|
+
videos: int
|
|
369
|
+
|
|
370
|
+
|
|
371
|
+
class TiktokProfileRegionData(BaseModel):
|
|
372
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
373
|
+
|
|
374
|
+
handle: str
|
|
375
|
+
profile_url: str = Field(alias="profileUrl")
|
|
376
|
+
region: str
|
|
377
|
+
|
|
378
|
+
|
|
379
|
+
class TiktokProfileVideosData(BaseModel):
|
|
380
|
+
model_config = ConfigDict(populate_by_name=True)
|
|
381
|
+
|
|
382
|
+
next_cursor: str = Field(alias="nextCursor")
|
|
383
|
+
videos: list[TiktokProfileVideosVideo]
|
|
384
|
+
|
|
385
|
+
|
|
386
|
+
class TiktokProfileVideosVideo(BaseModel):
|
|
387
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
388
|
+
|
|
389
|
+
caption: str
|
|
390
|
+
comments: int
|
|
391
|
+
created_at: str = Field(alias="createdAt")
|
|
392
|
+
id: str
|
|
393
|
+
likes: int
|
|
394
|
+
url: str
|
|
395
|
+
views: int
|
|
396
|
+
|
|
397
|
+
|
|
398
|
+
class TiktokSearchHashtagData(BaseModel):
|
|
399
|
+
videos: list[TiktokSearchHashtagVideo]
|
|
400
|
+
|
|
401
|
+
|
|
402
|
+
class TiktokSearchHashtagVideo(BaseModel):
|
|
403
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
404
|
+
|
|
405
|
+
author: str
|
|
406
|
+
caption: str
|
|
407
|
+
comments: int
|
|
408
|
+
created_at: int = Field(alias="createdAt")
|
|
409
|
+
id: str
|
|
410
|
+
likes: int
|
|
411
|
+
shares: int
|
|
412
|
+
views: int
|
|
413
|
+
|
|
414
|
+
|
|
415
|
+
class TiktokSearchKeywordData(BaseModel):
|
|
416
|
+
videos: list[TiktokSearchKeywordVideo]
|
|
417
|
+
|
|
418
|
+
|
|
419
|
+
class TiktokSearchKeywordVideo(BaseModel):
|
|
420
|
+
model_config = ConfigDict(extra="allow")
|
|
421
|
+
|
|
422
|
+
caption: str
|
|
423
|
+
comments: int
|
|
424
|
+
id: str
|
|
425
|
+
likes: int
|
|
426
|
+
region: str
|
|
427
|
+
shares: int
|
|
428
|
+
views: int
|
|
429
|
+
|
|
430
|
+
|
|
431
|
+
class TiktokSearchTopData(BaseModel):
|
|
432
|
+
model_config = ConfigDict(populate_by_name=True)
|
|
433
|
+
|
|
434
|
+
items: list[TiktokSearchTopItem]
|
|
435
|
+
next_cursor: str = Field(alias="nextCursor")
|
|
436
|
+
|
|
437
|
+
|
|
438
|
+
class TiktokSearchTopItem(BaseModel):
|
|
439
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
440
|
+
|
|
441
|
+
author: str
|
|
442
|
+
caption: str
|
|
443
|
+
comments: int
|
|
444
|
+
content_type: str = Field(alias="contentType")
|
|
445
|
+
id: str
|
|
446
|
+
likes: int
|
|
447
|
+
shares: int
|
|
448
|
+
url: str
|
|
449
|
+
views: int
|
|
450
|
+
|
|
451
|
+
|
|
452
|
+
class TiktokSearchUsersData(BaseModel):
|
|
453
|
+
model_config = ConfigDict(populate_by_name=True)
|
|
454
|
+
|
|
455
|
+
next_cursor: str = Field(alias="nextCursor")
|
|
456
|
+
users: list[TiktokSearchUsersUser]
|
|
457
|
+
|
|
458
|
+
|
|
459
|
+
class TiktokSearchUsersUser(BaseModel):
|
|
460
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
461
|
+
|
|
462
|
+
followers: int
|
|
463
|
+
following: int
|
|
464
|
+
handle: str
|
|
465
|
+
nickname: str
|
|
466
|
+
user_id: str = Field(alias="userId")
|
|
467
|
+
|
|
468
|
+
|
|
469
|
+
class TiktokSongData(BaseModel):
|
|
470
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
471
|
+
|
|
472
|
+
album: str
|
|
473
|
+
author: str
|
|
474
|
+
cover_url: str = Field(alias="coverUrl")
|
|
475
|
+
duration: int
|
|
476
|
+
is_original: bool = Field(alias="isOriginal")
|
|
477
|
+
share_url: str = Field(alias="shareUrl")
|
|
478
|
+
song_id: str = Field(alias="songId")
|
|
479
|
+
title: str
|
|
480
|
+
video_count: int = Field(alias="videoCount")
|
|
481
|
+
|
|
482
|
+
|
|
483
|
+
class TiktokSongVideosData(BaseModel):
|
|
484
|
+
model_config = ConfigDict(populate_by_name=True)
|
|
485
|
+
|
|
486
|
+
has_more: int = Field(alias="hasMore")
|
|
487
|
+
next_cursor: str = Field(alias="nextCursor")
|
|
488
|
+
videos: list[TiktokSongVideosVideo]
|
|
489
|
+
|
|
490
|
+
|
|
491
|
+
class TiktokSongVideosVideo(BaseModel):
|
|
492
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
493
|
+
|
|
494
|
+
author_handle: str = Field(alias="authorHandle")
|
|
495
|
+
author_name: str = Field(alias="authorName")
|
|
496
|
+
comment_count: int = Field(alias="commentCount")
|
|
497
|
+
create_time: int = Field(alias="createTime")
|
|
498
|
+
description: str
|
|
499
|
+
like_count: int = Field(alias="likeCount")
|
|
500
|
+
play_count: int = Field(alias="playCount")
|
|
501
|
+
share_count: int = Field(alias="shareCount")
|
|
502
|
+
video_id: str = Field(alias="videoId")
|
|
503
|
+
|
|
504
|
+
|
|
505
|
+
class TiktokTrendingFeedData(BaseModel):
|
|
506
|
+
videos: list[TiktokTrendingFeedVideo]
|
|
507
|
+
|
|
508
|
+
|
|
509
|
+
class TiktokTrendingFeedVideo(BaseModel):
|
|
510
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
511
|
+
|
|
512
|
+
author: str
|
|
513
|
+
caption: str
|
|
514
|
+
comments: int
|
|
515
|
+
created_at: int = Field(alias="createdAt")
|
|
516
|
+
id: str
|
|
517
|
+
likes: int
|
|
518
|
+
region: str
|
|
519
|
+
shares: int
|
|
520
|
+
url: str
|
|
521
|
+
views: int
|
|
522
|
+
|
|
523
|
+
|
|
524
|
+
class TiktokVideoData(BaseModel):
|
|
525
|
+
model_config = ConfigDict(extra="allow")
|
|
526
|
+
|
|
527
|
+
caption: str
|
|
528
|
+
comments: int
|
|
529
|
+
id: str
|
|
530
|
+
likes: int
|
|
531
|
+
region: str
|
|
532
|
+
saves: int
|
|
533
|
+
shares: int
|
|
534
|
+
views: int
|
|
535
|
+
|
|
536
|
+
|
|
537
|
+
class TiktokVideoCommentsData(BaseModel):
|
|
538
|
+
model_config = ConfigDict(populate_by_name=True)
|
|
539
|
+
|
|
540
|
+
comments: list[TiktokVideoCommentsComment]
|
|
541
|
+
next_cursor: str = Field(alias="nextCursor")
|
|
542
|
+
|
|
543
|
+
|
|
544
|
+
class TiktokVideoCommentsComment(BaseModel):
|
|
545
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
546
|
+
|
|
547
|
+
author: str
|
|
548
|
+
created_at: int = Field(alias="createdAt")
|
|
549
|
+
id: str
|
|
550
|
+
likes: int
|
|
551
|
+
replies: int
|
|
552
|
+
text: str
|
|
553
|
+
|
|
554
|
+
|
|
555
|
+
class TiktokVideoTranscriptData(BaseModel):
|
|
556
|
+
model_config = ConfigDict(extra="allow")
|
|
557
|
+
|
|
558
|
+
language: str
|
|
559
|
+
transcript: str
|
|
560
|
+
|
|
561
|
+
|
|
562
|
+
class TiktokNamespace:
|
|
563
|
+
"""Typed methods for this platform. Attached lazily to the client."""
|
|
564
|
+
|
|
565
|
+
def __init__(self, client: "AnyAPI") -> None:
|
|
566
|
+
self._client = client
|
|
567
|
+
|
|
568
|
+
def ad_library_ad(
|
|
569
|
+
self,
|
|
570
|
+
*,
|
|
571
|
+
options: RequestOptions | None = None,
|
|
572
|
+
**input: Unpack[TiktokAdLibraryAdInput],
|
|
573
|
+
) -> RunResult[TiktokAdLibraryAdData]:
|
|
574
|
+
"""TikTok Ad Library Ad
|
|
575
|
+
|
|
576
|
+
Fetch full details for a single TikTok ad - brand, title, spend, CTR,
|
|
577
|
+
objectives, landing page, and video info - normalized across providers with
|
|
578
|
+
transparent failover.
|
|
579
|
+
|
|
580
|
+
Price: $0.002 per request.
|
|
581
|
+
|
|
582
|
+
Example:
|
|
583
|
+
res = client.tiktok.ad_library_ad(adId="7648493525660270600")
|
|
584
|
+
"""
|
|
585
|
+
raw = self._client._run_raw( # pyright: ignore[reportPrivateUsage]
|
|
586
|
+
"tiktok.ad_library_ad", dict(input), options
|
|
587
|
+
)
|
|
588
|
+
return RunResult[TiktokAdLibraryAdData].model_validate(raw)
|
|
589
|
+
|
|
590
|
+
def ad_library_search(
|
|
591
|
+
self,
|
|
592
|
+
*,
|
|
593
|
+
options: RequestOptions | None = None,
|
|
594
|
+
**input: Unpack[TiktokAdLibrarySearchInput],
|
|
595
|
+
) -> RunResult[TiktokAdLibrarySearchData]:
|
|
596
|
+
"""TikTok Ad Library Search
|
|
597
|
+
|
|
598
|
+
Search TikTok's ad library by keyword - top ads with brand, title, spend,
|
|
599
|
+
CTR, likes, and video info - normalized across providers with transparent
|
|
600
|
+
failover.
|
|
601
|
+
|
|
602
|
+
Price: $0.002 per request.
|
|
603
|
+
|
|
604
|
+
Example:
|
|
605
|
+
res = client.tiktok.ad_library_search(query="spotify")
|
|
606
|
+
"""
|
|
607
|
+
raw = self._client._run_raw( # pyright: ignore[reportPrivateUsage]
|
|
608
|
+
"tiktok.ad_library_search", dict(input), options
|
|
609
|
+
)
|
|
610
|
+
return RunResult[TiktokAdLibrarySearchData].model_validate(raw)
|
|
611
|
+
|
|
612
|
+
def iter_ad_library_search(
|
|
613
|
+
self,
|
|
614
|
+
*,
|
|
615
|
+
options: RequestOptions | None = None,
|
|
616
|
+
**input: Unpack[TiktokAdLibrarySearchInput],
|
|
617
|
+
) -> Paginator[TiktokAdLibrarySearchAd, TiktokAdLibrarySearchData]:
|
|
618
|
+
"""Iterate TikTok Ad Library Search results, following pagination cursors.
|
|
619
|
+
|
|
620
|
+
Yields validated `TiktokAdLibrarySearchAd` items from the `ads` field of
|
|
621
|
+
each page. Use `.pages()` on the returned paginator to walk whole
|
|
622
|
+
`RunResult` pages.
|
|
623
|
+
"""
|
|
624
|
+
return paginate(
|
|
625
|
+
self._client,
|
|
626
|
+
"tiktok.ad_library_search",
|
|
627
|
+
dict(input),
|
|
628
|
+
"ads",
|
|
629
|
+
item_model=TiktokAdLibrarySearchAd,
|
|
630
|
+
data_model=TiktokAdLibrarySearchData,
|
|
631
|
+
bare=False,
|
|
632
|
+
options=options,
|
|
633
|
+
)
|
|
634
|
+
|
|
635
|
+
def audience_demographics(
|
|
636
|
+
self,
|
|
637
|
+
*,
|
|
638
|
+
options: RequestOptions | None = None,
|
|
639
|
+
**input: Unpack[TiktokAudienceDemographicsInput],
|
|
640
|
+
) -> RunResult[TiktokAudienceDemographicsData]:
|
|
641
|
+
"""TikTok Audience Demographics
|
|
642
|
+
|
|
643
|
+
Get the audience country breakdown (follower count and share per country)
|
|
644
|
+
for a TikTok creator by handle, normalized across providers.
|
|
645
|
+
|
|
646
|
+
Price: $0.01625 per request.
|
|
647
|
+
|
|
648
|
+
Example:
|
|
649
|
+
res = client.tiktok.audience_demographics(handle="shakira")
|
|
650
|
+
"""
|
|
651
|
+
raw = self._client._run_raw( # pyright: ignore[reportPrivateUsage]
|
|
652
|
+
"tiktok.audience_demographics", dict(input), options
|
|
653
|
+
)
|
|
654
|
+
return RunResult[TiktokAudienceDemographicsData].model_validate(raw)
|
|
655
|
+
|
|
656
|
+
def comment_replies(
|
|
657
|
+
self,
|
|
658
|
+
*,
|
|
659
|
+
options: RequestOptions | None = None,
|
|
660
|
+
**input: Unpack[TiktokCommentRepliesInput],
|
|
661
|
+
) -> RunResult[TiktokCommentRepliesData]:
|
|
662
|
+
"""TikTok Comment Replies
|
|
663
|
+
|
|
664
|
+
List the replies to a TikTok comment with cursor pagination (text, author,
|
|
665
|
+
likes), normalized across providers.
|
|
666
|
+
|
|
667
|
+
Price: $0.002 per request.
|
|
668
|
+
|
|
669
|
+
Example:
|
|
670
|
+
res = client.tiktok.comment_replies(commentId="7623828115408274207", url="https://www.tiktok.com/@stoolpresidente/video/7623818255903329566")
|
|
671
|
+
"""
|
|
672
|
+
raw = self._client._run_raw( # pyright: ignore[reportPrivateUsage]
|
|
673
|
+
"tiktok.comment_replies", dict(input), options
|
|
674
|
+
)
|
|
675
|
+
return RunResult[TiktokCommentRepliesData].model_validate(raw)
|
|
676
|
+
|
|
677
|
+
def iter_comment_replies(
|
|
678
|
+
self,
|
|
679
|
+
*,
|
|
680
|
+
options: RequestOptions | None = None,
|
|
681
|
+
**input: Unpack[TiktokCommentRepliesInput],
|
|
682
|
+
) -> Paginator[TiktokCommentRepliesComment, TiktokCommentRepliesData]:
|
|
683
|
+
"""Iterate TikTok Comment Replies results, following pagination cursors.
|
|
684
|
+
|
|
685
|
+
Yields validated `TiktokCommentRepliesComment` items from the `comments` field of
|
|
686
|
+
each page. Use `.pages()` on the returned paginator to walk whole
|
|
687
|
+
`RunResult` pages.
|
|
688
|
+
"""
|
|
689
|
+
return paginate(
|
|
690
|
+
self._client,
|
|
691
|
+
"tiktok.comment_replies",
|
|
692
|
+
dict(input),
|
|
693
|
+
"comments",
|
|
694
|
+
item_model=TiktokCommentRepliesComment,
|
|
695
|
+
data_model=TiktokCommentRepliesData,
|
|
696
|
+
bare=False,
|
|
697
|
+
options=options,
|
|
698
|
+
)
|
|
699
|
+
|
|
700
|
+
def followers(
|
|
701
|
+
self,
|
|
702
|
+
*,
|
|
703
|
+
options: RequestOptions | None = None,
|
|
704
|
+
**input: Unpack[TiktokFollowersInput],
|
|
705
|
+
) -> RunResult[TiktokFollowersData]:
|
|
706
|
+
"""TikTok Followers
|
|
707
|
+
|
|
708
|
+
List the followers of a TikTok account by username, returning each
|
|
709
|
+
follower's profile basics, with transparent per-request USD pricing.
|
|
710
|
+
|
|
711
|
+
Price: $0.002 per request.
|
|
712
|
+
|
|
713
|
+
Example:
|
|
714
|
+
res = client.tiktok.followers(handle="stoolpresidente")
|
|
715
|
+
"""
|
|
716
|
+
raw = self._client._run_raw( # pyright: ignore[reportPrivateUsage]
|
|
717
|
+
"tiktok.followers", dict(input), options
|
|
718
|
+
)
|
|
719
|
+
return RunResult[TiktokFollowersData].model_validate(raw)
|
|
720
|
+
|
|
721
|
+
def iter_followers(
|
|
722
|
+
self,
|
|
723
|
+
*,
|
|
724
|
+
options: RequestOptions | None = None,
|
|
725
|
+
**input: Unpack[TiktokFollowersInput],
|
|
726
|
+
) -> Paginator[TiktokFollowersFollower, TiktokFollowersData]:
|
|
727
|
+
"""Iterate TikTok Followers results, following pagination cursors.
|
|
728
|
+
|
|
729
|
+
Yields validated `TiktokFollowersFollower` items from the `followers` field of
|
|
730
|
+
each page. Use `.pages()` on the returned paginator to walk whole
|
|
731
|
+
`RunResult` pages.
|
|
732
|
+
"""
|
|
733
|
+
return paginate(
|
|
734
|
+
self._client,
|
|
735
|
+
"tiktok.followers",
|
|
736
|
+
dict(input),
|
|
737
|
+
"followers",
|
|
738
|
+
item_model=TiktokFollowersFollower,
|
|
739
|
+
data_model=TiktokFollowersData,
|
|
740
|
+
bare=False,
|
|
741
|
+
options=options,
|
|
742
|
+
)
|
|
743
|
+
|
|
744
|
+
def following(
|
|
745
|
+
self,
|
|
746
|
+
*,
|
|
747
|
+
options: RequestOptions | None = None,
|
|
748
|
+
**input: Unpack[TiktokFollowingInput],
|
|
749
|
+
) -> RunResult[TiktokFollowingData]:
|
|
750
|
+
"""TikTok Following
|
|
751
|
+
|
|
752
|
+
List the accounts a TikTok user follows (handle, display name, follower
|
|
753
|
+
count, bio) by username, normalized across providers.
|
|
754
|
+
|
|
755
|
+
Price: $0.002 per request.
|
|
756
|
+
|
|
757
|
+
Example:
|
|
758
|
+
res = client.tiktok.following(handle="stoolpresidente")
|
|
759
|
+
"""
|
|
760
|
+
raw = self._client._run_raw( # pyright: ignore[reportPrivateUsage]
|
|
761
|
+
"tiktok.following", dict(input), options
|
|
762
|
+
)
|
|
763
|
+
return RunResult[TiktokFollowingData].model_validate(raw)
|
|
764
|
+
|
|
765
|
+
def hashtag_videos(
|
|
766
|
+
self,
|
|
767
|
+
*,
|
|
768
|
+
options: RequestOptions | None = None,
|
|
769
|
+
**input: Unpack[TiktokHashtagVideosInput],
|
|
770
|
+
) -> RunResult[TiktokHashtagVideosData]:
|
|
771
|
+
"""TikTok Hashtag Videos
|
|
772
|
+
|
|
773
|
+
List recent TikTok videos for a hashtag (creator, caption, views, likes,
|
|
774
|
+
shares), normalized output with transparent per-request USD pricing.
|
|
775
|
+
|
|
776
|
+
Price: $0.00325 per request.
|
|
777
|
+
|
|
778
|
+
Example:
|
|
779
|
+
res = client.tiktok.hashtag_videos(hashtag="cooking", limit=3)
|
|
780
|
+
"""
|
|
781
|
+
raw = self._client._run_raw( # pyright: ignore[reportPrivateUsage]
|
|
782
|
+
"tiktok.hashtag_videos", dict(input), options
|
|
783
|
+
)
|
|
784
|
+
return RunResult[TiktokHashtagVideosData].model_validate(raw)
|
|
785
|
+
|
|
786
|
+
def live(
|
|
787
|
+
self, *, options: RequestOptions | None = None, **input: Unpack[TiktokLiveInput]
|
|
788
|
+
) -> RunResult[TiktokLiveData]:
|
|
789
|
+
"""TikTok Live
|
|
790
|
+
|
|
791
|
+
Check whether a TikTok creator is live and get the current live room (title,
|
|
792
|
+
viewers, start time) by handle, normalized across providers.
|
|
793
|
+
|
|
794
|
+
Price: $0.002 per request.
|
|
795
|
+
|
|
796
|
+
Example:
|
|
797
|
+
res = client.tiktok.live(handle="thejustalex")
|
|
798
|
+
"""
|
|
799
|
+
raw = self._client._run_raw( # pyright: ignore[reportPrivateUsage]
|
|
800
|
+
"tiktok.live", dict(input), options
|
|
801
|
+
)
|
|
802
|
+
return RunResult[TiktokLiveData].model_validate(raw)
|
|
803
|
+
|
|
804
|
+
def profile(
|
|
805
|
+
self,
|
|
806
|
+
*,
|
|
807
|
+
options: RequestOptions | None = None,
|
|
808
|
+
**input: Unpack[TiktokProfileInput],
|
|
809
|
+
) -> RunResult[TiktokProfileData]:
|
|
810
|
+
"""TikTok Profile
|
|
811
|
+
|
|
812
|
+
Fetch a TikTok creator's public profile (followers, likes, bio,
|
|
813
|
+
verification) by handle, normalized across providers with transparent
|
|
814
|
+
failover.
|
|
815
|
+
|
|
816
|
+
Price: $0.001 per request.
|
|
817
|
+
|
|
818
|
+
Example:
|
|
819
|
+
res = client.tiktok.profile(handle="zachking")
|
|
820
|
+
"""
|
|
821
|
+
raw = self._client._run_raw( # pyright: ignore[reportPrivateUsage]
|
|
822
|
+
"tiktok.profile", dict(input), options
|
|
823
|
+
)
|
|
824
|
+
return RunResult[TiktokProfileData].model_validate(raw)
|
|
825
|
+
|
|
826
|
+
def profile_region(
|
|
827
|
+
self,
|
|
828
|
+
*,
|
|
829
|
+
options: RequestOptions | None = None,
|
|
830
|
+
**input: Unpack[TiktokProfileRegionInput],
|
|
831
|
+
) -> RunResult[TiktokProfileRegionData]:
|
|
832
|
+
"""TikTok Profile Region
|
|
833
|
+
|
|
834
|
+
Resolve the home region (country) of a TikTok creator by handle, normalized
|
|
835
|
+
across providers with transparent failover.
|
|
836
|
+
|
|
837
|
+
Price: $0.002 per request.
|
|
838
|
+
|
|
839
|
+
Example:
|
|
840
|
+
res = client.tiktok.profile_region(handle="stoolpresidente")
|
|
841
|
+
"""
|
|
842
|
+
raw = self._client._run_raw( # pyright: ignore[reportPrivateUsage]
|
|
843
|
+
"tiktok.profile_region", dict(input), options
|
|
844
|
+
)
|
|
845
|
+
return RunResult[TiktokProfileRegionData].model_validate(raw)
|
|
846
|
+
|
|
847
|
+
def profile_videos(
|
|
848
|
+
self,
|
|
849
|
+
*,
|
|
850
|
+
options: RequestOptions | None = None,
|
|
851
|
+
**input: Unpack[TiktokProfileVideosInput],
|
|
852
|
+
) -> RunResult[TiktokProfileVideosData]:
|
|
853
|
+
"""TikTok Profile Videos
|
|
854
|
+
|
|
855
|
+
List a TikTok creator's recent videos (views, likes, comments) by handle
|
|
856
|
+
with cursor pagination, normalized across providers.
|
|
857
|
+
|
|
858
|
+
Price: $0.001 per request.
|
|
859
|
+
|
|
860
|
+
Example:
|
|
861
|
+
res = client.tiktok.profile_videos(handle="zachking")
|
|
862
|
+
"""
|
|
863
|
+
raw = self._client._run_raw( # pyright: ignore[reportPrivateUsage]
|
|
864
|
+
"tiktok.profile_videos", dict(input), options
|
|
865
|
+
)
|
|
866
|
+
return RunResult[TiktokProfileVideosData].model_validate(raw)
|
|
867
|
+
|
|
868
|
+
def iter_profile_videos(
|
|
869
|
+
self,
|
|
870
|
+
*,
|
|
871
|
+
options: RequestOptions | None = None,
|
|
872
|
+
**input: Unpack[TiktokProfileVideosInput],
|
|
873
|
+
) -> Paginator[TiktokProfileVideosVideo, TiktokProfileVideosData]:
|
|
874
|
+
"""Iterate TikTok Profile Videos results, following pagination cursors.
|
|
875
|
+
|
|
876
|
+
Yields validated `TiktokProfileVideosVideo` items from the `videos` field of
|
|
877
|
+
each page. Use `.pages()` on the returned paginator to walk whole
|
|
878
|
+
`RunResult` pages.
|
|
879
|
+
"""
|
|
880
|
+
return paginate(
|
|
881
|
+
self._client,
|
|
882
|
+
"tiktok.profile_videos",
|
|
883
|
+
dict(input),
|
|
884
|
+
"videos",
|
|
885
|
+
item_model=TiktokProfileVideosVideo,
|
|
886
|
+
data_model=TiktokProfileVideosData,
|
|
887
|
+
bare=False,
|
|
888
|
+
options=options,
|
|
889
|
+
)
|
|
890
|
+
|
|
891
|
+
def search_hashtag(
|
|
892
|
+
self,
|
|
893
|
+
*,
|
|
894
|
+
options: RequestOptions | None = None,
|
|
895
|
+
**input: Unpack[TiktokSearchHashtagInput],
|
|
896
|
+
) -> RunResult[TiktokSearchHashtagData]:
|
|
897
|
+
"""TikTok Hashtag Search
|
|
898
|
+
|
|
899
|
+
Search TikTok by hashtag and get matching videos (caption, views, likes,
|
|
900
|
+
comments, shares) as normalized JSON, across providers with transparent
|
|
901
|
+
failover.
|
|
902
|
+
|
|
903
|
+
Price: $0.002 per request.
|
|
904
|
+
|
|
905
|
+
Example:
|
|
906
|
+
res = client.tiktok.search_hashtag(query="recipe")
|
|
907
|
+
"""
|
|
908
|
+
raw = self._client._run_raw( # pyright: ignore[reportPrivateUsage]
|
|
909
|
+
"tiktok.search_hashtag", dict(input), options
|
|
910
|
+
)
|
|
911
|
+
return RunResult[TiktokSearchHashtagData].model_validate(raw)
|
|
912
|
+
|
|
913
|
+
def search_keyword(
|
|
914
|
+
self,
|
|
915
|
+
*,
|
|
916
|
+
options: RequestOptions | None = None,
|
|
917
|
+
**input: Unpack[TiktokSearchKeywordInput],
|
|
918
|
+
) -> RunResult[TiktokSearchKeywordData]:
|
|
919
|
+
"""TikTok Keyword Search
|
|
920
|
+
|
|
921
|
+
Search TikTok by keyword and get matching videos (caption, views, likes,
|
|
922
|
+
comments, shares) as normalized JSON, across providers with transparent
|
|
923
|
+
failover.
|
|
924
|
+
|
|
925
|
+
Price: $0.001 per request.
|
|
926
|
+
|
|
927
|
+
Example:
|
|
928
|
+
res = client.tiktok.search_keyword(query="cooking")
|
|
929
|
+
"""
|
|
930
|
+
raw = self._client._run_raw( # pyright: ignore[reportPrivateUsage]
|
|
931
|
+
"tiktok.search_keyword", dict(input), options
|
|
932
|
+
)
|
|
933
|
+
return RunResult[TiktokSearchKeywordData].model_validate(raw)
|
|
934
|
+
|
|
935
|
+
def search_top(
|
|
936
|
+
self,
|
|
937
|
+
*,
|
|
938
|
+
options: RequestOptions | None = None,
|
|
939
|
+
**input: Unpack[TiktokSearchTopInput],
|
|
940
|
+
) -> RunResult[TiktokSearchTopData]:
|
|
941
|
+
"""TikTok Top Search
|
|
942
|
+
|
|
943
|
+
Search TikTok's top results for a keyword (caption, views, likes, comments,
|
|
944
|
+
shares) with cursor pagination, normalized across providers.
|
|
945
|
+
|
|
946
|
+
Price: $0.002 per request.
|
|
947
|
+
|
|
948
|
+
Example:
|
|
949
|
+
res = client.tiktok.search_top(query="funny")
|
|
950
|
+
"""
|
|
951
|
+
raw = self._client._run_raw( # pyright: ignore[reportPrivateUsage]
|
|
952
|
+
"tiktok.search_top", dict(input), options
|
|
953
|
+
)
|
|
954
|
+
return RunResult[TiktokSearchTopData].model_validate(raw)
|
|
955
|
+
|
|
956
|
+
def iter_search_top(
|
|
957
|
+
self,
|
|
958
|
+
*,
|
|
959
|
+
options: RequestOptions | None = None,
|
|
960
|
+
**input: Unpack[TiktokSearchTopInput],
|
|
961
|
+
) -> Paginator[TiktokSearchTopItem, TiktokSearchTopData]:
|
|
962
|
+
"""Iterate TikTok Top Search results, following pagination cursors.
|
|
963
|
+
|
|
964
|
+
Yields validated `TiktokSearchTopItem` items from the `items` field of
|
|
965
|
+
each page. Use `.pages()` on the returned paginator to walk whole
|
|
966
|
+
`RunResult` pages.
|
|
967
|
+
"""
|
|
968
|
+
return paginate(
|
|
969
|
+
self._client,
|
|
970
|
+
"tiktok.search_top",
|
|
971
|
+
dict(input),
|
|
972
|
+
"items",
|
|
973
|
+
item_model=TiktokSearchTopItem,
|
|
974
|
+
data_model=TiktokSearchTopData,
|
|
975
|
+
bare=False,
|
|
976
|
+
options=options,
|
|
977
|
+
)
|
|
978
|
+
|
|
979
|
+
def search_users(
|
|
980
|
+
self,
|
|
981
|
+
*,
|
|
982
|
+
options: RequestOptions | None = None,
|
|
983
|
+
**input: Unpack[TiktokSearchUsersInput],
|
|
984
|
+
) -> RunResult[TiktokSearchUsersData]:
|
|
985
|
+
"""TikTok User Search
|
|
986
|
+
|
|
987
|
+
Search TikTok accounts by keyword (handle, nickname, follower count) with
|
|
988
|
+
cursor pagination, normalized across providers.
|
|
989
|
+
|
|
990
|
+
Price: $0.001 per request.
|
|
991
|
+
|
|
992
|
+
Example:
|
|
993
|
+
res = client.tiktok.search_users(query="chef")
|
|
994
|
+
"""
|
|
995
|
+
raw = self._client._run_raw( # pyright: ignore[reportPrivateUsage]
|
|
996
|
+
"tiktok.search_users", dict(input), options
|
|
997
|
+
)
|
|
998
|
+
return RunResult[TiktokSearchUsersData].model_validate(raw)
|
|
999
|
+
|
|
1000
|
+
def iter_search_users(
|
|
1001
|
+
self,
|
|
1002
|
+
*,
|
|
1003
|
+
options: RequestOptions | None = None,
|
|
1004
|
+
**input: Unpack[TiktokSearchUsersInput],
|
|
1005
|
+
) -> Paginator[TiktokSearchUsersUser, TiktokSearchUsersData]:
|
|
1006
|
+
"""Iterate TikTok User Search results, following pagination cursors.
|
|
1007
|
+
|
|
1008
|
+
Yields validated `TiktokSearchUsersUser` items from the `users` field of
|
|
1009
|
+
each page. Use `.pages()` on the returned paginator to walk whole
|
|
1010
|
+
`RunResult` pages.
|
|
1011
|
+
"""
|
|
1012
|
+
return paginate(
|
|
1013
|
+
self._client,
|
|
1014
|
+
"tiktok.search_users",
|
|
1015
|
+
dict(input),
|
|
1016
|
+
"users",
|
|
1017
|
+
item_model=TiktokSearchUsersUser,
|
|
1018
|
+
data_model=TiktokSearchUsersData,
|
|
1019
|
+
bare=False,
|
|
1020
|
+
options=options,
|
|
1021
|
+
)
|
|
1022
|
+
|
|
1023
|
+
def song(
|
|
1024
|
+
self, *, options: RequestOptions | None = None, **input: Unpack[TiktokSongInput]
|
|
1025
|
+
) -> RunResult[TiktokSongData]:
|
|
1026
|
+
"""TikTok Song
|
|
1027
|
+
|
|
1028
|
+
Fetch details for a TikTok song or sound - title, author, duration, cover
|
|
1029
|
+
art, and how many videos use it - normalized across providers with
|
|
1030
|
+
transparent failover.
|
|
1031
|
+
|
|
1032
|
+
Price: $0.002 per request.
|
|
1033
|
+
|
|
1034
|
+
Example:
|
|
1035
|
+
res = client.tiktok.song(clipId="7439295283975702544")
|
|
1036
|
+
"""
|
|
1037
|
+
raw = self._client._run_raw( # pyright: ignore[reportPrivateUsage]
|
|
1038
|
+
"tiktok.song", dict(input), options
|
|
1039
|
+
)
|
|
1040
|
+
return RunResult[TiktokSongData].model_validate(raw)
|
|
1041
|
+
|
|
1042
|
+
def song_videos(
|
|
1043
|
+
self,
|
|
1044
|
+
*,
|
|
1045
|
+
options: RequestOptions | None = None,
|
|
1046
|
+
**input: Unpack[TiktokSongVideosInput],
|
|
1047
|
+
) -> RunResult[TiktokSongVideosData]:
|
|
1048
|
+
"""TikTok Song Videos
|
|
1049
|
+
|
|
1050
|
+
List TikTok videos that use a given song or sound - with descriptions,
|
|
1051
|
+
authors, and engagement stats - normalized across providers with transparent
|
|
1052
|
+
failover.
|
|
1053
|
+
|
|
1054
|
+
Price: $0.002 per request.
|
|
1055
|
+
|
|
1056
|
+
Example:
|
|
1057
|
+
res = client.tiktok.song_videos(clipId="7439295283975702544")
|
|
1058
|
+
"""
|
|
1059
|
+
raw = self._client._run_raw( # pyright: ignore[reportPrivateUsage]
|
|
1060
|
+
"tiktok.song_videos", dict(input), options
|
|
1061
|
+
)
|
|
1062
|
+
return RunResult[TiktokSongVideosData].model_validate(raw)
|
|
1063
|
+
|
|
1064
|
+
def iter_song_videos(
|
|
1065
|
+
self,
|
|
1066
|
+
*,
|
|
1067
|
+
options: RequestOptions | None = None,
|
|
1068
|
+
**input: Unpack[TiktokSongVideosInput],
|
|
1069
|
+
) -> Paginator[TiktokSongVideosVideo, TiktokSongVideosData]:
|
|
1070
|
+
"""Iterate TikTok Song Videos results, following pagination cursors.
|
|
1071
|
+
|
|
1072
|
+
Yields validated `TiktokSongVideosVideo` items from the `videos` field of
|
|
1073
|
+
each page. Use `.pages()` on the returned paginator to walk whole
|
|
1074
|
+
`RunResult` pages.
|
|
1075
|
+
"""
|
|
1076
|
+
return paginate(
|
|
1077
|
+
self._client,
|
|
1078
|
+
"tiktok.song_videos",
|
|
1079
|
+
dict(input),
|
|
1080
|
+
"videos",
|
|
1081
|
+
item_model=TiktokSongVideosVideo,
|
|
1082
|
+
data_model=TiktokSongVideosData,
|
|
1083
|
+
bare=False,
|
|
1084
|
+
options=options,
|
|
1085
|
+
)
|
|
1086
|
+
|
|
1087
|
+
def trending_feed(
|
|
1088
|
+
self,
|
|
1089
|
+
*,
|
|
1090
|
+
options: RequestOptions | None = None,
|
|
1091
|
+
**input: Unpack[TiktokTrendingFeedInput],
|
|
1092
|
+
) -> RunResult[TiktokTrendingFeedData]:
|
|
1093
|
+
"""TikTok Trending Feed
|
|
1094
|
+
|
|
1095
|
+
Get TikTok's trending feed for a region (caption, views, likes, comments,
|
|
1096
|
+
author) as normalized JSON, across providers with transparent failover.
|
|
1097
|
+
|
|
1098
|
+
Price: $0.002 per request.
|
|
1099
|
+
|
|
1100
|
+
Example:
|
|
1101
|
+
res = client.tiktok.trending_feed(region="US")
|
|
1102
|
+
"""
|
|
1103
|
+
raw = self._client._run_raw( # pyright: ignore[reportPrivateUsage]
|
|
1104
|
+
"tiktok.trending_feed", dict(input), options
|
|
1105
|
+
)
|
|
1106
|
+
return RunResult[TiktokTrendingFeedData].model_validate(raw)
|
|
1107
|
+
|
|
1108
|
+
def video(
|
|
1109
|
+
self,
|
|
1110
|
+
*,
|
|
1111
|
+
options: RequestOptions | None = None,
|
|
1112
|
+
**input: Unpack[TiktokVideoInput],
|
|
1113
|
+
) -> RunResult[TiktokVideoData]:
|
|
1114
|
+
"""TikTok Video
|
|
1115
|
+
|
|
1116
|
+
Fetch a single TikTok video by URL with its caption and engagement counts
|
|
1117
|
+
(views, likes, comments, shares, saves), normalized across providers with
|
|
1118
|
+
transparent failover.
|
|
1119
|
+
|
|
1120
|
+
Price: $0.001 per request.
|
|
1121
|
+
|
|
1122
|
+
Example:
|
|
1123
|
+
res = client.tiktok.video(url="https://www.tiktok.com/@mrbeast/video/7654638524729216287?_r=1&u_code=elgjf3ff8cajhk&preview_pb=0&sharer_language=en&_d=elh6737j6kjl71&share_item_id=7654638524729216287&source=h5_m")
|
|
1124
|
+
"""
|
|
1125
|
+
raw = self._client._run_raw( # pyright: ignore[reportPrivateUsage]
|
|
1126
|
+
"tiktok.video", dict(input), options
|
|
1127
|
+
)
|
|
1128
|
+
return RunResult[TiktokVideoData].model_validate(raw)
|
|
1129
|
+
|
|
1130
|
+
def video_comments(
|
|
1131
|
+
self,
|
|
1132
|
+
*,
|
|
1133
|
+
options: RequestOptions | None = None,
|
|
1134
|
+
**input: Unpack[TiktokVideoCommentsInput],
|
|
1135
|
+
) -> RunResult[TiktokVideoCommentsData]:
|
|
1136
|
+
"""TikTok Video Comments
|
|
1137
|
+
|
|
1138
|
+
List the comments on a TikTok video by URL with cursor pagination (text,
|
|
1139
|
+
author, likes, reply count), normalized across providers.
|
|
1140
|
+
|
|
1141
|
+
Price: $0.002 per request.
|
|
1142
|
+
|
|
1143
|
+
Example:
|
|
1144
|
+
res = client.tiktok.video_comments(url="https://www.tiktok.com/@zachking/video/7650468599424945422?_r=1&u_code=f0hj7d780760m9&preview_pb=0&sharer_language=en&_d=f0hj7blh067h71&share_item_id=7650468599424945422&source=h5_m")
|
|
1145
|
+
"""
|
|
1146
|
+
raw = self._client._run_raw( # pyright: ignore[reportPrivateUsage]
|
|
1147
|
+
"tiktok.video_comments", dict(input), options
|
|
1148
|
+
)
|
|
1149
|
+
return RunResult[TiktokVideoCommentsData].model_validate(raw)
|
|
1150
|
+
|
|
1151
|
+
def iter_video_comments(
|
|
1152
|
+
self,
|
|
1153
|
+
*,
|
|
1154
|
+
options: RequestOptions | None = None,
|
|
1155
|
+
**input: Unpack[TiktokVideoCommentsInput],
|
|
1156
|
+
) -> Paginator[TiktokVideoCommentsComment, TiktokVideoCommentsData]:
|
|
1157
|
+
"""Iterate TikTok Video Comments results, following pagination cursors.
|
|
1158
|
+
|
|
1159
|
+
Yields validated `TiktokVideoCommentsComment` items from the `comments` field of
|
|
1160
|
+
each page. Use `.pages()` on the returned paginator to walk whole
|
|
1161
|
+
`RunResult` pages.
|
|
1162
|
+
"""
|
|
1163
|
+
return paginate(
|
|
1164
|
+
self._client,
|
|
1165
|
+
"tiktok.video_comments",
|
|
1166
|
+
dict(input),
|
|
1167
|
+
"comments",
|
|
1168
|
+
item_model=TiktokVideoCommentsComment,
|
|
1169
|
+
data_model=TiktokVideoCommentsData,
|
|
1170
|
+
bare=False,
|
|
1171
|
+
options=options,
|
|
1172
|
+
)
|
|
1173
|
+
|
|
1174
|
+
def video_transcript(
|
|
1175
|
+
self,
|
|
1176
|
+
*,
|
|
1177
|
+
options: RequestOptions | None = None,
|
|
1178
|
+
**input: Unpack[TiktokVideoTranscriptInput],
|
|
1179
|
+
) -> RunResult[TiktokVideoTranscriptData]:
|
|
1180
|
+
"""TikTok Video Transcript
|
|
1181
|
+
|
|
1182
|
+
Fetch the spoken-word transcript of a TikTok video by URL, normalized across
|
|
1183
|
+
providers with transparent failover.
|
|
1184
|
+
|
|
1185
|
+
Price: $0.002 per request.
|
|
1186
|
+
|
|
1187
|
+
Example:
|
|
1188
|
+
res = client.tiktok.video_transcript(url="https://www.tiktok.com/@washingtonpost/video/7609177768793787679")
|
|
1189
|
+
"""
|
|
1190
|
+
raw = self._client._run_raw( # pyright: ignore[reportPrivateUsage]
|
|
1191
|
+
"tiktok.video_transcript", dict(input), options
|
|
1192
|
+
)
|
|
1193
|
+
return RunResult[TiktokVideoTranscriptData].model_validate(raw)
|
|
1194
|
+
|
|
1195
|
+
|
|
1196
|
+
class AsyncTiktokNamespace:
|
|
1197
|
+
"""Typed methods for this platform. Attached lazily to the client."""
|
|
1198
|
+
|
|
1199
|
+
def __init__(self, client: "AsyncAnyAPI") -> None:
|
|
1200
|
+
self._client = client
|
|
1201
|
+
|
|
1202
|
+
async def ad_library_ad(
|
|
1203
|
+
self,
|
|
1204
|
+
*,
|
|
1205
|
+
options: RequestOptions | None = None,
|
|
1206
|
+
**input: Unpack[TiktokAdLibraryAdInput],
|
|
1207
|
+
) -> RunResult[TiktokAdLibraryAdData]:
|
|
1208
|
+
"""TikTok Ad Library Ad
|
|
1209
|
+
|
|
1210
|
+
Fetch full details for a single TikTok ad - brand, title, spend, CTR,
|
|
1211
|
+
objectives, landing page, and video info - normalized across providers with
|
|
1212
|
+
transparent failover.
|
|
1213
|
+
|
|
1214
|
+
Price: $0.002 per request.
|
|
1215
|
+
|
|
1216
|
+
Example:
|
|
1217
|
+
res = client.tiktok.ad_library_ad(adId="7648493525660270600")
|
|
1218
|
+
"""
|
|
1219
|
+
raw = await self._client._arun_raw( # pyright: ignore[reportPrivateUsage]
|
|
1220
|
+
"tiktok.ad_library_ad", dict(input), options
|
|
1221
|
+
)
|
|
1222
|
+
return RunResult[TiktokAdLibraryAdData].model_validate(raw)
|
|
1223
|
+
|
|
1224
|
+
async def ad_library_search(
|
|
1225
|
+
self,
|
|
1226
|
+
*,
|
|
1227
|
+
options: RequestOptions | None = None,
|
|
1228
|
+
**input: Unpack[TiktokAdLibrarySearchInput],
|
|
1229
|
+
) -> RunResult[TiktokAdLibrarySearchData]:
|
|
1230
|
+
"""TikTok Ad Library Search
|
|
1231
|
+
|
|
1232
|
+
Search TikTok's ad library by keyword - top ads with brand, title, spend,
|
|
1233
|
+
CTR, likes, and video info - normalized across providers with transparent
|
|
1234
|
+
failover.
|
|
1235
|
+
|
|
1236
|
+
Price: $0.002 per request.
|
|
1237
|
+
|
|
1238
|
+
Example:
|
|
1239
|
+
res = client.tiktok.ad_library_search(query="spotify")
|
|
1240
|
+
"""
|
|
1241
|
+
raw = await self._client._arun_raw( # pyright: ignore[reportPrivateUsage]
|
|
1242
|
+
"tiktok.ad_library_search", dict(input), options
|
|
1243
|
+
)
|
|
1244
|
+
return RunResult[TiktokAdLibrarySearchData].model_validate(raw)
|
|
1245
|
+
|
|
1246
|
+
def iter_ad_library_search(
|
|
1247
|
+
self,
|
|
1248
|
+
*,
|
|
1249
|
+
options: RequestOptions | None = None,
|
|
1250
|
+
**input: Unpack[TiktokAdLibrarySearchInput],
|
|
1251
|
+
) -> AsyncPaginator[TiktokAdLibrarySearchAd, TiktokAdLibrarySearchData]:
|
|
1252
|
+
"""Iterate TikTok Ad Library Search results, following pagination cursors.
|
|
1253
|
+
|
|
1254
|
+
Yields validated `TiktokAdLibrarySearchAd` items from the `ads` field of
|
|
1255
|
+
each page. Use `.pages()` on the returned paginator to walk whole
|
|
1256
|
+
`RunResult` pages.
|
|
1257
|
+
"""
|
|
1258
|
+
return apaginate(
|
|
1259
|
+
self._client,
|
|
1260
|
+
"tiktok.ad_library_search",
|
|
1261
|
+
dict(input),
|
|
1262
|
+
"ads",
|
|
1263
|
+
item_model=TiktokAdLibrarySearchAd,
|
|
1264
|
+
data_model=TiktokAdLibrarySearchData,
|
|
1265
|
+
bare=False,
|
|
1266
|
+
options=options,
|
|
1267
|
+
)
|
|
1268
|
+
|
|
1269
|
+
async def audience_demographics(
|
|
1270
|
+
self,
|
|
1271
|
+
*,
|
|
1272
|
+
options: RequestOptions | None = None,
|
|
1273
|
+
**input: Unpack[TiktokAudienceDemographicsInput],
|
|
1274
|
+
) -> RunResult[TiktokAudienceDemographicsData]:
|
|
1275
|
+
"""TikTok Audience Demographics
|
|
1276
|
+
|
|
1277
|
+
Get the audience country breakdown (follower count and share per country)
|
|
1278
|
+
for a TikTok creator by handle, normalized across providers.
|
|
1279
|
+
|
|
1280
|
+
Price: $0.01625 per request.
|
|
1281
|
+
|
|
1282
|
+
Example:
|
|
1283
|
+
res = client.tiktok.audience_demographics(handle="shakira")
|
|
1284
|
+
"""
|
|
1285
|
+
raw = await self._client._arun_raw( # pyright: ignore[reportPrivateUsage]
|
|
1286
|
+
"tiktok.audience_demographics", dict(input), options
|
|
1287
|
+
)
|
|
1288
|
+
return RunResult[TiktokAudienceDemographicsData].model_validate(raw)
|
|
1289
|
+
|
|
1290
|
+
async def comment_replies(
|
|
1291
|
+
self,
|
|
1292
|
+
*,
|
|
1293
|
+
options: RequestOptions | None = None,
|
|
1294
|
+
**input: Unpack[TiktokCommentRepliesInput],
|
|
1295
|
+
) -> RunResult[TiktokCommentRepliesData]:
|
|
1296
|
+
"""TikTok Comment Replies
|
|
1297
|
+
|
|
1298
|
+
List the replies to a TikTok comment with cursor pagination (text, author,
|
|
1299
|
+
likes), normalized across providers.
|
|
1300
|
+
|
|
1301
|
+
Price: $0.002 per request.
|
|
1302
|
+
|
|
1303
|
+
Example:
|
|
1304
|
+
res = client.tiktok.comment_replies(commentId="7623828115408274207", url="https://www.tiktok.com/@stoolpresidente/video/7623818255903329566")
|
|
1305
|
+
"""
|
|
1306
|
+
raw = await self._client._arun_raw( # pyright: ignore[reportPrivateUsage]
|
|
1307
|
+
"tiktok.comment_replies", dict(input), options
|
|
1308
|
+
)
|
|
1309
|
+
return RunResult[TiktokCommentRepliesData].model_validate(raw)
|
|
1310
|
+
|
|
1311
|
+
def iter_comment_replies(
|
|
1312
|
+
self,
|
|
1313
|
+
*,
|
|
1314
|
+
options: RequestOptions | None = None,
|
|
1315
|
+
**input: Unpack[TiktokCommentRepliesInput],
|
|
1316
|
+
) -> AsyncPaginator[TiktokCommentRepliesComment, TiktokCommentRepliesData]:
|
|
1317
|
+
"""Iterate TikTok Comment Replies results, following pagination cursors.
|
|
1318
|
+
|
|
1319
|
+
Yields validated `TiktokCommentRepliesComment` items from the `comments` field of
|
|
1320
|
+
each page. Use `.pages()` on the returned paginator to walk whole
|
|
1321
|
+
`RunResult` pages.
|
|
1322
|
+
"""
|
|
1323
|
+
return apaginate(
|
|
1324
|
+
self._client,
|
|
1325
|
+
"tiktok.comment_replies",
|
|
1326
|
+
dict(input),
|
|
1327
|
+
"comments",
|
|
1328
|
+
item_model=TiktokCommentRepliesComment,
|
|
1329
|
+
data_model=TiktokCommentRepliesData,
|
|
1330
|
+
bare=False,
|
|
1331
|
+
options=options,
|
|
1332
|
+
)
|
|
1333
|
+
|
|
1334
|
+
async def followers(
|
|
1335
|
+
self,
|
|
1336
|
+
*,
|
|
1337
|
+
options: RequestOptions | None = None,
|
|
1338
|
+
**input: Unpack[TiktokFollowersInput],
|
|
1339
|
+
) -> RunResult[TiktokFollowersData]:
|
|
1340
|
+
"""TikTok Followers
|
|
1341
|
+
|
|
1342
|
+
List the followers of a TikTok account by username, returning each
|
|
1343
|
+
follower's profile basics, with transparent per-request USD pricing.
|
|
1344
|
+
|
|
1345
|
+
Price: $0.002 per request.
|
|
1346
|
+
|
|
1347
|
+
Example:
|
|
1348
|
+
res = client.tiktok.followers(handle="stoolpresidente")
|
|
1349
|
+
"""
|
|
1350
|
+
raw = await self._client._arun_raw( # pyright: ignore[reportPrivateUsage]
|
|
1351
|
+
"tiktok.followers", dict(input), options
|
|
1352
|
+
)
|
|
1353
|
+
return RunResult[TiktokFollowersData].model_validate(raw)
|
|
1354
|
+
|
|
1355
|
+
def iter_followers(
|
|
1356
|
+
self,
|
|
1357
|
+
*,
|
|
1358
|
+
options: RequestOptions | None = None,
|
|
1359
|
+
**input: Unpack[TiktokFollowersInput],
|
|
1360
|
+
) -> AsyncPaginator[TiktokFollowersFollower, TiktokFollowersData]:
|
|
1361
|
+
"""Iterate TikTok Followers results, following pagination cursors.
|
|
1362
|
+
|
|
1363
|
+
Yields validated `TiktokFollowersFollower` items from the `followers` field of
|
|
1364
|
+
each page. Use `.pages()` on the returned paginator to walk whole
|
|
1365
|
+
`RunResult` pages.
|
|
1366
|
+
"""
|
|
1367
|
+
return apaginate(
|
|
1368
|
+
self._client,
|
|
1369
|
+
"tiktok.followers",
|
|
1370
|
+
dict(input),
|
|
1371
|
+
"followers",
|
|
1372
|
+
item_model=TiktokFollowersFollower,
|
|
1373
|
+
data_model=TiktokFollowersData,
|
|
1374
|
+
bare=False,
|
|
1375
|
+
options=options,
|
|
1376
|
+
)
|
|
1377
|
+
|
|
1378
|
+
async def following(
|
|
1379
|
+
self,
|
|
1380
|
+
*,
|
|
1381
|
+
options: RequestOptions | None = None,
|
|
1382
|
+
**input: Unpack[TiktokFollowingInput],
|
|
1383
|
+
) -> RunResult[TiktokFollowingData]:
|
|
1384
|
+
"""TikTok Following
|
|
1385
|
+
|
|
1386
|
+
List the accounts a TikTok user follows (handle, display name, follower
|
|
1387
|
+
count, bio) by username, normalized across providers.
|
|
1388
|
+
|
|
1389
|
+
Price: $0.002 per request.
|
|
1390
|
+
|
|
1391
|
+
Example:
|
|
1392
|
+
res = client.tiktok.following(handle="stoolpresidente")
|
|
1393
|
+
"""
|
|
1394
|
+
raw = await self._client._arun_raw( # pyright: ignore[reportPrivateUsage]
|
|
1395
|
+
"tiktok.following", dict(input), options
|
|
1396
|
+
)
|
|
1397
|
+
return RunResult[TiktokFollowingData].model_validate(raw)
|
|
1398
|
+
|
|
1399
|
+
async def hashtag_videos(
|
|
1400
|
+
self,
|
|
1401
|
+
*,
|
|
1402
|
+
options: RequestOptions | None = None,
|
|
1403
|
+
**input: Unpack[TiktokHashtagVideosInput],
|
|
1404
|
+
) -> RunResult[TiktokHashtagVideosData]:
|
|
1405
|
+
"""TikTok Hashtag Videos
|
|
1406
|
+
|
|
1407
|
+
List recent TikTok videos for a hashtag (creator, caption, views, likes,
|
|
1408
|
+
shares), normalized output with transparent per-request USD pricing.
|
|
1409
|
+
|
|
1410
|
+
Price: $0.00325 per request.
|
|
1411
|
+
|
|
1412
|
+
Example:
|
|
1413
|
+
res = client.tiktok.hashtag_videos(hashtag="cooking", limit=3)
|
|
1414
|
+
"""
|
|
1415
|
+
raw = await self._client._arun_raw( # pyright: ignore[reportPrivateUsage]
|
|
1416
|
+
"tiktok.hashtag_videos", dict(input), options
|
|
1417
|
+
)
|
|
1418
|
+
return RunResult[TiktokHashtagVideosData].model_validate(raw)
|
|
1419
|
+
|
|
1420
|
+
async def live(
|
|
1421
|
+
self, *, options: RequestOptions | None = None, **input: Unpack[TiktokLiveInput]
|
|
1422
|
+
) -> RunResult[TiktokLiveData]:
|
|
1423
|
+
"""TikTok Live
|
|
1424
|
+
|
|
1425
|
+
Check whether a TikTok creator is live and get the current live room (title,
|
|
1426
|
+
viewers, start time) by handle, normalized across providers.
|
|
1427
|
+
|
|
1428
|
+
Price: $0.002 per request.
|
|
1429
|
+
|
|
1430
|
+
Example:
|
|
1431
|
+
res = client.tiktok.live(handle="thejustalex")
|
|
1432
|
+
"""
|
|
1433
|
+
raw = await self._client._arun_raw( # pyright: ignore[reportPrivateUsage]
|
|
1434
|
+
"tiktok.live", dict(input), options
|
|
1435
|
+
)
|
|
1436
|
+
return RunResult[TiktokLiveData].model_validate(raw)
|
|
1437
|
+
|
|
1438
|
+
async def profile(
|
|
1439
|
+
self,
|
|
1440
|
+
*,
|
|
1441
|
+
options: RequestOptions | None = None,
|
|
1442
|
+
**input: Unpack[TiktokProfileInput],
|
|
1443
|
+
) -> RunResult[TiktokProfileData]:
|
|
1444
|
+
"""TikTok Profile
|
|
1445
|
+
|
|
1446
|
+
Fetch a TikTok creator's public profile (followers, likes, bio,
|
|
1447
|
+
verification) by handle, normalized across providers with transparent
|
|
1448
|
+
failover.
|
|
1449
|
+
|
|
1450
|
+
Price: $0.001 per request.
|
|
1451
|
+
|
|
1452
|
+
Example:
|
|
1453
|
+
res = client.tiktok.profile(handle="zachking")
|
|
1454
|
+
"""
|
|
1455
|
+
raw = await self._client._arun_raw( # pyright: ignore[reportPrivateUsage]
|
|
1456
|
+
"tiktok.profile", dict(input), options
|
|
1457
|
+
)
|
|
1458
|
+
return RunResult[TiktokProfileData].model_validate(raw)
|
|
1459
|
+
|
|
1460
|
+
async def profile_region(
|
|
1461
|
+
self,
|
|
1462
|
+
*,
|
|
1463
|
+
options: RequestOptions | None = None,
|
|
1464
|
+
**input: Unpack[TiktokProfileRegionInput],
|
|
1465
|
+
) -> RunResult[TiktokProfileRegionData]:
|
|
1466
|
+
"""TikTok Profile Region
|
|
1467
|
+
|
|
1468
|
+
Resolve the home region (country) of a TikTok creator by handle, normalized
|
|
1469
|
+
across providers with transparent failover.
|
|
1470
|
+
|
|
1471
|
+
Price: $0.002 per request.
|
|
1472
|
+
|
|
1473
|
+
Example:
|
|
1474
|
+
res = client.tiktok.profile_region(handle="stoolpresidente")
|
|
1475
|
+
"""
|
|
1476
|
+
raw = await self._client._arun_raw( # pyright: ignore[reportPrivateUsage]
|
|
1477
|
+
"tiktok.profile_region", dict(input), options
|
|
1478
|
+
)
|
|
1479
|
+
return RunResult[TiktokProfileRegionData].model_validate(raw)
|
|
1480
|
+
|
|
1481
|
+
async def profile_videos(
|
|
1482
|
+
self,
|
|
1483
|
+
*,
|
|
1484
|
+
options: RequestOptions | None = None,
|
|
1485
|
+
**input: Unpack[TiktokProfileVideosInput],
|
|
1486
|
+
) -> RunResult[TiktokProfileVideosData]:
|
|
1487
|
+
"""TikTok Profile Videos
|
|
1488
|
+
|
|
1489
|
+
List a TikTok creator's recent videos (views, likes, comments) by handle
|
|
1490
|
+
with cursor pagination, normalized across providers.
|
|
1491
|
+
|
|
1492
|
+
Price: $0.001 per request.
|
|
1493
|
+
|
|
1494
|
+
Example:
|
|
1495
|
+
res = client.tiktok.profile_videos(handle="zachking")
|
|
1496
|
+
"""
|
|
1497
|
+
raw = await self._client._arun_raw( # pyright: ignore[reportPrivateUsage]
|
|
1498
|
+
"tiktok.profile_videos", dict(input), options
|
|
1499
|
+
)
|
|
1500
|
+
return RunResult[TiktokProfileVideosData].model_validate(raw)
|
|
1501
|
+
|
|
1502
|
+
def iter_profile_videos(
|
|
1503
|
+
self,
|
|
1504
|
+
*,
|
|
1505
|
+
options: RequestOptions | None = None,
|
|
1506
|
+
**input: Unpack[TiktokProfileVideosInput],
|
|
1507
|
+
) -> AsyncPaginator[TiktokProfileVideosVideo, TiktokProfileVideosData]:
|
|
1508
|
+
"""Iterate TikTok Profile Videos results, following pagination cursors.
|
|
1509
|
+
|
|
1510
|
+
Yields validated `TiktokProfileVideosVideo` items from the `videos` field of
|
|
1511
|
+
each page. Use `.pages()` on the returned paginator to walk whole
|
|
1512
|
+
`RunResult` pages.
|
|
1513
|
+
"""
|
|
1514
|
+
return apaginate(
|
|
1515
|
+
self._client,
|
|
1516
|
+
"tiktok.profile_videos",
|
|
1517
|
+
dict(input),
|
|
1518
|
+
"videos",
|
|
1519
|
+
item_model=TiktokProfileVideosVideo,
|
|
1520
|
+
data_model=TiktokProfileVideosData,
|
|
1521
|
+
bare=False,
|
|
1522
|
+
options=options,
|
|
1523
|
+
)
|
|
1524
|
+
|
|
1525
|
+
async def search_hashtag(
|
|
1526
|
+
self,
|
|
1527
|
+
*,
|
|
1528
|
+
options: RequestOptions | None = None,
|
|
1529
|
+
**input: Unpack[TiktokSearchHashtagInput],
|
|
1530
|
+
) -> RunResult[TiktokSearchHashtagData]:
|
|
1531
|
+
"""TikTok Hashtag Search
|
|
1532
|
+
|
|
1533
|
+
Search TikTok by hashtag and get matching videos (caption, views, likes,
|
|
1534
|
+
comments, shares) as normalized JSON, across providers with transparent
|
|
1535
|
+
failover.
|
|
1536
|
+
|
|
1537
|
+
Price: $0.002 per request.
|
|
1538
|
+
|
|
1539
|
+
Example:
|
|
1540
|
+
res = client.tiktok.search_hashtag(query="recipe")
|
|
1541
|
+
"""
|
|
1542
|
+
raw = await self._client._arun_raw( # pyright: ignore[reportPrivateUsage]
|
|
1543
|
+
"tiktok.search_hashtag", dict(input), options
|
|
1544
|
+
)
|
|
1545
|
+
return RunResult[TiktokSearchHashtagData].model_validate(raw)
|
|
1546
|
+
|
|
1547
|
+
async def search_keyword(
|
|
1548
|
+
self,
|
|
1549
|
+
*,
|
|
1550
|
+
options: RequestOptions | None = None,
|
|
1551
|
+
**input: Unpack[TiktokSearchKeywordInput],
|
|
1552
|
+
) -> RunResult[TiktokSearchKeywordData]:
|
|
1553
|
+
"""TikTok Keyword Search
|
|
1554
|
+
|
|
1555
|
+
Search TikTok by keyword and get matching videos (caption, views, likes,
|
|
1556
|
+
comments, shares) as normalized JSON, across providers with transparent
|
|
1557
|
+
failover.
|
|
1558
|
+
|
|
1559
|
+
Price: $0.001 per request.
|
|
1560
|
+
|
|
1561
|
+
Example:
|
|
1562
|
+
res = client.tiktok.search_keyword(query="cooking")
|
|
1563
|
+
"""
|
|
1564
|
+
raw = await self._client._arun_raw( # pyright: ignore[reportPrivateUsage]
|
|
1565
|
+
"tiktok.search_keyword", dict(input), options
|
|
1566
|
+
)
|
|
1567
|
+
return RunResult[TiktokSearchKeywordData].model_validate(raw)
|
|
1568
|
+
|
|
1569
|
+
async def search_top(
|
|
1570
|
+
self,
|
|
1571
|
+
*,
|
|
1572
|
+
options: RequestOptions | None = None,
|
|
1573
|
+
**input: Unpack[TiktokSearchTopInput],
|
|
1574
|
+
) -> RunResult[TiktokSearchTopData]:
|
|
1575
|
+
"""TikTok Top Search
|
|
1576
|
+
|
|
1577
|
+
Search TikTok's top results for a keyword (caption, views, likes, comments,
|
|
1578
|
+
shares) with cursor pagination, normalized across providers.
|
|
1579
|
+
|
|
1580
|
+
Price: $0.002 per request.
|
|
1581
|
+
|
|
1582
|
+
Example:
|
|
1583
|
+
res = client.tiktok.search_top(query="funny")
|
|
1584
|
+
"""
|
|
1585
|
+
raw = await self._client._arun_raw( # pyright: ignore[reportPrivateUsage]
|
|
1586
|
+
"tiktok.search_top", dict(input), options
|
|
1587
|
+
)
|
|
1588
|
+
return RunResult[TiktokSearchTopData].model_validate(raw)
|
|
1589
|
+
|
|
1590
|
+
def iter_search_top(
|
|
1591
|
+
self,
|
|
1592
|
+
*,
|
|
1593
|
+
options: RequestOptions | None = None,
|
|
1594
|
+
**input: Unpack[TiktokSearchTopInput],
|
|
1595
|
+
) -> AsyncPaginator[TiktokSearchTopItem, TiktokSearchTopData]:
|
|
1596
|
+
"""Iterate TikTok Top Search results, following pagination cursors.
|
|
1597
|
+
|
|
1598
|
+
Yields validated `TiktokSearchTopItem` items from the `items` field of
|
|
1599
|
+
each page. Use `.pages()` on the returned paginator to walk whole
|
|
1600
|
+
`RunResult` pages.
|
|
1601
|
+
"""
|
|
1602
|
+
return apaginate(
|
|
1603
|
+
self._client,
|
|
1604
|
+
"tiktok.search_top",
|
|
1605
|
+
dict(input),
|
|
1606
|
+
"items",
|
|
1607
|
+
item_model=TiktokSearchTopItem,
|
|
1608
|
+
data_model=TiktokSearchTopData,
|
|
1609
|
+
bare=False,
|
|
1610
|
+
options=options,
|
|
1611
|
+
)
|
|
1612
|
+
|
|
1613
|
+
async def search_users(
|
|
1614
|
+
self,
|
|
1615
|
+
*,
|
|
1616
|
+
options: RequestOptions | None = None,
|
|
1617
|
+
**input: Unpack[TiktokSearchUsersInput],
|
|
1618
|
+
) -> RunResult[TiktokSearchUsersData]:
|
|
1619
|
+
"""TikTok User Search
|
|
1620
|
+
|
|
1621
|
+
Search TikTok accounts by keyword (handle, nickname, follower count) with
|
|
1622
|
+
cursor pagination, normalized across providers.
|
|
1623
|
+
|
|
1624
|
+
Price: $0.001 per request.
|
|
1625
|
+
|
|
1626
|
+
Example:
|
|
1627
|
+
res = client.tiktok.search_users(query="chef")
|
|
1628
|
+
"""
|
|
1629
|
+
raw = await self._client._arun_raw( # pyright: ignore[reportPrivateUsage]
|
|
1630
|
+
"tiktok.search_users", dict(input), options
|
|
1631
|
+
)
|
|
1632
|
+
return RunResult[TiktokSearchUsersData].model_validate(raw)
|
|
1633
|
+
|
|
1634
|
+
def iter_search_users(
|
|
1635
|
+
self,
|
|
1636
|
+
*,
|
|
1637
|
+
options: RequestOptions | None = None,
|
|
1638
|
+
**input: Unpack[TiktokSearchUsersInput],
|
|
1639
|
+
) -> AsyncPaginator[TiktokSearchUsersUser, TiktokSearchUsersData]:
|
|
1640
|
+
"""Iterate TikTok User Search results, following pagination cursors.
|
|
1641
|
+
|
|
1642
|
+
Yields validated `TiktokSearchUsersUser` items from the `users` field of
|
|
1643
|
+
each page. Use `.pages()` on the returned paginator to walk whole
|
|
1644
|
+
`RunResult` pages.
|
|
1645
|
+
"""
|
|
1646
|
+
return apaginate(
|
|
1647
|
+
self._client,
|
|
1648
|
+
"tiktok.search_users",
|
|
1649
|
+
dict(input),
|
|
1650
|
+
"users",
|
|
1651
|
+
item_model=TiktokSearchUsersUser,
|
|
1652
|
+
data_model=TiktokSearchUsersData,
|
|
1653
|
+
bare=False,
|
|
1654
|
+
options=options,
|
|
1655
|
+
)
|
|
1656
|
+
|
|
1657
|
+
async def song(
|
|
1658
|
+
self, *, options: RequestOptions | None = None, **input: Unpack[TiktokSongInput]
|
|
1659
|
+
) -> RunResult[TiktokSongData]:
|
|
1660
|
+
"""TikTok Song
|
|
1661
|
+
|
|
1662
|
+
Fetch details for a TikTok song or sound - title, author, duration, cover
|
|
1663
|
+
art, and how many videos use it - normalized across providers with
|
|
1664
|
+
transparent failover.
|
|
1665
|
+
|
|
1666
|
+
Price: $0.002 per request.
|
|
1667
|
+
|
|
1668
|
+
Example:
|
|
1669
|
+
res = client.tiktok.song(clipId="7439295283975702544")
|
|
1670
|
+
"""
|
|
1671
|
+
raw = await self._client._arun_raw( # pyright: ignore[reportPrivateUsage]
|
|
1672
|
+
"tiktok.song", dict(input), options
|
|
1673
|
+
)
|
|
1674
|
+
return RunResult[TiktokSongData].model_validate(raw)
|
|
1675
|
+
|
|
1676
|
+
async def song_videos(
|
|
1677
|
+
self,
|
|
1678
|
+
*,
|
|
1679
|
+
options: RequestOptions | None = None,
|
|
1680
|
+
**input: Unpack[TiktokSongVideosInput],
|
|
1681
|
+
) -> RunResult[TiktokSongVideosData]:
|
|
1682
|
+
"""TikTok Song Videos
|
|
1683
|
+
|
|
1684
|
+
List TikTok videos that use a given song or sound - with descriptions,
|
|
1685
|
+
authors, and engagement stats - normalized across providers with transparent
|
|
1686
|
+
failover.
|
|
1687
|
+
|
|
1688
|
+
Price: $0.002 per request.
|
|
1689
|
+
|
|
1690
|
+
Example:
|
|
1691
|
+
res = client.tiktok.song_videos(clipId="7439295283975702544")
|
|
1692
|
+
"""
|
|
1693
|
+
raw = await self._client._arun_raw( # pyright: ignore[reportPrivateUsage]
|
|
1694
|
+
"tiktok.song_videos", dict(input), options
|
|
1695
|
+
)
|
|
1696
|
+
return RunResult[TiktokSongVideosData].model_validate(raw)
|
|
1697
|
+
|
|
1698
|
+
def iter_song_videos(
|
|
1699
|
+
self,
|
|
1700
|
+
*,
|
|
1701
|
+
options: RequestOptions | None = None,
|
|
1702
|
+
**input: Unpack[TiktokSongVideosInput],
|
|
1703
|
+
) -> AsyncPaginator[TiktokSongVideosVideo, TiktokSongVideosData]:
|
|
1704
|
+
"""Iterate TikTok Song Videos results, following pagination cursors.
|
|
1705
|
+
|
|
1706
|
+
Yields validated `TiktokSongVideosVideo` items from the `videos` field of
|
|
1707
|
+
each page. Use `.pages()` on the returned paginator to walk whole
|
|
1708
|
+
`RunResult` pages.
|
|
1709
|
+
"""
|
|
1710
|
+
return apaginate(
|
|
1711
|
+
self._client,
|
|
1712
|
+
"tiktok.song_videos",
|
|
1713
|
+
dict(input),
|
|
1714
|
+
"videos",
|
|
1715
|
+
item_model=TiktokSongVideosVideo,
|
|
1716
|
+
data_model=TiktokSongVideosData,
|
|
1717
|
+
bare=False,
|
|
1718
|
+
options=options,
|
|
1719
|
+
)
|
|
1720
|
+
|
|
1721
|
+
async def trending_feed(
|
|
1722
|
+
self,
|
|
1723
|
+
*,
|
|
1724
|
+
options: RequestOptions | None = None,
|
|
1725
|
+
**input: Unpack[TiktokTrendingFeedInput],
|
|
1726
|
+
) -> RunResult[TiktokTrendingFeedData]:
|
|
1727
|
+
"""TikTok Trending Feed
|
|
1728
|
+
|
|
1729
|
+
Get TikTok's trending feed for a region (caption, views, likes, comments,
|
|
1730
|
+
author) as normalized JSON, across providers with transparent failover.
|
|
1731
|
+
|
|
1732
|
+
Price: $0.002 per request.
|
|
1733
|
+
|
|
1734
|
+
Example:
|
|
1735
|
+
res = client.tiktok.trending_feed(region="US")
|
|
1736
|
+
"""
|
|
1737
|
+
raw = await self._client._arun_raw( # pyright: ignore[reportPrivateUsage]
|
|
1738
|
+
"tiktok.trending_feed", dict(input), options
|
|
1739
|
+
)
|
|
1740
|
+
return RunResult[TiktokTrendingFeedData].model_validate(raw)
|
|
1741
|
+
|
|
1742
|
+
async def video(
|
|
1743
|
+
self,
|
|
1744
|
+
*,
|
|
1745
|
+
options: RequestOptions | None = None,
|
|
1746
|
+
**input: Unpack[TiktokVideoInput],
|
|
1747
|
+
) -> RunResult[TiktokVideoData]:
|
|
1748
|
+
"""TikTok Video
|
|
1749
|
+
|
|
1750
|
+
Fetch a single TikTok video by URL with its caption and engagement counts
|
|
1751
|
+
(views, likes, comments, shares, saves), normalized across providers with
|
|
1752
|
+
transparent failover.
|
|
1753
|
+
|
|
1754
|
+
Price: $0.001 per request.
|
|
1755
|
+
|
|
1756
|
+
Example:
|
|
1757
|
+
res = client.tiktok.video(url="https://www.tiktok.com/@mrbeast/video/7654638524729216287?_r=1&u_code=elgjf3ff8cajhk&preview_pb=0&sharer_language=en&_d=elh6737j6kjl71&share_item_id=7654638524729216287&source=h5_m")
|
|
1758
|
+
"""
|
|
1759
|
+
raw = await self._client._arun_raw( # pyright: ignore[reportPrivateUsage]
|
|
1760
|
+
"tiktok.video", dict(input), options
|
|
1761
|
+
)
|
|
1762
|
+
return RunResult[TiktokVideoData].model_validate(raw)
|
|
1763
|
+
|
|
1764
|
+
async def video_comments(
|
|
1765
|
+
self,
|
|
1766
|
+
*,
|
|
1767
|
+
options: RequestOptions | None = None,
|
|
1768
|
+
**input: Unpack[TiktokVideoCommentsInput],
|
|
1769
|
+
) -> RunResult[TiktokVideoCommentsData]:
|
|
1770
|
+
"""TikTok Video Comments
|
|
1771
|
+
|
|
1772
|
+
List the comments on a TikTok video by URL with cursor pagination (text,
|
|
1773
|
+
author, likes, reply count), normalized across providers.
|
|
1774
|
+
|
|
1775
|
+
Price: $0.002 per request.
|
|
1776
|
+
|
|
1777
|
+
Example:
|
|
1778
|
+
res = client.tiktok.video_comments(url="https://www.tiktok.com/@zachking/video/7650468599424945422?_r=1&u_code=f0hj7d780760m9&preview_pb=0&sharer_language=en&_d=f0hj7blh067h71&share_item_id=7650468599424945422&source=h5_m")
|
|
1779
|
+
"""
|
|
1780
|
+
raw = await self._client._arun_raw( # pyright: ignore[reportPrivateUsage]
|
|
1781
|
+
"tiktok.video_comments", dict(input), options
|
|
1782
|
+
)
|
|
1783
|
+
return RunResult[TiktokVideoCommentsData].model_validate(raw)
|
|
1784
|
+
|
|
1785
|
+
def iter_video_comments(
|
|
1786
|
+
self,
|
|
1787
|
+
*,
|
|
1788
|
+
options: RequestOptions | None = None,
|
|
1789
|
+
**input: Unpack[TiktokVideoCommentsInput],
|
|
1790
|
+
) -> AsyncPaginator[TiktokVideoCommentsComment, TiktokVideoCommentsData]:
|
|
1791
|
+
"""Iterate TikTok Video Comments results, following pagination cursors.
|
|
1792
|
+
|
|
1793
|
+
Yields validated `TiktokVideoCommentsComment` items from the `comments` field of
|
|
1794
|
+
each page. Use `.pages()` on the returned paginator to walk whole
|
|
1795
|
+
`RunResult` pages.
|
|
1796
|
+
"""
|
|
1797
|
+
return apaginate(
|
|
1798
|
+
self._client,
|
|
1799
|
+
"tiktok.video_comments",
|
|
1800
|
+
dict(input),
|
|
1801
|
+
"comments",
|
|
1802
|
+
item_model=TiktokVideoCommentsComment,
|
|
1803
|
+
data_model=TiktokVideoCommentsData,
|
|
1804
|
+
bare=False,
|
|
1805
|
+
options=options,
|
|
1806
|
+
)
|
|
1807
|
+
|
|
1808
|
+
async def video_transcript(
|
|
1809
|
+
self,
|
|
1810
|
+
*,
|
|
1811
|
+
options: RequestOptions | None = None,
|
|
1812
|
+
**input: Unpack[TiktokVideoTranscriptInput],
|
|
1813
|
+
) -> RunResult[TiktokVideoTranscriptData]:
|
|
1814
|
+
"""TikTok Video Transcript
|
|
1815
|
+
|
|
1816
|
+
Fetch the spoken-word transcript of a TikTok video by URL, normalized across
|
|
1817
|
+
providers with transparent failover.
|
|
1818
|
+
|
|
1819
|
+
Price: $0.002 per request.
|
|
1820
|
+
|
|
1821
|
+
Example:
|
|
1822
|
+
res = client.tiktok.video_transcript(url="https://www.tiktok.com/@washingtonpost/video/7609177768793787679")
|
|
1823
|
+
"""
|
|
1824
|
+
raw = await self._client._arun_raw( # pyright: ignore[reportPrivateUsage]
|
|
1825
|
+
"tiktok.video_transcript", dict(input), options
|
|
1826
|
+
)
|
|
1827
|
+
return RunResult[TiktokVideoTranscriptData].model_validate(raw)
|