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,536 @@
|
|
|
1
|
+
# Generated - do not edit. Regenerate with: pnpm generate
|
|
2
|
+
"""Generated namespace module for the tiktok_shop platform."""
|
|
3
|
+
|
|
4
|
+
from __future__ import annotations
|
|
5
|
+
|
|
6
|
+
from typing import Literal, 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 TiktokShopProductInput(TypedDict, total=False):
|
|
25
|
+
"""Input for TikTok Shop Product."""
|
|
26
|
+
|
|
27
|
+
region: NotRequired[str]
|
|
28
|
+
"""Two-letter country code for the proxy location used to access region-specific products (e.g. US, GB, FR). Defaults to US."""
|
|
29
|
+
url: Required[str]
|
|
30
|
+
"""TikTok Shop product detail page URL (e.g. https://www.tiktok.com/shop/pdp/.../1729587769570529799)."""
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
class TiktokShopProductReviewsInput(TypedDict, total=False):
|
|
34
|
+
"""Input for TikTok Shop Product Reviews."""
|
|
35
|
+
|
|
36
|
+
page: NotRequired[int]
|
|
37
|
+
"""1-based results page. Use with hasMore in the output to paginate. Minimum: 1. Default: 1."""
|
|
38
|
+
region: NotRequired[str]
|
|
39
|
+
"""Two-letter country code of the product's shop region (e.g. US). Strongly recommended for correct results."""
|
|
40
|
+
url: Required[str]
|
|
41
|
+
"""TikTok Shop product URL (e.g. https://www.tiktok.com/shop/pdp/.../1729385633899532161)."""
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
class TiktokShopSearchInput(TypedDict, total=False):
|
|
45
|
+
"""Input for TikTok Shop Search."""
|
|
46
|
+
|
|
47
|
+
country: NotRequired[
|
|
48
|
+
Literal[
|
|
49
|
+
"US",
|
|
50
|
+
"VN",
|
|
51
|
+
"TH",
|
|
52
|
+
"PH",
|
|
53
|
+
"MY",
|
|
54
|
+
"ID",
|
|
55
|
+
"GB",
|
|
56
|
+
"SG",
|
|
57
|
+
"ES",
|
|
58
|
+
"MX",
|
|
59
|
+
"DE",
|
|
60
|
+
"IT",
|
|
61
|
+
"FR",
|
|
62
|
+
"BR",
|
|
63
|
+
"JP",
|
|
64
|
+
]
|
|
65
|
+
]
|
|
66
|
+
"""Country code of the TikTok Shop market to search (e.g. US). Default: US."""
|
|
67
|
+
limit: NotRequired[int]
|
|
68
|
+
"""Maximum number of results to return (1-10, default 10). You are billed per result returned, so a lower limit costs less. Range: 1 to 10."""
|
|
69
|
+
query: Required[str]
|
|
70
|
+
"""Search keyword for TikTok Shop products (e.g. wireless earbuds)."""
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
class TiktokShopShopProductsInput(TypedDict, total=False):
|
|
74
|
+
"""Input for TikTok Shop Store Products."""
|
|
75
|
+
|
|
76
|
+
cursor: NotRequired[str]
|
|
77
|
+
"""Opaque pagination cursor from a previous response's nextCursor."""
|
|
78
|
+
region: NotRequired[str]
|
|
79
|
+
"""Two-letter country code of the store's market (e.g. US)."""
|
|
80
|
+
sortBy: NotRequired[Literal["top", "new_releases"]]
|
|
81
|
+
"""Product ordering within the store. Default: top."""
|
|
82
|
+
url: Required[str]
|
|
83
|
+
"""TikTok Shop store URL (e.g. https://www.tiktok.com/shop/store/...)."""
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
class TiktokShopUserShowcaseInput(TypedDict, total=False):
|
|
87
|
+
"""Input for TikTok Shop User Showcase."""
|
|
88
|
+
|
|
89
|
+
cursor: NotRequired[str]
|
|
90
|
+
"""Pagination token for retrieving subsequent product pages."""
|
|
91
|
+
handle: Required[str]
|
|
92
|
+
"""The handle of the TikTok user (e.g. mrtiktokreviews)."""
|
|
93
|
+
region: NotRequired[str]
|
|
94
|
+
"""Geographical region for proxy placement (defaults to US)."""
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
class TiktokShopProductData(BaseModel):
|
|
98
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
99
|
+
|
|
100
|
+
currency: str
|
|
101
|
+
original_price: str = Field(alias="originalPrice")
|
|
102
|
+
price: str
|
|
103
|
+
product_id: str = Field(alias="productId")
|
|
104
|
+
rating: float
|
|
105
|
+
review_count: int = Field(alias="reviewCount")
|
|
106
|
+
seller_location: str = Field(alias="sellerLocation")
|
|
107
|
+
seller_name: str = Field(alias="sellerName")
|
|
108
|
+
sold_count: int = Field(alias="soldCount")
|
|
109
|
+
title: str
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
class TiktokShopProductReviewsData(BaseModel):
|
|
113
|
+
model_config = ConfigDict(populate_by_name=True)
|
|
114
|
+
|
|
115
|
+
has_more: bool = Field(alias="hasMore")
|
|
116
|
+
rating: float = Field(description="Overall product score (1-5).")
|
|
117
|
+
reviews: list[TiktokShopProductReviewsReview]
|
|
118
|
+
total_reviews: int = Field(alias="totalReviews")
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
class TiktokShopProductReviewsReview(BaseModel):
|
|
122
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
123
|
+
|
|
124
|
+
country: str
|
|
125
|
+
created_at: str = Field(
|
|
126
|
+
alias="createdAt", description="Review time as epoch milliseconds."
|
|
127
|
+
)
|
|
128
|
+
id: str
|
|
129
|
+
rating: float
|
|
130
|
+
reviewer_name: str = Field(alias="reviewerName")
|
|
131
|
+
sku: str = Field(description='Variant bought, e.g. "Color: Black".')
|
|
132
|
+
text: str
|
|
133
|
+
verified_purchase: bool = Field(alias="verifiedPurchase")
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
class TiktokShopSearchData(BaseModel):
|
|
137
|
+
items: list[TiktokShopSearchItem] = Field(
|
|
138
|
+
description="Product records matching the search query: id, title, price, sales count, rating, seller, and product URL."
|
|
139
|
+
)
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
class TiktokShopSearchItem(BaseModel):
|
|
143
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
144
|
+
|
|
145
|
+
currency: str | None = Field(
|
|
146
|
+
default=None, description="ISO currency name, e.g. USD."
|
|
147
|
+
)
|
|
148
|
+
original_price: float | None = Field(
|
|
149
|
+
default=None,
|
|
150
|
+
alias="originalPrice",
|
|
151
|
+
description="Pre-discount list price (0 when not on sale).",
|
|
152
|
+
)
|
|
153
|
+
price: float | None = Field(default=None, description="Current sale price.")
|
|
154
|
+
product_id: str = Field(alias="productId", description="TikTok Shop product id.")
|
|
155
|
+
rating: float | None = Field(default=None, description="Average review score.")
|
|
156
|
+
shop_name: str | None = Field(
|
|
157
|
+
default=None, alias="shopName", description="Seller shop name."
|
|
158
|
+
)
|
|
159
|
+
sold_count: int | None = Field(
|
|
160
|
+
default=None, alias="soldCount", description="Units sold."
|
|
161
|
+
)
|
|
162
|
+
title: str = Field(description="Product title.")
|
|
163
|
+
url: str | None = Field(
|
|
164
|
+
default=None,
|
|
165
|
+
description="Canonical product detail page URL. Present whenever the upstream returns this record.",
|
|
166
|
+
)
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
class TiktokShopShopProductsData(BaseModel):
|
|
170
|
+
model_config = ConfigDict(populate_by_name=True)
|
|
171
|
+
|
|
172
|
+
has_more: bool = Field(alias="hasMore")
|
|
173
|
+
next_cursor: str = Field(alias="nextCursor")
|
|
174
|
+
product_count: int = Field(alias="productCount")
|
|
175
|
+
products: list[TiktokShopShopProductsProduct]
|
|
176
|
+
shop_name: str = Field(alias="shopName")
|
|
177
|
+
shop_rating: float = Field(alias="shopRating")
|
|
178
|
+
sold_count: int = Field(alias="soldCount")
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
class TiktokShopShopProductsProduct(BaseModel):
|
|
182
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
183
|
+
|
|
184
|
+
currency: str
|
|
185
|
+
original_price: float = Field(alias="originalPrice")
|
|
186
|
+
price: float
|
|
187
|
+
product_id: str = Field(alias="productId")
|
|
188
|
+
rating: float
|
|
189
|
+
review_count: int = Field(alias="reviewCount")
|
|
190
|
+
sold_count: int = Field(alias="soldCount")
|
|
191
|
+
title: str
|
|
192
|
+
url: str
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
class TiktokShopUserShowcaseData(BaseModel):
|
|
196
|
+
model_config = ConfigDict(populate_by_name=True)
|
|
197
|
+
|
|
198
|
+
next_cursor: str = Field(alias="nextCursor")
|
|
199
|
+
products: list[TiktokShopUserShowcaseProduct]
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
class TiktokShopUserShowcaseProduct(BaseModel):
|
|
203
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
204
|
+
|
|
205
|
+
currency: str
|
|
206
|
+
image_url: str = Field(alias="imageUrl")
|
|
207
|
+
original_price: str = Field(alias="originalPrice")
|
|
208
|
+
price: str
|
|
209
|
+
product_id: str = Field(alias="productId")
|
|
210
|
+
rating: float
|
|
211
|
+
review_count: int = Field(alias="reviewCount")
|
|
212
|
+
sold_count: int = Field(alias="soldCount")
|
|
213
|
+
title: str
|
|
214
|
+
url: str
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
class TiktokShopNamespace:
|
|
218
|
+
"""Typed methods for this platform. Attached lazily to the client."""
|
|
219
|
+
|
|
220
|
+
def __init__(self, client: "AnyAPI") -> None:
|
|
221
|
+
self._client = client
|
|
222
|
+
|
|
223
|
+
def product(
|
|
224
|
+
self,
|
|
225
|
+
*,
|
|
226
|
+
options: RequestOptions | None = None,
|
|
227
|
+
**input: Unpack[TiktokShopProductInput],
|
|
228
|
+
) -> RunResult[TiktokShopProductData]:
|
|
229
|
+
"""TikTok Shop Product
|
|
230
|
+
|
|
231
|
+
Fetch TikTok Shop product details - title, price, sales, seller, and ratings
|
|
232
|
+
- from a product URL, with transparent per-request USD pricing.
|
|
233
|
+
|
|
234
|
+
Price: $0.002 per request.
|
|
235
|
+
|
|
236
|
+
Example:
|
|
237
|
+
res = client.tiktok_shop.product(url="https://www.tiktok.com/shop/pdp/goli-ashwagandha-gummies-with-vitamin-d-ksm-66-vegan-non-gmo/1729587769570529799")
|
|
238
|
+
"""
|
|
239
|
+
raw = self._client._run_raw( # pyright: ignore[reportPrivateUsage]
|
|
240
|
+
"tiktok_shop.product", dict(input), options
|
|
241
|
+
)
|
|
242
|
+
return RunResult[TiktokShopProductData].model_validate(raw)
|
|
243
|
+
|
|
244
|
+
def product_reviews(
|
|
245
|
+
self,
|
|
246
|
+
*,
|
|
247
|
+
options: RequestOptions | None = None,
|
|
248
|
+
**input: Unpack[TiktokShopProductReviewsInput],
|
|
249
|
+
) -> RunResult[TiktokShopProductReviewsData]:
|
|
250
|
+
"""TikTok Shop Product Reviews
|
|
251
|
+
|
|
252
|
+
Fetch customer reviews for a TikTok Shop product by URL - rating, text,
|
|
253
|
+
reviewer, country, and verified-purchase flag - normalized across providers
|
|
254
|
+
with transparent failover.
|
|
255
|
+
|
|
256
|
+
Price: $0.002 per request.
|
|
257
|
+
|
|
258
|
+
Example:
|
|
259
|
+
res = client.tiktok_shop.product_reviews(url="https://www.tiktok.com/shop/pdp/cat-nail-clipper-by-potaroma-adjustable-sizes-built-in-file-safe-for-kittens-cats/1731578642912612516")
|
|
260
|
+
"""
|
|
261
|
+
raw = self._client._run_raw( # pyright: ignore[reportPrivateUsage]
|
|
262
|
+
"tiktok_shop.product_reviews", dict(input), options
|
|
263
|
+
)
|
|
264
|
+
return RunResult[TiktokShopProductReviewsData].model_validate(raw)
|
|
265
|
+
|
|
266
|
+
def search(
|
|
267
|
+
self,
|
|
268
|
+
*,
|
|
269
|
+
options: RequestOptions | None = None,
|
|
270
|
+
**input: Unpack[TiktokShopSearchInput],
|
|
271
|
+
) -> RunResult[TiktokShopSearchData]:
|
|
272
|
+
"""TikTok Shop Search
|
|
273
|
+
|
|
274
|
+
Search TikTok Shop products by keyword across 15 countries: price, sales,
|
|
275
|
+
rating, and seller info per product, in one normalized response.
|
|
276
|
+
|
|
277
|
+
Price: $0.002 per request.
|
|
278
|
+
|
|
279
|
+
Example:
|
|
280
|
+
res = client.tiktok_shop.search(limit=3, query="phone case")
|
|
281
|
+
"""
|
|
282
|
+
raw = self._client._run_raw( # pyright: ignore[reportPrivateUsage]
|
|
283
|
+
"tiktok_shop.search", dict(input), options
|
|
284
|
+
)
|
|
285
|
+
return RunResult[TiktokShopSearchData].model_validate(raw)
|
|
286
|
+
|
|
287
|
+
def shop_products(
|
|
288
|
+
self,
|
|
289
|
+
*,
|
|
290
|
+
options: RequestOptions | None = None,
|
|
291
|
+
**input: Unpack[TiktokShopShopProductsInput],
|
|
292
|
+
) -> RunResult[TiktokShopShopProductsData]:
|
|
293
|
+
"""TikTok Shop Store Products
|
|
294
|
+
|
|
295
|
+
List every product of a TikTok Shop store by URL - title, price, sales, and
|
|
296
|
+
rating per product plus shop-level stats - with cursor pagination and
|
|
297
|
+
transparent failover.
|
|
298
|
+
|
|
299
|
+
Price: $0.002 per request.
|
|
300
|
+
|
|
301
|
+
Example:
|
|
302
|
+
res = client.tiktok_shop.shop_products(url="https://www.tiktok.com/shop/store/goli-nutrition/7495794203056835079")
|
|
303
|
+
"""
|
|
304
|
+
raw = self._client._run_raw( # pyright: ignore[reportPrivateUsage]
|
|
305
|
+
"tiktok_shop.shop_products", dict(input), options
|
|
306
|
+
)
|
|
307
|
+
return RunResult[TiktokShopShopProductsData].model_validate(raw)
|
|
308
|
+
|
|
309
|
+
def iter_shop_products(
|
|
310
|
+
self,
|
|
311
|
+
*,
|
|
312
|
+
options: RequestOptions | None = None,
|
|
313
|
+
**input: Unpack[TiktokShopShopProductsInput],
|
|
314
|
+
) -> Paginator[TiktokShopShopProductsProduct, TiktokShopShopProductsData]:
|
|
315
|
+
"""Iterate TikTok Shop Store Products results, following pagination cursors.
|
|
316
|
+
|
|
317
|
+
Yields validated `TiktokShopShopProductsProduct` items from the `products` field of
|
|
318
|
+
each page. Use `.pages()` on the returned paginator to walk whole
|
|
319
|
+
`RunResult` pages.
|
|
320
|
+
"""
|
|
321
|
+
return paginate(
|
|
322
|
+
self._client,
|
|
323
|
+
"tiktok_shop.shop_products",
|
|
324
|
+
dict(input),
|
|
325
|
+
"products",
|
|
326
|
+
item_model=TiktokShopShopProductsProduct,
|
|
327
|
+
data_model=TiktokShopShopProductsData,
|
|
328
|
+
bare=False,
|
|
329
|
+
options=options,
|
|
330
|
+
)
|
|
331
|
+
|
|
332
|
+
def user_showcase(
|
|
333
|
+
self,
|
|
334
|
+
*,
|
|
335
|
+
options: RequestOptions | None = None,
|
|
336
|
+
**input: Unpack[TiktokShopUserShowcaseInput],
|
|
337
|
+
) -> RunResult[TiktokShopUserShowcaseData]:
|
|
338
|
+
"""TikTok Shop User Showcase
|
|
339
|
+
|
|
340
|
+
List the TikTok Shop products a creator showcases - title, price, rating,
|
|
341
|
+
and sales per product - normalized across providers with transparent
|
|
342
|
+
failover.
|
|
343
|
+
|
|
344
|
+
Price: $0.002 per request.
|
|
345
|
+
|
|
346
|
+
Example:
|
|
347
|
+
res = client.tiktok_shop.user_showcase(handle="mrtiktokreviews")
|
|
348
|
+
"""
|
|
349
|
+
raw = self._client._run_raw( # pyright: ignore[reportPrivateUsage]
|
|
350
|
+
"tiktok_shop.user_showcase", dict(input), options
|
|
351
|
+
)
|
|
352
|
+
return RunResult[TiktokShopUserShowcaseData].model_validate(raw)
|
|
353
|
+
|
|
354
|
+
def iter_user_showcase(
|
|
355
|
+
self,
|
|
356
|
+
*,
|
|
357
|
+
options: RequestOptions | None = None,
|
|
358
|
+
**input: Unpack[TiktokShopUserShowcaseInput],
|
|
359
|
+
) -> Paginator[TiktokShopUserShowcaseProduct, TiktokShopUserShowcaseData]:
|
|
360
|
+
"""Iterate TikTok Shop User Showcase results, following pagination cursors.
|
|
361
|
+
|
|
362
|
+
Yields validated `TiktokShopUserShowcaseProduct` items from the `products` field of
|
|
363
|
+
each page. Use `.pages()` on the returned paginator to walk whole
|
|
364
|
+
`RunResult` pages.
|
|
365
|
+
"""
|
|
366
|
+
return paginate(
|
|
367
|
+
self._client,
|
|
368
|
+
"tiktok_shop.user_showcase",
|
|
369
|
+
dict(input),
|
|
370
|
+
"products",
|
|
371
|
+
item_model=TiktokShopUserShowcaseProduct,
|
|
372
|
+
data_model=TiktokShopUserShowcaseData,
|
|
373
|
+
bare=False,
|
|
374
|
+
options=options,
|
|
375
|
+
)
|
|
376
|
+
|
|
377
|
+
|
|
378
|
+
class AsyncTiktokShopNamespace:
|
|
379
|
+
"""Typed methods for this platform. Attached lazily to the client."""
|
|
380
|
+
|
|
381
|
+
def __init__(self, client: "AsyncAnyAPI") -> None:
|
|
382
|
+
self._client = client
|
|
383
|
+
|
|
384
|
+
async def product(
|
|
385
|
+
self,
|
|
386
|
+
*,
|
|
387
|
+
options: RequestOptions | None = None,
|
|
388
|
+
**input: Unpack[TiktokShopProductInput],
|
|
389
|
+
) -> RunResult[TiktokShopProductData]:
|
|
390
|
+
"""TikTok Shop Product
|
|
391
|
+
|
|
392
|
+
Fetch TikTok Shop product details - title, price, sales, seller, and ratings
|
|
393
|
+
- from a product URL, with transparent per-request USD pricing.
|
|
394
|
+
|
|
395
|
+
Price: $0.002 per request.
|
|
396
|
+
|
|
397
|
+
Example:
|
|
398
|
+
res = client.tiktok_shop.product(url="https://www.tiktok.com/shop/pdp/goli-ashwagandha-gummies-with-vitamin-d-ksm-66-vegan-non-gmo/1729587769570529799")
|
|
399
|
+
"""
|
|
400
|
+
raw = await self._client._arun_raw( # pyright: ignore[reportPrivateUsage]
|
|
401
|
+
"tiktok_shop.product", dict(input), options
|
|
402
|
+
)
|
|
403
|
+
return RunResult[TiktokShopProductData].model_validate(raw)
|
|
404
|
+
|
|
405
|
+
async def product_reviews(
|
|
406
|
+
self,
|
|
407
|
+
*,
|
|
408
|
+
options: RequestOptions | None = None,
|
|
409
|
+
**input: Unpack[TiktokShopProductReviewsInput],
|
|
410
|
+
) -> RunResult[TiktokShopProductReviewsData]:
|
|
411
|
+
"""TikTok Shop Product Reviews
|
|
412
|
+
|
|
413
|
+
Fetch customer reviews for a TikTok Shop product by URL - rating, text,
|
|
414
|
+
reviewer, country, and verified-purchase flag - normalized across providers
|
|
415
|
+
with transparent failover.
|
|
416
|
+
|
|
417
|
+
Price: $0.002 per request.
|
|
418
|
+
|
|
419
|
+
Example:
|
|
420
|
+
res = client.tiktok_shop.product_reviews(url="https://www.tiktok.com/shop/pdp/cat-nail-clipper-by-potaroma-adjustable-sizes-built-in-file-safe-for-kittens-cats/1731578642912612516")
|
|
421
|
+
"""
|
|
422
|
+
raw = await self._client._arun_raw( # pyright: ignore[reportPrivateUsage]
|
|
423
|
+
"tiktok_shop.product_reviews", dict(input), options
|
|
424
|
+
)
|
|
425
|
+
return RunResult[TiktokShopProductReviewsData].model_validate(raw)
|
|
426
|
+
|
|
427
|
+
async def search(
|
|
428
|
+
self,
|
|
429
|
+
*,
|
|
430
|
+
options: RequestOptions | None = None,
|
|
431
|
+
**input: Unpack[TiktokShopSearchInput],
|
|
432
|
+
) -> RunResult[TiktokShopSearchData]:
|
|
433
|
+
"""TikTok Shop Search
|
|
434
|
+
|
|
435
|
+
Search TikTok Shop products by keyword across 15 countries: price, sales,
|
|
436
|
+
rating, and seller info per product, in one normalized response.
|
|
437
|
+
|
|
438
|
+
Price: $0.002 per request.
|
|
439
|
+
|
|
440
|
+
Example:
|
|
441
|
+
res = client.tiktok_shop.search(limit=3, query="phone case")
|
|
442
|
+
"""
|
|
443
|
+
raw = await self._client._arun_raw( # pyright: ignore[reportPrivateUsage]
|
|
444
|
+
"tiktok_shop.search", dict(input), options
|
|
445
|
+
)
|
|
446
|
+
return RunResult[TiktokShopSearchData].model_validate(raw)
|
|
447
|
+
|
|
448
|
+
async def shop_products(
|
|
449
|
+
self,
|
|
450
|
+
*,
|
|
451
|
+
options: RequestOptions | None = None,
|
|
452
|
+
**input: Unpack[TiktokShopShopProductsInput],
|
|
453
|
+
) -> RunResult[TiktokShopShopProductsData]:
|
|
454
|
+
"""TikTok Shop Store Products
|
|
455
|
+
|
|
456
|
+
List every product of a TikTok Shop store by URL - title, price, sales, and
|
|
457
|
+
rating per product plus shop-level stats - with cursor pagination and
|
|
458
|
+
transparent failover.
|
|
459
|
+
|
|
460
|
+
Price: $0.002 per request.
|
|
461
|
+
|
|
462
|
+
Example:
|
|
463
|
+
res = client.tiktok_shop.shop_products(url="https://www.tiktok.com/shop/store/goli-nutrition/7495794203056835079")
|
|
464
|
+
"""
|
|
465
|
+
raw = await self._client._arun_raw( # pyright: ignore[reportPrivateUsage]
|
|
466
|
+
"tiktok_shop.shop_products", dict(input), options
|
|
467
|
+
)
|
|
468
|
+
return RunResult[TiktokShopShopProductsData].model_validate(raw)
|
|
469
|
+
|
|
470
|
+
def iter_shop_products(
|
|
471
|
+
self,
|
|
472
|
+
*,
|
|
473
|
+
options: RequestOptions | None = None,
|
|
474
|
+
**input: Unpack[TiktokShopShopProductsInput],
|
|
475
|
+
) -> AsyncPaginator[TiktokShopShopProductsProduct, TiktokShopShopProductsData]:
|
|
476
|
+
"""Iterate TikTok Shop Store Products results, following pagination cursors.
|
|
477
|
+
|
|
478
|
+
Yields validated `TiktokShopShopProductsProduct` items from the `products` field of
|
|
479
|
+
each page. Use `.pages()` on the returned paginator to walk whole
|
|
480
|
+
`RunResult` pages.
|
|
481
|
+
"""
|
|
482
|
+
return apaginate(
|
|
483
|
+
self._client,
|
|
484
|
+
"tiktok_shop.shop_products",
|
|
485
|
+
dict(input),
|
|
486
|
+
"products",
|
|
487
|
+
item_model=TiktokShopShopProductsProduct,
|
|
488
|
+
data_model=TiktokShopShopProductsData,
|
|
489
|
+
bare=False,
|
|
490
|
+
options=options,
|
|
491
|
+
)
|
|
492
|
+
|
|
493
|
+
async def user_showcase(
|
|
494
|
+
self,
|
|
495
|
+
*,
|
|
496
|
+
options: RequestOptions | None = None,
|
|
497
|
+
**input: Unpack[TiktokShopUserShowcaseInput],
|
|
498
|
+
) -> RunResult[TiktokShopUserShowcaseData]:
|
|
499
|
+
"""TikTok Shop User Showcase
|
|
500
|
+
|
|
501
|
+
List the TikTok Shop products a creator showcases - title, price, rating,
|
|
502
|
+
and sales per product - normalized across providers with transparent
|
|
503
|
+
failover.
|
|
504
|
+
|
|
505
|
+
Price: $0.002 per request.
|
|
506
|
+
|
|
507
|
+
Example:
|
|
508
|
+
res = client.tiktok_shop.user_showcase(handle="mrtiktokreviews")
|
|
509
|
+
"""
|
|
510
|
+
raw = await self._client._arun_raw( # pyright: ignore[reportPrivateUsage]
|
|
511
|
+
"tiktok_shop.user_showcase", dict(input), options
|
|
512
|
+
)
|
|
513
|
+
return RunResult[TiktokShopUserShowcaseData].model_validate(raw)
|
|
514
|
+
|
|
515
|
+
def iter_user_showcase(
|
|
516
|
+
self,
|
|
517
|
+
*,
|
|
518
|
+
options: RequestOptions | None = None,
|
|
519
|
+
**input: Unpack[TiktokShopUserShowcaseInput],
|
|
520
|
+
) -> AsyncPaginator[TiktokShopUserShowcaseProduct, TiktokShopUserShowcaseData]:
|
|
521
|
+
"""Iterate TikTok Shop User Showcase results, following pagination cursors.
|
|
522
|
+
|
|
523
|
+
Yields validated `TiktokShopUserShowcaseProduct` items from the `products` field of
|
|
524
|
+
each page. Use `.pages()` on the returned paginator to walk whole
|
|
525
|
+
`RunResult` pages.
|
|
526
|
+
"""
|
|
527
|
+
return apaginate(
|
|
528
|
+
self._client,
|
|
529
|
+
"tiktok_shop.user_showcase",
|
|
530
|
+
dict(input),
|
|
531
|
+
"products",
|
|
532
|
+
item_model=TiktokShopUserShowcaseProduct,
|
|
533
|
+
data_model=TiktokShopUserShowcaseData,
|
|
534
|
+
bare=False,
|
|
535
|
+
options=options,
|
|
536
|
+
)
|