scrapebadger 0.12.0 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/index.d.cts +1681 -34
- package/dist/index.d.ts +1681 -34
- package/dist/index.js +645 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +632 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -257,6 +257,11 @@ interface VintedItemSummary {
|
|
|
257
257
|
photo: VintedPhoto;
|
|
258
258
|
/** All photos */
|
|
259
259
|
photos: VintedPhoto[];
|
|
260
|
+
/**
|
|
261
|
+
* Physical country of the seller as an upper-case ISO-2 code (e.g. "FR"),
|
|
262
|
+
* or null. Populated only when the `seller_country` search filter is used.
|
|
263
|
+
*/
|
|
264
|
+
seller_country_code: string | null;
|
|
260
265
|
}
|
|
261
266
|
/**
|
|
262
267
|
* Full item detail with all metadata.
|
|
@@ -413,6 +418,11 @@ interface SearchResponse$1 {
|
|
|
413
418
|
pagination: VintedPagination;
|
|
414
419
|
/** Market code used for this search */
|
|
415
420
|
market: string;
|
|
421
|
+
/**
|
|
422
|
+
* Echo of the normalized `seller_country` filter applied to this search
|
|
423
|
+
* (comma-separated ISO-2 codes, e.g. "fr,be"), or null when no filter was used.
|
|
424
|
+
*/
|
|
425
|
+
seller_country: string | null;
|
|
416
426
|
}
|
|
417
427
|
/**
|
|
418
428
|
* Response from the item detail endpoint.
|
|
@@ -469,7 +479,7 @@ interface StatusesResponse {
|
|
|
469
479
|
/**
|
|
470
480
|
* Response from the markets endpoint.
|
|
471
481
|
*/
|
|
472
|
-
interface MarketsResponse$
|
|
482
|
+
interface MarketsResponse$2 {
|
|
473
483
|
/** List of available markets */
|
|
474
484
|
markets: VintedMarket[];
|
|
475
485
|
}
|
|
@@ -497,6 +507,18 @@ interface VintedSearchParams {
|
|
|
497
507
|
status_ids?: string;
|
|
498
508
|
/** Sort order */
|
|
499
509
|
order?: "relevance" | "newest_first" | "price_low_to_high" | "price_high_to_low";
|
|
510
|
+
/**
|
|
511
|
+
* Filter results to items whose seller is physically located in one of the
|
|
512
|
+
* given countries. A comma-separated list of ISO-2 country codes (e.g. "fr"
|
|
513
|
+
* or "fr,be"). Vinted federates cross-border EU listings into each market
|
|
514
|
+
* domain and has no native country filter, so this is applied by ScrapeBadger.
|
|
515
|
+
*
|
|
516
|
+
* When set, each returned item gains a `seller_country_code` and the response
|
|
517
|
+
* gains a top-level `seller_country` echo.
|
|
518
|
+
*
|
|
519
|
+
* Billing: 1 base credit + 1 credit per uncached seller looked up.
|
|
520
|
+
*/
|
|
521
|
+
seller_country?: string;
|
|
500
522
|
}
|
|
501
523
|
|
|
502
524
|
/**
|
|
@@ -528,7 +550,7 @@ interface VintedSearchParams {
|
|
|
528
550
|
* });
|
|
529
551
|
* ```
|
|
530
552
|
*/
|
|
531
|
-
declare class SearchClient$
|
|
553
|
+
declare class SearchClient$5 {
|
|
532
554
|
private readonly client;
|
|
533
555
|
constructor(client: BaseClient);
|
|
534
556
|
/**
|
|
@@ -550,6 +572,19 @@ declare class SearchClient$3 {
|
|
|
550
572
|
* });
|
|
551
573
|
* console.log(`Found ${results.pagination.total_entries} items`);
|
|
552
574
|
* ```
|
|
575
|
+
*
|
|
576
|
+
* @example
|
|
577
|
+
* ```typescript
|
|
578
|
+
* // Filter results to sellers physically located in France or Belgium.
|
|
579
|
+
* // Billing: 1 base credit + 1 credit per uncached seller looked up.
|
|
580
|
+
* const local = await client.vinted.search.search({
|
|
581
|
+
* query: "vintage jacket",
|
|
582
|
+
* seller_country: "fr,be",
|
|
583
|
+
* });
|
|
584
|
+
* for (const item of local.items) {
|
|
585
|
+
* console.log(`${item.title} — seller in ${item.seller_country_code}`);
|
|
586
|
+
* }
|
|
587
|
+
* ```
|
|
553
588
|
*/
|
|
554
589
|
search(params: VintedSearchParams): Promise<SearchResponse$1>;
|
|
555
590
|
}
|
|
@@ -623,7 +658,7 @@ declare class ItemsClient {
|
|
|
623
658
|
* }
|
|
624
659
|
* ```
|
|
625
660
|
*/
|
|
626
|
-
declare class UsersClient$
|
|
661
|
+
declare class UsersClient$2 {
|
|
627
662
|
private readonly client;
|
|
628
663
|
constructor(client: BaseClient);
|
|
629
664
|
/**
|
|
@@ -706,7 +741,7 @@ declare class UsersClient$1 {
|
|
|
706
741
|
* }
|
|
707
742
|
* ```
|
|
708
743
|
*/
|
|
709
|
-
declare class ReferenceClient$
|
|
744
|
+
declare class ReferenceClient$3 {
|
|
710
745
|
private readonly client;
|
|
711
746
|
constructor(client: BaseClient);
|
|
712
747
|
/**
|
|
@@ -784,7 +819,7 @@ declare class ReferenceClient$1 {
|
|
|
784
819
|
* }
|
|
785
820
|
* ```
|
|
786
821
|
*/
|
|
787
|
-
markets(): Promise<MarketsResponse$
|
|
822
|
+
markets(): Promise<MarketsResponse$2>;
|
|
788
823
|
}
|
|
789
824
|
|
|
790
825
|
/**
|
|
@@ -821,13 +856,13 @@ declare class ReferenceClient$1 {
|
|
|
821
856
|
*/
|
|
822
857
|
declare class VintedClient {
|
|
823
858
|
/** Client for item search operations */
|
|
824
|
-
readonly search: SearchClient$
|
|
859
|
+
readonly search: SearchClient$5;
|
|
825
860
|
/** Client for individual item operations */
|
|
826
861
|
readonly items: ItemsClient;
|
|
827
862
|
/** Client for user operations */
|
|
828
|
-
readonly users: UsersClient$
|
|
863
|
+
readonly users: UsersClient$2;
|
|
829
864
|
/** Client for reference data (brands, colors, statuses, markets) */
|
|
830
|
-
readonly reference: ReferenceClient$
|
|
865
|
+
readonly reference: ReferenceClient$3;
|
|
831
866
|
/**
|
|
832
867
|
* Create a new Vinted client.
|
|
833
868
|
*
|
|
@@ -1735,7 +1770,7 @@ declare class PatentsClient {
|
|
|
1735
1770
|
/**
|
|
1736
1771
|
* Client for Google's immersive product detail endpoint.
|
|
1737
1772
|
*/
|
|
1738
|
-
declare class ProductsClient$
|
|
1773
|
+
declare class ProductsClient$2 {
|
|
1739
1774
|
private readonly client;
|
|
1740
1775
|
constructor(client: BaseClient);
|
|
1741
1776
|
detail(params: ProductsDetailParams): Promise<GoogleResponse>;
|
|
@@ -1813,7 +1848,7 @@ declare class ScholarClient {
|
|
|
1813
1848
|
* }
|
|
1814
1849
|
* ```
|
|
1815
1850
|
*/
|
|
1816
|
-
declare class SearchClient$
|
|
1851
|
+
declare class SearchClient$4 {
|
|
1817
1852
|
private readonly client;
|
|
1818
1853
|
constructor(client: BaseClient);
|
|
1819
1854
|
/**
|
|
@@ -1966,7 +2001,7 @@ declare class TrendsClient {
|
|
|
1966
2001
|
* }
|
|
1967
2002
|
* ```
|
|
1968
2003
|
*/
|
|
1969
|
-
declare class VideosClient {
|
|
2004
|
+
declare class VideosClient$1 {
|
|
1970
2005
|
private readonly client;
|
|
1971
2006
|
constructor(client: BaseClient);
|
|
1972
2007
|
search(params: VideosSearchParams): Promise<GoogleResponse>;
|
|
@@ -2009,7 +2044,7 @@ declare class VideosClient {
|
|
|
2009
2044
|
*/
|
|
2010
2045
|
declare class GoogleClient {
|
|
2011
2046
|
/** Google Web Search (SERP) — with optional deferred AI Overview follow-up. */
|
|
2012
|
-
readonly search: SearchClient$
|
|
2047
|
+
readonly search: SearchClient$4;
|
|
2013
2048
|
/** Google Maps — places, reviews, photos, posts. */
|
|
2014
2049
|
readonly maps: MapsClient;
|
|
2015
2050
|
/** Google News — articles, topics, trending. */
|
|
@@ -2031,7 +2066,7 @@ declare class GoogleClient {
|
|
|
2031
2066
|
/** Google Images. */
|
|
2032
2067
|
readonly images: ImagesClient;
|
|
2033
2068
|
/** Google Videos. */
|
|
2034
|
-
readonly videos: VideosClient;
|
|
2069
|
+
readonly videos: VideosClient$1;
|
|
2035
2070
|
/** Google Finance — stock and index quotes. */
|
|
2036
2071
|
readonly finance: FinanceClient;
|
|
2037
2072
|
/** Google AI Mode — generative answer responses. */
|
|
@@ -2043,7 +2078,7 @@ declare class GoogleClient {
|
|
|
2043
2078
|
/** Google Flights — one-way, round-trip, and multi-city itineraries. */
|
|
2044
2079
|
readonly flights: FlightsClient;
|
|
2045
2080
|
/** Google Products — immersive product detail. */
|
|
2046
|
-
readonly products: ProductsClient$
|
|
2081
|
+
readonly products: ProductsClient$2;
|
|
2047
2082
|
constructor(client: BaseClient);
|
|
2048
2083
|
}
|
|
2049
2084
|
|
|
@@ -2840,7 +2875,7 @@ interface DomainPostsResponse {
|
|
|
2840
2875
|
* const domainPosts = await client.reddit.search.domainPosts({ domain: "github.com" });
|
|
2841
2876
|
* ```
|
|
2842
2877
|
*/
|
|
2843
|
-
declare class SearchClient$
|
|
2878
|
+
declare class SearchClient$3 {
|
|
2844
2879
|
private readonly client;
|
|
2845
2880
|
constructor(client: BaseClient);
|
|
2846
2881
|
/**
|
|
@@ -3297,7 +3332,7 @@ declare class SubredditsClient {
|
|
|
3297
3332
|
* const comments = await client.reddit.users.comments("spez", { sort: "new" });
|
|
3298
3333
|
* ```
|
|
3299
3334
|
*/
|
|
3300
|
-
declare class UsersClient {
|
|
3335
|
+
declare class UsersClient$1 {
|
|
3301
3336
|
private readonly client;
|
|
3302
3337
|
constructor(client: BaseClient);
|
|
3303
3338
|
/**
|
|
@@ -3449,13 +3484,13 @@ declare class UsersClient {
|
|
|
3449
3484
|
*/
|
|
3450
3485
|
declare class RedditClient {
|
|
3451
3486
|
/** Client for search operations (posts, subreddits, users, domain posts) */
|
|
3452
|
-
readonly search: SearchClient$
|
|
3487
|
+
readonly search: SearchClient$3;
|
|
3453
3488
|
/** Client for post operations (trending, details, comments, duplicates) */
|
|
3454
3489
|
readonly posts: PostsClient;
|
|
3455
3490
|
/** Client for subreddit operations (details, posts, rules, moderators, wiki) */
|
|
3456
3491
|
readonly subreddits: SubredditsClient;
|
|
3457
3492
|
/** Client for user operations (profile, posts, comments, moderated, trophies) */
|
|
3458
|
-
readonly users: UsersClient;
|
|
3493
|
+
readonly users: UsersClient$1;
|
|
3459
3494
|
/**
|
|
3460
3495
|
* Create a new Reddit client.
|
|
3461
3496
|
*
|
|
@@ -3529,7 +3564,7 @@ interface CategoryInfo {
|
|
|
3529
3564
|
/**
|
|
3530
3565
|
* Per-star rating distribution (percentages 0-100).
|
|
3531
3566
|
*/
|
|
3532
|
-
interface RatingBreakdown {
|
|
3567
|
+
interface RatingBreakdown$1 {
|
|
3533
3568
|
five_star: number | null;
|
|
3534
3569
|
four_star: number | null;
|
|
3535
3570
|
three_star: number | null;
|
|
@@ -3623,7 +3658,7 @@ interface Product {
|
|
|
3623
3658
|
discount_percent: number | null;
|
|
3624
3659
|
rating: number | null;
|
|
3625
3660
|
ratings_total: number | null;
|
|
3626
|
-
rating_breakdown: RatingBreakdown | null;
|
|
3661
|
+
rating_breakdown: RatingBreakdown$1 | null;
|
|
3627
3662
|
bought_past_month: string | null;
|
|
3628
3663
|
in_stock: boolean | null;
|
|
3629
3664
|
availability: string | null;
|
|
@@ -3665,7 +3700,7 @@ interface Product {
|
|
|
3665
3700
|
/**
|
|
3666
3701
|
* A single search / category-browse result row.
|
|
3667
3702
|
*/
|
|
3668
|
-
interface SearchResult {
|
|
3703
|
+
interface SearchResult$1 {
|
|
3669
3704
|
position: number;
|
|
3670
3705
|
asin: string;
|
|
3671
3706
|
title: string | null;
|
|
@@ -3848,7 +3883,7 @@ interface AutocompleteSuggestion {
|
|
|
3848
3883
|
interface SearchResponse {
|
|
3849
3884
|
query: string;
|
|
3850
3885
|
domain: string;
|
|
3851
|
-
results: SearchResult[];
|
|
3886
|
+
results: SearchResult$1[];
|
|
3852
3887
|
pagination: Pagination;
|
|
3853
3888
|
scraped_utc: number | null;
|
|
3854
3889
|
scraped_at: string | null;
|
|
@@ -3875,7 +3910,7 @@ interface ReviewsResponse {
|
|
|
3875
3910
|
reviews: Review[];
|
|
3876
3911
|
rating: number | null;
|
|
3877
3912
|
ratings_total: number | null;
|
|
3878
|
-
rating_breakdown: RatingBreakdown | null;
|
|
3913
|
+
rating_breakdown: RatingBreakdown$1 | null;
|
|
3879
3914
|
pagination: Pagination;
|
|
3880
3915
|
scraped_utc: number | null;
|
|
3881
3916
|
scraped_at: string | null;
|
|
@@ -3911,7 +3946,7 @@ interface DealsResponse {
|
|
|
3911
3946
|
interface CategoryResponse {
|
|
3912
3947
|
domain: string;
|
|
3913
3948
|
node: string;
|
|
3914
|
-
results: SearchResult[];
|
|
3949
|
+
results: SearchResult$1[];
|
|
3915
3950
|
pagination: Pagination;
|
|
3916
3951
|
scraped_utc: number | null;
|
|
3917
3952
|
scraped_at: string | null;
|
|
@@ -3925,7 +3960,7 @@ interface SellerProfileResponse {
|
|
|
3925
3960
|
interface SellerProductsResponse {
|
|
3926
3961
|
domain: string;
|
|
3927
3962
|
seller_id: string;
|
|
3928
|
-
products: SearchResult[];
|
|
3963
|
+
products: SearchResult$1[];
|
|
3929
3964
|
pagination: Pagination;
|
|
3930
3965
|
scraped_utc: number | null;
|
|
3931
3966
|
scraped_at: string | null;
|
|
@@ -3946,7 +3981,7 @@ interface AutocompleteResponse {
|
|
|
3946
3981
|
suggestions: AutocompleteSuggestion[];
|
|
3947
3982
|
}
|
|
3948
3983
|
/** Response from the /markets endpoint. */
|
|
3949
|
-
interface MarketsResponse {
|
|
3984
|
+
interface MarketsResponse$1 {
|
|
3950
3985
|
markets: MarketInfo[];
|
|
3951
3986
|
}
|
|
3952
3987
|
/** Response from the /categories endpoint. */
|
|
@@ -4073,7 +4108,7 @@ interface AmazonAutocompleteParams {
|
|
|
4073
4108
|
* const suggestions = await client.amazon.search.autocomplete("lapt");
|
|
4074
4109
|
* ```
|
|
4075
4110
|
*/
|
|
4076
|
-
declare class SearchClient {
|
|
4111
|
+
declare class SearchClient$2 {
|
|
4077
4112
|
private readonly client;
|
|
4078
4113
|
constructor(client: BaseClient);
|
|
4079
4114
|
/**
|
|
@@ -4117,7 +4152,7 @@ declare class SearchClient {
|
|
|
4117
4152
|
* const reviews = await client.amazon.products.reviews("B08N5WRWNW");
|
|
4118
4153
|
* ```
|
|
4119
4154
|
*/
|
|
4120
|
-
declare class ProductsClient {
|
|
4155
|
+
declare class ProductsClient$1 {
|
|
4121
4156
|
private readonly client;
|
|
4122
4157
|
constructor(client: BaseClient);
|
|
4123
4158
|
/**
|
|
@@ -4269,7 +4304,7 @@ declare class SellersClient {
|
|
|
4269
4304
|
* const categories = await client.amazon.reference.categories();
|
|
4270
4305
|
* ```
|
|
4271
4306
|
*/
|
|
4272
|
-
declare class ReferenceClient {
|
|
4307
|
+
declare class ReferenceClient$2 {
|
|
4273
4308
|
private readonly client;
|
|
4274
4309
|
constructor(client: BaseClient);
|
|
4275
4310
|
/**
|
|
@@ -4277,7 +4312,7 @@ declare class ReferenceClient {
|
|
|
4277
4312
|
*
|
|
4278
4313
|
* @returns Markets response with all supported marketplaces.
|
|
4279
4314
|
*/
|
|
4280
|
-
markets(): Promise<MarketsResponse>;
|
|
4315
|
+
markets(): Promise<MarketsResponse$1>;
|
|
4281
4316
|
/**
|
|
4282
4317
|
* Get the reference department / category aliases.
|
|
4283
4318
|
*
|
|
@@ -4324,15 +4359,15 @@ declare class ReferenceClient {
|
|
|
4324
4359
|
*/
|
|
4325
4360
|
declare class AmazonClient {
|
|
4326
4361
|
/** Client for keyword search and autocomplete */
|
|
4327
|
-
readonly search: SearchClient;
|
|
4362
|
+
readonly search: SearchClient$2;
|
|
4328
4363
|
/** Client for product detail, offers, and reviews */
|
|
4329
|
-
readonly products: ProductsClient;
|
|
4364
|
+
readonly products: ProductsClient$1;
|
|
4330
4365
|
/** Client for bestsellers, new releases, deals, and category browse */
|
|
4331
4366
|
readonly listings: ListingsClient;
|
|
4332
4367
|
/** Client for seller profile, products, and feedback */
|
|
4333
4368
|
readonly sellers: SellersClient;
|
|
4334
4369
|
/** Client for reference data (markets, categories) */
|
|
4335
|
-
readonly reference: ReferenceClient;
|
|
4370
|
+
readonly reference: ReferenceClient$2;
|
|
4336
4371
|
/**
|
|
4337
4372
|
* Create a new Amazon client.
|
|
4338
4373
|
*
|
|
@@ -4341,6 +4376,1614 @@ declare class AmazonClient {
|
|
|
4341
4376
|
constructor(client: BaseClient);
|
|
4342
4377
|
}
|
|
4343
4378
|
|
|
4379
|
+
/**
|
|
4380
|
+
* TypeScript types for Shopee API responses.
|
|
4381
|
+
*
|
|
4382
|
+
* These interfaces mirror the backend `shopee_scraper` response schema
|
|
4383
|
+
* field-for-field. Optional / nullable backend fields are typed as
|
|
4384
|
+
* `Type | null`; backend list fields default to `[]` and are typed as arrays.
|
|
4385
|
+
* Every timestamp field ships in BOTH `*_utc` (number) and `*_at` (string) form.
|
|
4386
|
+
*
|
|
4387
|
+
* Supported markets: id, ph, vn, br, my, th, sg, tw, co, cl, mx.
|
|
4388
|
+
*/
|
|
4389
|
+
/**
|
|
4390
|
+
* Per-star rating counts for a product.
|
|
4391
|
+
*/
|
|
4392
|
+
interface RatingBreakdown {
|
|
4393
|
+
rating_star: number | null;
|
|
4394
|
+
/** Array of counts per star level [1★, 2★, 3★, 4★, 5★] */
|
|
4395
|
+
rating_count: number[];
|
|
4396
|
+
rcount_with_context: number | null;
|
|
4397
|
+
rcount_with_image: number | null;
|
|
4398
|
+
}
|
|
4399
|
+
/**
|
|
4400
|
+
* A product image with its CDN hash and resolved URL.
|
|
4401
|
+
*/
|
|
4402
|
+
interface ProductImage {
|
|
4403
|
+
hash: string;
|
|
4404
|
+
url: string;
|
|
4405
|
+
}
|
|
4406
|
+
/**
|
|
4407
|
+
* A purchasable variation (SKU) of a product.
|
|
4408
|
+
*/
|
|
4409
|
+
interface ProductModel {
|
|
4410
|
+
model_id: number | null;
|
|
4411
|
+
name: string | null;
|
|
4412
|
+
/** Normalised price in market currency */
|
|
4413
|
+
price: number | null;
|
|
4414
|
+
/** Raw Shopee-scaled integer price (×100000) */
|
|
4415
|
+
price_raw: number | null;
|
|
4416
|
+
price_before_discount: number | null;
|
|
4417
|
+
stock: number | null;
|
|
4418
|
+
sold: number | null;
|
|
4419
|
+
currency: string | null;
|
|
4420
|
+
sku: string | null;
|
|
4421
|
+
}
|
|
4422
|
+
/**
|
|
4423
|
+
* A name/value specification attribute of a product.
|
|
4424
|
+
*/
|
|
4425
|
+
interface ProductAttribute {
|
|
4426
|
+
name: string | null;
|
|
4427
|
+
value: string | null;
|
|
4428
|
+
id: number | null;
|
|
4429
|
+
}
|
|
4430
|
+
/**
|
|
4431
|
+
* A Shopee product — covers both search-result and full PDP shapes.
|
|
4432
|
+
*/
|
|
4433
|
+
interface ShopeeProduct {
|
|
4434
|
+
item_id: number;
|
|
4435
|
+
shop_id: number;
|
|
4436
|
+
name: string | null;
|
|
4437
|
+
/** Normalised price in market currency */
|
|
4438
|
+
price: number | null;
|
|
4439
|
+
/** Raw Shopee-scaled integer price (×100000) */
|
|
4440
|
+
price_raw: number | null;
|
|
4441
|
+
price_min: number | null;
|
|
4442
|
+
price_max: number | null;
|
|
4443
|
+
price_before_discount: number | null;
|
|
4444
|
+
discount: string | null;
|
|
4445
|
+
currency: string | null;
|
|
4446
|
+
rating_star: number | null;
|
|
4447
|
+
rating_count_total: number | null;
|
|
4448
|
+
rating: RatingBreakdown | null;
|
|
4449
|
+
stock: number | null;
|
|
4450
|
+
sold: number | null;
|
|
4451
|
+
historical_sold: number | null;
|
|
4452
|
+
liked_count: number | null;
|
|
4453
|
+
comment_count: number | null;
|
|
4454
|
+
view_count: number | null;
|
|
4455
|
+
image: string | null;
|
|
4456
|
+
images: ProductImage[];
|
|
4457
|
+
description: string | null;
|
|
4458
|
+
brand: string | null;
|
|
4459
|
+
categories: string[];
|
|
4460
|
+
attributes: ProductAttribute[];
|
|
4461
|
+
models: ProductModel[];
|
|
4462
|
+
tier_variations: Record<string, unknown>[];
|
|
4463
|
+
shop_location: string | null;
|
|
4464
|
+
shop_name: string | null;
|
|
4465
|
+
is_official_shop: boolean | null;
|
|
4466
|
+
is_preferred_plus_seller: boolean | null;
|
|
4467
|
+
item_status: string | null;
|
|
4468
|
+
is_adult: boolean | null;
|
|
4469
|
+
condition: number | null;
|
|
4470
|
+
/** Unix timestamp of item creation */
|
|
4471
|
+
ctime_utc: number | null;
|
|
4472
|
+
/** ISO-8601 UTC string of item creation */
|
|
4473
|
+
created_at: string | null;
|
|
4474
|
+
url: string | null;
|
|
4475
|
+
}
|
|
4476
|
+
/**
|
|
4477
|
+
* A page of search/category results.
|
|
4478
|
+
*/
|
|
4479
|
+
interface SearchResult {
|
|
4480
|
+
market: string;
|
|
4481
|
+
keyword: string | null;
|
|
4482
|
+
category_id: number | null;
|
|
4483
|
+
total_count: number | null;
|
|
4484
|
+
page: number;
|
|
4485
|
+
limit: number;
|
|
4486
|
+
has_more: boolean;
|
|
4487
|
+
next_offset: number | null;
|
|
4488
|
+
items: ShopeeProduct[];
|
|
4489
|
+
}
|
|
4490
|
+
/**
|
|
4491
|
+
* A seller's reply to a review.
|
|
4492
|
+
*/
|
|
4493
|
+
interface ReviewReply {
|
|
4494
|
+
comment: string | null;
|
|
4495
|
+
ctime_utc: number | null;
|
|
4496
|
+
created_at: string | null;
|
|
4497
|
+
}
|
|
4498
|
+
/**
|
|
4499
|
+
* A single product rating/review.
|
|
4500
|
+
*/
|
|
4501
|
+
interface ShopeeReview {
|
|
4502
|
+
comment_id: number | null;
|
|
4503
|
+
item_id: number | null;
|
|
4504
|
+
shop_id: number | null;
|
|
4505
|
+
order_id: number | null;
|
|
4506
|
+
rating_star: number | null;
|
|
4507
|
+
comment: string | null;
|
|
4508
|
+
author_username: string | null;
|
|
4509
|
+
author_shopid: number | null;
|
|
4510
|
+
author_portrait: string | null;
|
|
4511
|
+
anonymous: boolean | null;
|
|
4512
|
+
images: string[];
|
|
4513
|
+
videos: Record<string, unknown>[];
|
|
4514
|
+
product_variation: string | null;
|
|
4515
|
+
like_count: number | null;
|
|
4516
|
+
reply: ReviewReply | null;
|
|
4517
|
+
ctime_utc: number | null;
|
|
4518
|
+
created_at: string | null;
|
|
4519
|
+
editable: number | null;
|
|
4520
|
+
is_hidden: boolean | null;
|
|
4521
|
+
}
|
|
4522
|
+
/**
|
|
4523
|
+
* Aggregate rating summary returned alongside reviews.
|
|
4524
|
+
*/
|
|
4525
|
+
interface ReviewSummary {
|
|
4526
|
+
rating_star: number | null;
|
|
4527
|
+
rating_total: number | null;
|
|
4528
|
+
/** Array of counts per star level */
|
|
4529
|
+
rating_count: number[];
|
|
4530
|
+
rcount_with_media: number | null;
|
|
4531
|
+
rcount_with_context: number | null;
|
|
4532
|
+
}
|
|
4533
|
+
/**
|
|
4534
|
+
* A page of reviews for a product.
|
|
4535
|
+
*/
|
|
4536
|
+
interface ReviewsResult {
|
|
4537
|
+
market: string;
|
|
4538
|
+
item_id: number;
|
|
4539
|
+
shop_id: number;
|
|
4540
|
+
offset: number;
|
|
4541
|
+
limit: number;
|
|
4542
|
+
has_more: boolean;
|
|
4543
|
+
next_offset: number | null;
|
|
4544
|
+
summary: ReviewSummary | null;
|
|
4545
|
+
reviews: ShopeeReview[];
|
|
4546
|
+
}
|
|
4547
|
+
/**
|
|
4548
|
+
* A node in the Shopee category tree.
|
|
4549
|
+
*/
|
|
4550
|
+
interface CategoryNode {
|
|
4551
|
+
category_id: number;
|
|
4552
|
+
parent_id: number | null;
|
|
4553
|
+
name: string | null;
|
|
4554
|
+
display_name: string | null;
|
|
4555
|
+
image: string | null;
|
|
4556
|
+
no_sub: boolean | null;
|
|
4557
|
+
block_buyer_platform: number[];
|
|
4558
|
+
children: CategoryNode[];
|
|
4559
|
+
}
|
|
4560
|
+
/**
|
|
4561
|
+
* The full category tree for a market.
|
|
4562
|
+
*/
|
|
4563
|
+
interface CategoryTree {
|
|
4564
|
+
market: string;
|
|
4565
|
+
categories: CategoryNode[];
|
|
4566
|
+
}
|
|
4567
|
+
/**
|
|
4568
|
+
* A single supported Shopee marketplace.
|
|
4569
|
+
*/
|
|
4570
|
+
interface ShopeeMarket {
|
|
4571
|
+
/** Market code (e.g. "sg", "my", "ph") */
|
|
4572
|
+
code: string;
|
|
4573
|
+
/** Shopee domain (e.g. "shopee.sg") */
|
|
4574
|
+
domain: string;
|
|
4575
|
+
/** Country name */
|
|
4576
|
+
country: string;
|
|
4577
|
+
/** Currency code (e.g. "SGD") */
|
|
4578
|
+
currency: string;
|
|
4579
|
+
/** Locale (e.g. "en") */
|
|
4580
|
+
locale: string;
|
|
4581
|
+
/** Market display name */
|
|
4582
|
+
name: string;
|
|
4583
|
+
}
|
|
4584
|
+
/**
|
|
4585
|
+
* Response from the /v1/shopee/markets endpoint.
|
|
4586
|
+
*/
|
|
4587
|
+
interface MarketsResponse {
|
|
4588
|
+
markets: ShopeeMarket[];
|
|
4589
|
+
}
|
|
4590
|
+
/** Parameters for searching Shopee products. */
|
|
4591
|
+
interface ShopeeSearchParams {
|
|
4592
|
+
/** Search keyword string */
|
|
4593
|
+
keyword: string;
|
|
4594
|
+
/** Shopee market code (default: "sg") */
|
|
4595
|
+
market?: string;
|
|
4596
|
+
/** Maximum number of results (default: 60) */
|
|
4597
|
+
limit?: number;
|
|
4598
|
+
/** Pagination offset (default: 0) */
|
|
4599
|
+
offset?: number;
|
|
4600
|
+
/** Sort order (default: "relevancy") */
|
|
4601
|
+
sort_by?: "relevancy" | "ctime" | "sales" | "price_low_to_high" | "price_high_to_low";
|
|
4602
|
+
}
|
|
4603
|
+
/** Parameters for category-items listing. */
|
|
4604
|
+
interface ShopeeCategoryItemsParams {
|
|
4605
|
+
/** Shopee market code (default: "sg") */
|
|
4606
|
+
market?: string;
|
|
4607
|
+
/** Maximum number of results (default: 60) */
|
|
4608
|
+
limit?: number;
|
|
4609
|
+
/** Pagination offset (default: 0) */
|
|
4610
|
+
offset?: number;
|
|
4611
|
+
/** Sort order (default: "relevancy") */
|
|
4612
|
+
sort_by?: "relevancy" | "ctime" | "sales" | "price_low_to_high" | "price_high_to_low";
|
|
4613
|
+
}
|
|
4614
|
+
/** Options for fetching product detail. */
|
|
4615
|
+
interface ShopeeProductParams {
|
|
4616
|
+
/** Shopee market code (default: "sg") */
|
|
4617
|
+
market?: string;
|
|
4618
|
+
}
|
|
4619
|
+
/** Options for fetching product reviews. */
|
|
4620
|
+
interface ShopeeReviewsParams {
|
|
4621
|
+
/** Shopee market code (default: "sg") */
|
|
4622
|
+
market?: string;
|
|
4623
|
+
/** Maximum number of reviews (default: 20) */
|
|
4624
|
+
limit?: number;
|
|
4625
|
+
/** Pagination offset (default: 0) */
|
|
4626
|
+
offset?: number;
|
|
4627
|
+
/** Star filter — 0=all, 1-5 for a specific star count (default: 0) */
|
|
4628
|
+
rating?: number;
|
|
4629
|
+
/** Content filter — 0=all, 1=comment, 2=media, 3=local (default: 0) */
|
|
4630
|
+
filter?: number;
|
|
4631
|
+
}
|
|
4632
|
+
/** Options for fetching the category tree. */
|
|
4633
|
+
interface ShopeeCategoriesParams {
|
|
4634
|
+
/** Shopee market code (default: "sg") */
|
|
4635
|
+
market?: string;
|
|
4636
|
+
}
|
|
4637
|
+
|
|
4638
|
+
/**
|
|
4639
|
+
* Shopee Search API client.
|
|
4640
|
+
*
|
|
4641
|
+
* Provides methods for keyword search and category-item listing.
|
|
4642
|
+
*/
|
|
4643
|
+
|
|
4644
|
+
/**
|
|
4645
|
+
* Client for Shopee search and category-items endpoints.
|
|
4646
|
+
*
|
|
4647
|
+
* @example
|
|
4648
|
+
* ```typescript
|
|
4649
|
+
* const client = new ScrapeBadger({ apiKey: "key" });
|
|
4650
|
+
*
|
|
4651
|
+
* const results = await client.shopee.search.search({
|
|
4652
|
+
* keyword: "wireless headphones",
|
|
4653
|
+
* market: "sg",
|
|
4654
|
+
* });
|
|
4655
|
+
* for (const item of results.items) {
|
|
4656
|
+
* console.log(`${item.name}: ${item.price} ${item.currency}`);
|
|
4657
|
+
* }
|
|
4658
|
+
*
|
|
4659
|
+
* const cat = await client.shopee.search.categoryItems(100001, { market: "sg" });
|
|
4660
|
+
* ```
|
|
4661
|
+
*/
|
|
4662
|
+
declare class SearchClient$1 {
|
|
4663
|
+
private readonly client;
|
|
4664
|
+
constructor(client: BaseClient);
|
|
4665
|
+
/**
|
|
4666
|
+
* Search Shopee for products by keyword.
|
|
4667
|
+
*
|
|
4668
|
+
* @param params - Search parameters including keyword, market, pagination, and sort.
|
|
4669
|
+
* @returns Search result page with matched products and pagination metadata.
|
|
4670
|
+
* @throws AuthenticationError - If the API key is invalid.
|
|
4671
|
+
* @throws ValidationError - If the parameters are invalid.
|
|
4672
|
+
*/
|
|
4673
|
+
search(params: ShopeeSearchParams): Promise<SearchResult>;
|
|
4674
|
+
/**
|
|
4675
|
+
* List products within a specific Shopee category.
|
|
4676
|
+
*
|
|
4677
|
+
* @param categoryId - The Shopee category ID.
|
|
4678
|
+
* @param options - Optional parameters (market, limit, offset, sort_by).
|
|
4679
|
+
* @returns Search result page with products in the category.
|
|
4680
|
+
* @throws AuthenticationError - If the API key is invalid.
|
|
4681
|
+
* @throws ValidationError - If the category ID or market is invalid.
|
|
4682
|
+
*/
|
|
4683
|
+
categoryItems(categoryId: number, options?: ShopeeCategoryItemsParams): Promise<SearchResult>;
|
|
4684
|
+
}
|
|
4685
|
+
|
|
4686
|
+
/**
|
|
4687
|
+
* Shopee Products API client.
|
|
4688
|
+
*
|
|
4689
|
+
* Provides methods for fetching full product detail pages (PDP).
|
|
4690
|
+
*/
|
|
4691
|
+
|
|
4692
|
+
/**
|
|
4693
|
+
* Client for the Shopee product detail endpoint.
|
|
4694
|
+
*
|
|
4695
|
+
* @example
|
|
4696
|
+
* ```typescript
|
|
4697
|
+
* const client = new ScrapeBadger({ apiKey: "key" });
|
|
4698
|
+
*
|
|
4699
|
+
* const product = await client.shopee.products.get(12345, 67890, { market: "sg" });
|
|
4700
|
+
* console.log(`${product.name}: ${product.price} ${product.currency}`);
|
|
4701
|
+
*
|
|
4702
|
+
* for (const model of product.models) {
|
|
4703
|
+
* console.log(` Variant: ${model.name} — ${model.price}`);
|
|
4704
|
+
* }
|
|
4705
|
+
* ```
|
|
4706
|
+
*/
|
|
4707
|
+
declare class ProductsClient {
|
|
4708
|
+
private readonly client;
|
|
4709
|
+
constructor(client: BaseClient);
|
|
4710
|
+
/**
|
|
4711
|
+
* Get full product detail (PDP) for a Shopee item.
|
|
4712
|
+
*
|
|
4713
|
+
* @param shopId - The Shopee shop identifier.
|
|
4714
|
+
* @param itemId - The Shopee item identifier.
|
|
4715
|
+
* @param options - Optional parameters (market).
|
|
4716
|
+
* @returns Full product detail including pricing, ratings, images, and variations.
|
|
4717
|
+
* @throws NotFoundError - If the product doesn't exist.
|
|
4718
|
+
* @throws AuthenticationError - If the API key is invalid.
|
|
4719
|
+
* @throws ValidationError - If the market code is invalid.
|
|
4720
|
+
*/
|
|
4721
|
+
get(shopId: number, itemId: number, options?: ShopeeProductParams): Promise<ShopeeProduct>;
|
|
4722
|
+
}
|
|
4723
|
+
|
|
4724
|
+
/**
|
|
4725
|
+
* Shopee Reviews API client.
|
|
4726
|
+
*
|
|
4727
|
+
* Provides methods for fetching product reviews and rating summaries.
|
|
4728
|
+
*/
|
|
4729
|
+
|
|
4730
|
+
/**
|
|
4731
|
+
* Client for the Shopee product reviews endpoint.
|
|
4732
|
+
*
|
|
4733
|
+
* @example
|
|
4734
|
+
* ```typescript
|
|
4735
|
+
* const client = new ScrapeBadger({ apiKey: "key" });
|
|
4736
|
+
*
|
|
4737
|
+
* const reviews = await client.shopee.reviews.get(12345, 67890, { market: "sg" });
|
|
4738
|
+
* console.log(`${reviews.summary?.rating_total} reviews`);
|
|
4739
|
+
* for (const review of reviews.reviews) {
|
|
4740
|
+
* console.log(`${review.author_username}: ${review.rating_star}* ${review.comment}`);
|
|
4741
|
+
* }
|
|
4742
|
+
* ```
|
|
4743
|
+
*/
|
|
4744
|
+
declare class ReviewsClient {
|
|
4745
|
+
private readonly client;
|
|
4746
|
+
constructor(client: BaseClient);
|
|
4747
|
+
/**
|
|
4748
|
+
* Get product reviews for a Shopee item.
|
|
4749
|
+
*
|
|
4750
|
+
* @param shopId - The Shopee shop identifier.
|
|
4751
|
+
* @param itemId - The Shopee item identifier.
|
|
4752
|
+
* @param options - Optional parameters (market, limit, offset, rating, filter).
|
|
4753
|
+
* @returns Reviews result page with review items and aggregate summary.
|
|
4754
|
+
* @throws NotFoundError - If the product doesn't exist.
|
|
4755
|
+
* @throws AuthenticationError - If the API key is invalid.
|
|
4756
|
+
* @throws ValidationError - If the parameters are invalid.
|
|
4757
|
+
*/
|
|
4758
|
+
get(shopId: number, itemId: number, options?: ShopeeReviewsParams): Promise<ReviewsResult>;
|
|
4759
|
+
}
|
|
4760
|
+
|
|
4761
|
+
/**
|
|
4762
|
+
* Shopee Reference Data API client.
|
|
4763
|
+
*
|
|
4764
|
+
* Provides methods for fetching the static category tree and markets list.
|
|
4765
|
+
*/
|
|
4766
|
+
|
|
4767
|
+
/**
|
|
4768
|
+
* Client for Shopee reference data endpoints (markets, categories).
|
|
4769
|
+
*
|
|
4770
|
+
* @example
|
|
4771
|
+
* ```typescript
|
|
4772
|
+
* const client = new ScrapeBadger({ apiKey: "key" });
|
|
4773
|
+
*
|
|
4774
|
+
* const markets = await client.shopee.reference.markets();
|
|
4775
|
+
* for (const m of markets.markets) {
|
|
4776
|
+
* console.log(`${m.code}: ${m.domain} (${m.currency})`);
|
|
4777
|
+
* }
|
|
4778
|
+
*
|
|
4779
|
+
* const tree = await client.shopee.reference.categories({ market: "sg" });
|
|
4780
|
+
* for (const cat of tree.categories) {
|
|
4781
|
+
* console.log(`${cat.category_id}: ${cat.display_name}`);
|
|
4782
|
+
* }
|
|
4783
|
+
* ```
|
|
4784
|
+
*/
|
|
4785
|
+
declare class ReferenceClient$1 {
|
|
4786
|
+
private readonly client;
|
|
4787
|
+
constructor(client: BaseClient);
|
|
4788
|
+
/**
|
|
4789
|
+
* Get all supported Shopee marketplaces.
|
|
4790
|
+
*
|
|
4791
|
+
* @returns Markets response with all supported Shopee markets (0 credits).
|
|
4792
|
+
*/
|
|
4793
|
+
markets(): Promise<MarketsResponse>;
|
|
4794
|
+
/**
|
|
4795
|
+
* Get the full category tree for a Shopee market.
|
|
4796
|
+
*
|
|
4797
|
+
* @param options - Optional parameters (market).
|
|
4798
|
+
* @returns Category tree with all top-level and nested category nodes.
|
|
4799
|
+
* @throws AuthenticationError - If the API key is invalid.
|
|
4800
|
+
* @throws ValidationError - If the market code is invalid.
|
|
4801
|
+
*/
|
|
4802
|
+
categories(options?: ShopeeCategoriesParams): Promise<CategoryTree>;
|
|
4803
|
+
}
|
|
4804
|
+
|
|
4805
|
+
/**
|
|
4806
|
+
* Shopee API client.
|
|
4807
|
+
*
|
|
4808
|
+
* Provides access to all Shopee API endpoints through specialized sub-clients.
|
|
4809
|
+
*/
|
|
4810
|
+
|
|
4811
|
+
/**
|
|
4812
|
+
* Shopee API client with access to all Shopee endpoints.
|
|
4813
|
+
*
|
|
4814
|
+
* Provides sub-clients for different resource types:
|
|
4815
|
+
* - `search` - Keyword search and category-item listing
|
|
4816
|
+
* - `products` - Full product detail pages (PDP)
|
|
4817
|
+
* - `reviews` - Product reviews and rating summaries
|
|
4818
|
+
* - `reference` - Reference data (markets, category tree)
|
|
4819
|
+
*
|
|
4820
|
+
* Supported markets: id, ph, vn, br, my, th, sg, tw, co, cl, mx.
|
|
4821
|
+
*
|
|
4822
|
+
* @example
|
|
4823
|
+
* ```typescript
|
|
4824
|
+
* const client = new ScrapeBadger({ apiKey: "key" });
|
|
4825
|
+
*
|
|
4826
|
+
* // Search products
|
|
4827
|
+
* const results = await client.shopee.search.search({
|
|
4828
|
+
* keyword: "wireless headphones",
|
|
4829
|
+
* market: "sg",
|
|
4830
|
+
* });
|
|
4831
|
+
*
|
|
4832
|
+
* // Get product detail
|
|
4833
|
+
* const product = await client.shopee.products.get(12345, 67890, { market: "sg" });
|
|
4834
|
+
*
|
|
4835
|
+
* // Get reviews
|
|
4836
|
+
* const reviews = await client.shopee.reviews.get(12345, 67890, { rating: 5 });
|
|
4837
|
+
*
|
|
4838
|
+
* // Get reference data
|
|
4839
|
+
* const markets = await client.shopee.reference.markets();
|
|
4840
|
+
* const tree = await client.shopee.reference.categories({ market: "sg" });
|
|
4841
|
+
* ```
|
|
4842
|
+
*/
|
|
4843
|
+
declare class ShopeeClient {
|
|
4844
|
+
/** Client for keyword search and category-item listing */
|
|
4845
|
+
readonly search: SearchClient$1;
|
|
4846
|
+
/** Client for full product detail pages */
|
|
4847
|
+
readonly products: ProductsClient;
|
|
4848
|
+
/** Client for product reviews and rating summaries */
|
|
4849
|
+
readonly reviews: ReviewsClient;
|
|
4850
|
+
/** Client for reference data (markets, category tree) */
|
|
4851
|
+
readonly reference: ReferenceClient$1;
|
|
4852
|
+
/**
|
|
4853
|
+
* Create a new Shopee client.
|
|
4854
|
+
*
|
|
4855
|
+
* @param client - The base HTTP client for making requests.
|
|
4856
|
+
*/
|
|
4857
|
+
constructor(client: BaseClient);
|
|
4858
|
+
}
|
|
4859
|
+
|
|
4860
|
+
/**
|
|
4861
|
+
* TypeScript types for TikTok API responses.
|
|
4862
|
+
*
|
|
4863
|
+
* These interfaces mirror the backend `tiktok_scraper` response schema
|
|
4864
|
+
* field-for-field. Optional / nullable backend fields are typed as
|
|
4865
|
+
* `Type | null`; backend list fields default to `[]` and are typed as arrays.
|
|
4866
|
+
* Every datetime field ships in BOTH `*_utc` (number) and `*_at` (string) form.
|
|
4867
|
+
*/
|
|
4868
|
+
/**
|
|
4869
|
+
* Author summary embedded in a video, comment, or search result.
|
|
4870
|
+
*/
|
|
4871
|
+
interface TikTokAuthor {
|
|
4872
|
+
id: string;
|
|
4873
|
+
sec_uid?: string | null;
|
|
4874
|
+
/** @handle */
|
|
4875
|
+
unique_id: string;
|
|
4876
|
+
nickname?: string | null;
|
|
4877
|
+
avatar_thumb?: string | null;
|
|
4878
|
+
avatar_medium?: string | null;
|
|
4879
|
+
avatar_larger?: string | null;
|
|
4880
|
+
/** bio */
|
|
4881
|
+
signature?: string | null;
|
|
4882
|
+
verified: boolean;
|
|
4883
|
+
private_account?: boolean | null;
|
|
4884
|
+
follower_count?: number | null;
|
|
4885
|
+
following_count?: number | null;
|
|
4886
|
+
/** total likes received */
|
|
4887
|
+
heart_count?: number | null;
|
|
4888
|
+
video_count?: number | null;
|
|
4889
|
+
/** likes given */
|
|
4890
|
+
digg_count?: number | null;
|
|
4891
|
+
region?: string | null;
|
|
4892
|
+
sec_uid_present: boolean;
|
|
4893
|
+
short_id?: string | null;
|
|
4894
|
+
/** custom_verify / enterprise_verify_reason text */
|
|
4895
|
+
verify_reason?: string | null;
|
|
4896
|
+
verification_type?: number | null;
|
|
4897
|
+
account_region?: string | null;
|
|
4898
|
+
language?: string | null;
|
|
4899
|
+
original_musician?: boolean | null;
|
|
4900
|
+
/** featured / star creator */
|
|
4901
|
+
is_star?: boolean | null;
|
|
4902
|
+
ins_id?: string | null;
|
|
4903
|
+
twitter_name?: string | null;
|
|
4904
|
+
youtube_channel_title?: string | null;
|
|
4905
|
+
/** non-empty when live */
|
|
4906
|
+
room_id?: string | null;
|
|
4907
|
+
commerce_user_level?: number | null;
|
|
4908
|
+
with_shop_entry?: boolean | null;
|
|
4909
|
+
}
|
|
4910
|
+
/**
|
|
4911
|
+
* Engagement statistics for a video.
|
|
4912
|
+
*/
|
|
4913
|
+
interface TikTokStats {
|
|
4914
|
+
/** views */
|
|
4915
|
+
play_count: number;
|
|
4916
|
+
/** likes */
|
|
4917
|
+
digg_count: number;
|
|
4918
|
+
comment_count: number;
|
|
4919
|
+
share_count: number;
|
|
4920
|
+
/** saves / bookmarks */
|
|
4921
|
+
collect_count: number;
|
|
4922
|
+
download_count?: number | null;
|
|
4923
|
+
forward_count?: number | null;
|
|
4924
|
+
whatsapp_share_count?: number | null;
|
|
4925
|
+
repost_count?: number | null;
|
|
4926
|
+
}
|
|
4927
|
+
/**
|
|
4928
|
+
* Playable-media metadata for a video.
|
|
4929
|
+
*/
|
|
4930
|
+
interface TikTokVideoMeta {
|
|
4931
|
+
height?: number | null;
|
|
4932
|
+
width?: number | null;
|
|
4933
|
+
/** seconds */
|
|
4934
|
+
duration?: number | null;
|
|
4935
|
+
ratio?: string | null;
|
|
4936
|
+
format?: string | null;
|
|
4937
|
+
definition?: string | null;
|
|
4938
|
+
codec_type?: string | null;
|
|
4939
|
+
encoded_type?: string | null;
|
|
4940
|
+
bitrate?: number | null;
|
|
4941
|
+
cover?: string | null;
|
|
4942
|
+
origin_cover?: string | null;
|
|
4943
|
+
dynamic_cover?: string | null;
|
|
4944
|
+
animated_cover?: string | null;
|
|
4945
|
+
ai_dynamic_cover?: string | null;
|
|
4946
|
+
share_cover?: string | null;
|
|
4947
|
+
/** direct play URL */
|
|
4948
|
+
play_addr?: string | null;
|
|
4949
|
+
/** direct download URL (watermarked) */
|
|
4950
|
+
download_addr?: string | null;
|
|
4951
|
+
/** clean MP4 */
|
|
4952
|
+
download_no_watermark_addr?: string | null;
|
|
4953
|
+
has_watermark?: boolean | null;
|
|
4954
|
+
volume_loudness?: number | null;
|
|
4955
|
+
volume_peak?: number | null;
|
|
4956
|
+
}
|
|
4957
|
+
/**
|
|
4958
|
+
* Sound / music attached to a video, or a standalone music entity.
|
|
4959
|
+
*/
|
|
4960
|
+
interface TikTokMusic {
|
|
4961
|
+
id: string;
|
|
4962
|
+
title?: string | null;
|
|
4963
|
+
author_name?: string | null;
|
|
4964
|
+
album?: string | null;
|
|
4965
|
+
/** seconds */
|
|
4966
|
+
duration?: number | null;
|
|
4967
|
+
play_url?: string | null;
|
|
4968
|
+
cover_thumb?: string | null;
|
|
4969
|
+
cover_medium?: string | null;
|
|
4970
|
+
cover_large?: string | null;
|
|
4971
|
+
original?: boolean | null;
|
|
4972
|
+
is_copyrighted?: boolean | null;
|
|
4973
|
+
mid?: string | null;
|
|
4974
|
+
owner_id?: string | null;
|
|
4975
|
+
owner_nickname?: string | null;
|
|
4976
|
+
is_commerce_music?: boolean | null;
|
|
4977
|
+
is_original_sound?: boolean | null;
|
|
4978
|
+
/** Present only on standalone music endpoints */
|
|
4979
|
+
video_count?: number | null;
|
|
4980
|
+
user_count?: number | null;
|
|
4981
|
+
}
|
|
4982
|
+
/**
|
|
4983
|
+
* A hashtag/challenge as referenced from a video.
|
|
4984
|
+
*/
|
|
4985
|
+
interface TikTokChallenge {
|
|
4986
|
+
id: string;
|
|
4987
|
+
/** hashtag text, no '#' */
|
|
4988
|
+
title: string;
|
|
4989
|
+
desc?: string | null;
|
|
4990
|
+
cover?: string | null;
|
|
4991
|
+
is_commerce?: boolean | null;
|
|
4992
|
+
}
|
|
4993
|
+
/**
|
|
4994
|
+
* An effect / sticker applied to a video.
|
|
4995
|
+
*/
|
|
4996
|
+
interface TikTokEffectSticker {
|
|
4997
|
+
id: string;
|
|
4998
|
+
name?: string | null;
|
|
4999
|
+
photo_url?: string | null;
|
|
5000
|
+
}
|
|
5001
|
+
/**
|
|
5002
|
+
* An entity (hashtag mention or @user mention) inside the caption.
|
|
5003
|
+
*/
|
|
5004
|
+
interface TikTokTextExtra {
|
|
5005
|
+
/** "hashtag" | "mention" */
|
|
5006
|
+
type?: string | null;
|
|
5007
|
+
hashtag_name?: string | null;
|
|
5008
|
+
user_unique_id?: string | null;
|
|
5009
|
+
user_id?: string | null;
|
|
5010
|
+
start?: number | null;
|
|
5011
|
+
end?: number | null;
|
|
5012
|
+
}
|
|
5013
|
+
/**
|
|
5014
|
+
* A subtitle/caption track for a video.
|
|
5015
|
+
*/
|
|
5016
|
+
interface TikTokSubtitle {
|
|
5017
|
+
language?: string | null;
|
|
5018
|
+
language_code?: string | null;
|
|
5019
|
+
url?: string | null;
|
|
5020
|
+
/** ASR vs creator */
|
|
5021
|
+
source?: string | null;
|
|
5022
|
+
version?: string | null;
|
|
5023
|
+
format?: string | null;
|
|
5024
|
+
}
|
|
5025
|
+
/**
|
|
5026
|
+
* Moderation / availability state of a post (mobile aweme `status` block).
|
|
5027
|
+
*/
|
|
5028
|
+
interface TikTokVideoStatus {
|
|
5029
|
+
is_delete?: boolean | null;
|
|
5030
|
+
allow_share?: boolean | null;
|
|
5031
|
+
allow_comment?: boolean | null;
|
|
5032
|
+
/** 0 public, 1 friends, 2 private */
|
|
5033
|
+
private_status?: number | null;
|
|
5034
|
+
in_reviewing?: boolean | null;
|
|
5035
|
+
reviewed?: boolean | null;
|
|
5036
|
+
is_prohibited?: boolean | null;
|
|
5037
|
+
download_status?: number | null;
|
|
5038
|
+
self_see?: boolean | null;
|
|
5039
|
+
}
|
|
5040
|
+
/**
|
|
5041
|
+
* Per-post interaction permissions (mobile aweme `video_control` block).
|
|
5042
|
+
*/
|
|
5043
|
+
interface TikTokVideoControl {
|
|
5044
|
+
allow_download?: boolean | null;
|
|
5045
|
+
allow_duet?: boolean | null;
|
|
5046
|
+
allow_stitch?: boolean | null;
|
|
5047
|
+
allow_react?: boolean | null;
|
|
5048
|
+
allow_comment?: boolean | null;
|
|
5049
|
+
share_type?: number | null;
|
|
5050
|
+
prevent_download?: boolean | null;
|
|
5051
|
+
}
|
|
5052
|
+
/**
|
|
5053
|
+
* A link/shopping/POI anchor attached to a post.
|
|
5054
|
+
*/
|
|
5055
|
+
interface TikTokAnchor {
|
|
5056
|
+
id?: string | null;
|
|
5057
|
+
type?: number | null;
|
|
5058
|
+
keyword?: string | null;
|
|
5059
|
+
url?: string | null;
|
|
5060
|
+
icon?: string | null;
|
|
5061
|
+
}
|
|
5062
|
+
/**
|
|
5063
|
+
* A TikTok post (video or photo slideshow) with full metadata.
|
|
5064
|
+
*/
|
|
5065
|
+
interface TikTokVideo {
|
|
5066
|
+
id: string;
|
|
5067
|
+
/** caption text */
|
|
5068
|
+
description: string;
|
|
5069
|
+
text_language?: string | null;
|
|
5070
|
+
create_time_utc?: number | null;
|
|
5071
|
+
create_time_at?: string | null;
|
|
5072
|
+
/** locationCreated */
|
|
5073
|
+
region?: string | null;
|
|
5074
|
+
/** web video URL */
|
|
5075
|
+
url: string;
|
|
5076
|
+
/** canonical share link (mobile share_url) */
|
|
5077
|
+
share_url?: string | null;
|
|
5078
|
+
group_id?: string | null;
|
|
5079
|
+
/** 0 video, 150 photo/slideshow, … */
|
|
5080
|
+
aweme_type?: number | null;
|
|
5081
|
+
/** mobile content_type label */
|
|
5082
|
+
content_type?: string | null;
|
|
5083
|
+
author?: TikTokAuthor | null;
|
|
5084
|
+
music?: TikTokMusic | null;
|
|
5085
|
+
stats: TikTokStats;
|
|
5086
|
+
video?: TikTokVideoMeta | null;
|
|
5087
|
+
status?: TikTokVideoStatus | null;
|
|
5088
|
+
video_control?: TikTokVideoControl | null;
|
|
5089
|
+
anchors: TikTokAnchor[];
|
|
5090
|
+
hashtags: string[];
|
|
5091
|
+
mentions: string[];
|
|
5092
|
+
text_extra: TikTokTextExtra[];
|
|
5093
|
+
challenges: TikTokChallenge[];
|
|
5094
|
+
effect_stickers: TikTokEffectSticker[];
|
|
5095
|
+
is_slideshow: boolean;
|
|
5096
|
+
image_urls: string[];
|
|
5097
|
+
is_ad: boolean;
|
|
5098
|
+
is_aigc?: boolean | null;
|
|
5099
|
+
aigc_description?: string | null;
|
|
5100
|
+
is_pinned: boolean;
|
|
5101
|
+
is_muted?: boolean | null;
|
|
5102
|
+
secret?: boolean | null;
|
|
5103
|
+
private_item?: boolean | null;
|
|
5104
|
+
duet_enabled?: boolean | null;
|
|
5105
|
+
stitch_enabled?: boolean | null;
|
|
5106
|
+
share_enabled?: boolean | null;
|
|
5107
|
+
comment_status?: string | null;
|
|
5108
|
+
can_repost?: boolean | null;
|
|
5109
|
+
is_paid_content?: boolean | null;
|
|
5110
|
+
is_on_this_day?: boolean | null;
|
|
5111
|
+
/** supports bullet comments */
|
|
5112
|
+
support_danmaku?: boolean | null;
|
|
5113
|
+
subtitles: TikTokSubtitle[];
|
|
5114
|
+
voice_to_text?: string | null;
|
|
5115
|
+
diversification_labels: string[];
|
|
5116
|
+
suggested_words: string[];
|
|
5117
|
+
}
|
|
5118
|
+
/**
|
|
5119
|
+
* Aggregate counts for a user profile.
|
|
5120
|
+
*/
|
|
5121
|
+
interface TikTokUserStats {
|
|
5122
|
+
follower_count: number;
|
|
5123
|
+
following_count: number;
|
|
5124
|
+
/** total likes received */
|
|
5125
|
+
heart_count: number;
|
|
5126
|
+
video_count: number;
|
|
5127
|
+
/** likes given */
|
|
5128
|
+
digg_count: number;
|
|
5129
|
+
friend_count?: number | null;
|
|
5130
|
+
}
|
|
5131
|
+
/**
|
|
5132
|
+
* A full TikTok user profile.
|
|
5133
|
+
*/
|
|
5134
|
+
interface TikTokUser {
|
|
5135
|
+
id: string;
|
|
5136
|
+
/** needed to call list endpoints */
|
|
5137
|
+
sec_uid: string;
|
|
5138
|
+
/** @handle */
|
|
5139
|
+
unique_id: string;
|
|
5140
|
+
nickname?: string | null;
|
|
5141
|
+
/** bio */
|
|
5142
|
+
signature?: string | null;
|
|
5143
|
+
bio_link?: string | null;
|
|
5144
|
+
verified: boolean;
|
|
5145
|
+
/** enterprise_verify_reason / custom_verify text */
|
|
5146
|
+
verify_reason?: string | null;
|
|
5147
|
+
verification_type?: number | null;
|
|
5148
|
+
private_account: boolean;
|
|
5149
|
+
is_commerce_account?: boolean | null;
|
|
5150
|
+
/** TikTok Shop seller */
|
|
5151
|
+
is_seller?: boolean | null;
|
|
5152
|
+
is_organization?: boolean | null;
|
|
5153
|
+
original_musician?: boolean | null;
|
|
5154
|
+
is_star?: boolean | null;
|
|
5155
|
+
region?: string | null;
|
|
5156
|
+
language?: string | null;
|
|
5157
|
+
ins_id?: string | null;
|
|
5158
|
+
twitter_name?: string | null;
|
|
5159
|
+
youtube_channel_title?: string | null;
|
|
5160
|
+
avatar_thumb?: string | null;
|
|
5161
|
+
avatar_medium?: string | null;
|
|
5162
|
+
avatar_larger?: string | null;
|
|
5163
|
+
stats: TikTokUserStats;
|
|
5164
|
+
open_favorite?: boolean | null;
|
|
5165
|
+
comment_setting?: number | null;
|
|
5166
|
+
duet_setting?: number | null;
|
|
5167
|
+
stitch_setting?: number | null;
|
|
5168
|
+
download_setting?: number | null;
|
|
5169
|
+
following_visibility?: number | null;
|
|
5170
|
+
is_live?: boolean | null;
|
|
5171
|
+
room_id?: string | null;
|
|
5172
|
+
commerce_category?: string | null;
|
|
5173
|
+
commerce_user_level?: number | null;
|
|
5174
|
+
with_shop_entry?: boolean | null;
|
|
5175
|
+
create_time_utc?: number | null;
|
|
5176
|
+
create_time_at?: string | null;
|
|
5177
|
+
profile_url: string;
|
|
5178
|
+
}
|
|
5179
|
+
/**
|
|
5180
|
+
* A comment (or reply) on a video.
|
|
5181
|
+
*/
|
|
5182
|
+
interface TikTokComment {
|
|
5183
|
+
/** cid */
|
|
5184
|
+
id: string;
|
|
5185
|
+
text: string;
|
|
5186
|
+
/** parent video id */
|
|
5187
|
+
aweme_id?: string | null;
|
|
5188
|
+
parent_comment_id?: string | null;
|
|
5189
|
+
digg_count: number;
|
|
5190
|
+
reply_count: number;
|
|
5191
|
+
create_time_utc?: number | null;
|
|
5192
|
+
create_time_at?: string | null;
|
|
5193
|
+
liked_by_author?: boolean | null;
|
|
5194
|
+
pinned_by_author?: boolean | null;
|
|
5195
|
+
comment_language?: string | null;
|
|
5196
|
+
status?: number | null;
|
|
5197
|
+
/** @users in the comment */
|
|
5198
|
+
mentions: string[];
|
|
5199
|
+
text_extra: TikTokTextExtra[];
|
|
5200
|
+
/** comment sticker/images */
|
|
5201
|
+
image_urls: string[];
|
|
5202
|
+
author?: TikTokAuthor | null;
|
|
5203
|
+
replies: TikTokComment[];
|
|
5204
|
+
}
|
|
5205
|
+
/**
|
|
5206
|
+
* A hashtag / challenge detail.
|
|
5207
|
+
*/
|
|
5208
|
+
interface TikTokHashtag {
|
|
5209
|
+
id: string;
|
|
5210
|
+
/** name without '#' */
|
|
5211
|
+
title: string;
|
|
5212
|
+
description?: string | null;
|
|
5213
|
+
cover?: string | null;
|
|
5214
|
+
profile_larger?: string | null;
|
|
5215
|
+
video_count?: number | null;
|
|
5216
|
+
view_count?: number | null;
|
|
5217
|
+
is_commerce?: boolean | null;
|
|
5218
|
+
url: string;
|
|
5219
|
+
}
|
|
5220
|
+
interface TikTokTrendingHashtag {
|
|
5221
|
+
name: string;
|
|
5222
|
+
id?: string | null;
|
|
5223
|
+
rank?: number | null;
|
|
5224
|
+
rank_diff?: number | null;
|
|
5225
|
+
country_code?: string | null;
|
|
5226
|
+
industry?: string | null;
|
|
5227
|
+
/** videos using it */
|
|
5228
|
+
publish_count?: number | null;
|
|
5229
|
+
view_count?: number | null;
|
|
5230
|
+
/** distinct creators using it (mobile source) */
|
|
5231
|
+
user_count?: number | null;
|
|
5232
|
+
is_promoted?: boolean | null;
|
|
5233
|
+
is_new?: boolean | null;
|
|
5234
|
+
url?: string | null;
|
|
5235
|
+
}
|
|
5236
|
+
interface TikTokTrendingSong {
|
|
5237
|
+
title: string;
|
|
5238
|
+
id?: string | null;
|
|
5239
|
+
author?: string | null;
|
|
5240
|
+
rank?: number | null;
|
|
5241
|
+
rank_diff?: number | null;
|
|
5242
|
+
country_code?: string | null;
|
|
5243
|
+
duration?: number | null;
|
|
5244
|
+
/** videos using this sound (mobile trending metric) */
|
|
5245
|
+
user_count?: number | null;
|
|
5246
|
+
cover?: string | null;
|
|
5247
|
+
play_url?: string | null;
|
|
5248
|
+
is_new?: boolean | null;
|
|
5249
|
+
link?: string | null;
|
|
5250
|
+
}
|
|
5251
|
+
interface TikTokOEmbed {
|
|
5252
|
+
version: string;
|
|
5253
|
+
type: string;
|
|
5254
|
+
title?: string | null;
|
|
5255
|
+
author_name?: string | null;
|
|
5256
|
+
author_url?: string | null;
|
|
5257
|
+
provider_name: string;
|
|
5258
|
+
provider_url: string;
|
|
5259
|
+
html?: string | null;
|
|
5260
|
+
thumbnail_url?: string | null;
|
|
5261
|
+
thumbnail_width?: number | null;
|
|
5262
|
+
thumbnail_height?: number | null;
|
|
5263
|
+
embed_product_id?: string | null;
|
|
5264
|
+
embed_type?: string | null;
|
|
5265
|
+
}
|
|
5266
|
+
/**
|
|
5267
|
+
* Cursor pagination metadata shared by all list endpoints.
|
|
5268
|
+
*/
|
|
5269
|
+
interface TikTokCursorPage {
|
|
5270
|
+
has_more: boolean;
|
|
5271
|
+
/** opaque; pass back as ?cursor= */
|
|
5272
|
+
cursor?: string | null;
|
|
5273
|
+
/** number of items in THIS page */
|
|
5274
|
+
count: number;
|
|
5275
|
+
/** search endpoints chain rid → search_id */
|
|
5276
|
+
search_id?: string | null;
|
|
5277
|
+
}
|
|
5278
|
+
/** Response from the /users/{username} endpoint. */
|
|
5279
|
+
interface ProfileResponse {
|
|
5280
|
+
user: TikTokUser;
|
|
5281
|
+
region: string;
|
|
5282
|
+
}
|
|
5283
|
+
/** Response from the /videos/{video_id} endpoint. */
|
|
5284
|
+
interface VideoResponse {
|
|
5285
|
+
video: TikTokVideo;
|
|
5286
|
+
region: string;
|
|
5287
|
+
}
|
|
5288
|
+
/** Response wrapping a cursor-paginated list of videos. */
|
|
5289
|
+
interface VideoListResponse {
|
|
5290
|
+
videos: TikTokVideo[];
|
|
5291
|
+
pagination: TikTokCursorPage;
|
|
5292
|
+
region: string;
|
|
5293
|
+
}
|
|
5294
|
+
/** Response from the /videos/{video_id}/comments endpoint. */
|
|
5295
|
+
interface CommentListResponse {
|
|
5296
|
+
comments: TikTokComment[];
|
|
5297
|
+
pagination: TikTokCursorPage;
|
|
5298
|
+
region: string;
|
|
5299
|
+
}
|
|
5300
|
+
/** Followers / following lists. */
|
|
5301
|
+
interface UserListResponse {
|
|
5302
|
+
users: TikTokAuthor[];
|
|
5303
|
+
pagination: TikTokCursorPage;
|
|
5304
|
+
region: string;
|
|
5305
|
+
}
|
|
5306
|
+
/** Response from the /hashtags/{name} endpoint. */
|
|
5307
|
+
interface HashtagResponse {
|
|
5308
|
+
hashtag: TikTokHashtag;
|
|
5309
|
+
region: string;
|
|
5310
|
+
}
|
|
5311
|
+
/** Response from the /music/{music_id} endpoint. */
|
|
5312
|
+
interface MusicResponse {
|
|
5313
|
+
music: TikTokMusic;
|
|
5314
|
+
region: string;
|
|
5315
|
+
}
|
|
5316
|
+
/** Response from the /search/users endpoint. */
|
|
5317
|
+
interface UserSearchResponse {
|
|
5318
|
+
users: TikTokAuthor[];
|
|
5319
|
+
pagination: TikTokCursorPage;
|
|
5320
|
+
region: string;
|
|
5321
|
+
}
|
|
5322
|
+
/** Response from the /search/hashtags endpoint. */
|
|
5323
|
+
interface HashtagSearchResponse {
|
|
5324
|
+
hashtags: TikTokHashtag[];
|
|
5325
|
+
pagination: TikTokCursorPage;
|
|
5326
|
+
region: string;
|
|
5327
|
+
}
|
|
5328
|
+
/** Response from the /videos/{video_id}/transcript endpoint. */
|
|
5329
|
+
interface TranscriptResponse {
|
|
5330
|
+
video_id: string;
|
|
5331
|
+
subtitles: TikTokSubtitle[];
|
|
5332
|
+
voice_to_text?: string | null;
|
|
5333
|
+
region: string;
|
|
5334
|
+
}
|
|
5335
|
+
/** Response from the /trending/hashtags endpoint. */
|
|
5336
|
+
interface TrendingHashtagsResponse {
|
|
5337
|
+
hashtags: TikTokTrendingHashtag[];
|
|
5338
|
+
region: string;
|
|
5339
|
+
}
|
|
5340
|
+
/** Response from the /trending/songs endpoint. */
|
|
5341
|
+
interface TrendingSongsResponse {
|
|
5342
|
+
songs: TikTokTrendingSong[];
|
|
5343
|
+
region: string;
|
|
5344
|
+
}
|
|
5345
|
+
interface TikTokAdVideo {
|
|
5346
|
+
video_url?: string | null;
|
|
5347
|
+
cover_img?: string | null;
|
|
5348
|
+
}
|
|
5349
|
+
interface TikTokAd {
|
|
5350
|
+
id: string;
|
|
5351
|
+
/** advertiser name */
|
|
5352
|
+
name?: string | null;
|
|
5353
|
+
audit_status?: string | null;
|
|
5354
|
+
type?: string | null;
|
|
5355
|
+
/** epoch ms */
|
|
5356
|
+
first_shown_date?: number | null;
|
|
5357
|
+
/** epoch ms */
|
|
5358
|
+
last_shown_date?: number | null;
|
|
5359
|
+
videos: TikTokAdVideo[];
|
|
5360
|
+
}
|
|
5361
|
+
interface AdLibraryPage {
|
|
5362
|
+
has_more: boolean;
|
|
5363
|
+
total?: number | null;
|
|
5364
|
+
/** pass to the next page request */
|
|
5365
|
+
search_id?: string | null;
|
|
5366
|
+
offset: number;
|
|
5367
|
+
}
|
|
5368
|
+
/** Response from the /ads/search endpoint. */
|
|
5369
|
+
interface AdLibrarySearchResponse {
|
|
5370
|
+
ads: TikTokAd[];
|
|
5371
|
+
pagination: AdLibraryPage;
|
|
5372
|
+
region: string;
|
|
5373
|
+
}
|
|
5374
|
+
interface RegionInfo {
|
|
5375
|
+
code: string;
|
|
5376
|
+
country_code: string;
|
|
5377
|
+
locale: string;
|
|
5378
|
+
name: string;
|
|
5379
|
+
}
|
|
5380
|
+
/** Response from the /regions endpoint. */
|
|
5381
|
+
interface RegionsResponse {
|
|
5382
|
+
regions: RegionInfo[];
|
|
5383
|
+
}
|
|
5384
|
+
/** Options for the user profile endpoint. */
|
|
5385
|
+
interface TikTokUserParams {
|
|
5386
|
+
/** Content region (ISO 3166-1 alpha-2, default "US") */
|
|
5387
|
+
region?: string;
|
|
5388
|
+
}
|
|
5389
|
+
/** Options for cursor-paginated user list endpoints (videos/followers/following/liked/reposts). */
|
|
5390
|
+
interface TikTokUserListParams {
|
|
5391
|
+
/** Content region (ISO 3166-1 alpha-2, default "US") */
|
|
5392
|
+
region?: string;
|
|
5393
|
+
/** Number of items to return (1-50) */
|
|
5394
|
+
count?: number;
|
|
5395
|
+
/**
|
|
5396
|
+
* Opaque cursor from a previous page.
|
|
5397
|
+
* Only accepted by: user videos, followers, following.
|
|
5398
|
+
* Reposts and liked ignore this param — remove before sending.
|
|
5399
|
+
*/
|
|
5400
|
+
cursor?: string;
|
|
5401
|
+
}
|
|
5402
|
+
/** Options for the video detail endpoint. */
|
|
5403
|
+
interface TikTokVideoParams {
|
|
5404
|
+
/** Content region (ISO 3166-1 alpha-2, default "US") */
|
|
5405
|
+
region?: string;
|
|
5406
|
+
/** Author handle (skips oEmbed lookup) */
|
|
5407
|
+
username?: string;
|
|
5408
|
+
}
|
|
5409
|
+
/** Options for the video comments endpoint. */
|
|
5410
|
+
interface TikTokCommentsParams {
|
|
5411
|
+
/** Content region (ISO 3166-1 alpha-2, default "US") */
|
|
5412
|
+
region?: string;
|
|
5413
|
+
/** Number of items to return (1-50) */
|
|
5414
|
+
count?: number;
|
|
5415
|
+
/**
|
|
5416
|
+
* Pagination cursor from a prior response's pagination.cursor; omit for the first page.
|
|
5417
|
+
*/
|
|
5418
|
+
cursor?: string;
|
|
5419
|
+
}
|
|
5420
|
+
/** Options for the comment replies endpoint. */
|
|
5421
|
+
interface TikTokCommentRepliesParams {
|
|
5422
|
+
/** Parent video id (required) */
|
|
5423
|
+
videoId: string;
|
|
5424
|
+
/** Content region (ISO 3166-1 alpha-2, default "US") */
|
|
5425
|
+
region?: string;
|
|
5426
|
+
/** Number of items to return (1-50, default 20) */
|
|
5427
|
+
count?: number;
|
|
5428
|
+
/**
|
|
5429
|
+
* Pagination cursor from a prior response's pagination.cursor; omit for the first page.
|
|
5430
|
+
*/
|
|
5431
|
+
cursor?: string;
|
|
5432
|
+
}
|
|
5433
|
+
/** Options for the related-videos endpoint. */
|
|
5434
|
+
interface TikTokRelatedParams {
|
|
5435
|
+
/** Content region (ISO 3166-1 alpha-2, default "US") */
|
|
5436
|
+
region?: string;
|
|
5437
|
+
/** Number of items to return (1-50) */
|
|
5438
|
+
count?: number;
|
|
5439
|
+
}
|
|
5440
|
+
/** Options for the transcript endpoint. */
|
|
5441
|
+
interface TikTokTranscriptParams {
|
|
5442
|
+
/** Content region (ISO 3166-1 alpha-2, default "US") */
|
|
5443
|
+
region?: string;
|
|
5444
|
+
}
|
|
5445
|
+
/** Options for the oEmbed endpoint. */
|
|
5446
|
+
interface TikTokOEmbedParams {
|
|
5447
|
+
/** Content region (ISO 3166-1 alpha-2, default "US") */
|
|
5448
|
+
region?: string;
|
|
5449
|
+
}
|
|
5450
|
+
/** Options for the hashtag detail endpoint. */
|
|
5451
|
+
interface TikTokHashtagParams {
|
|
5452
|
+
/** Content region (ISO 3166-1 alpha-2, default "US") */
|
|
5453
|
+
region?: string;
|
|
5454
|
+
}
|
|
5455
|
+
/** Options for hashtag/music video listings. */
|
|
5456
|
+
interface TikTokListVideosParams {
|
|
5457
|
+
/** Content region (ISO 3166-1 alpha-2, default "US") */
|
|
5458
|
+
region?: string;
|
|
5459
|
+
/** Number of items to return (1-50) */
|
|
5460
|
+
count?: number;
|
|
5461
|
+
/**
|
|
5462
|
+
* Pagination cursor from a prior response's pagination.cursor; omit for the first page.
|
|
5463
|
+
*/
|
|
5464
|
+
cursor?: string;
|
|
5465
|
+
}
|
|
5466
|
+
/** Options for the music detail endpoint. */
|
|
5467
|
+
interface TikTokMusicParams {
|
|
5468
|
+
/** Content region (ISO 3166-1 alpha-2, default "US") */
|
|
5469
|
+
region?: string;
|
|
5470
|
+
}
|
|
5471
|
+
/** Options for the keyword search endpoints (general/videos/users/hashtags). */
|
|
5472
|
+
interface TikTokSearchParams {
|
|
5473
|
+
/** Search keyword (required) */
|
|
5474
|
+
query: string;
|
|
5475
|
+
/** Content region (ISO 3166-1 alpha-2, default "US") */
|
|
5476
|
+
region?: string;
|
|
5477
|
+
/** Number of items to return (1-50) */
|
|
5478
|
+
count?: number;
|
|
5479
|
+
/**
|
|
5480
|
+
* Pagination cursor from a prior response's pagination.cursor; omit for the first page.
|
|
5481
|
+
*/
|
|
5482
|
+
cursor?: string;
|
|
5483
|
+
}
|
|
5484
|
+
/** Options for the trending videos endpoint. */
|
|
5485
|
+
interface TikTokTrendingVideosParams {
|
|
5486
|
+
/** Content region (ISO 3166-1 alpha-2, default "US") */
|
|
5487
|
+
region?: string;
|
|
5488
|
+
/** Number of items to return (1-50) */
|
|
5489
|
+
count?: number;
|
|
5490
|
+
}
|
|
5491
|
+
/** Options for the trending hashtags / songs endpoints. */
|
|
5492
|
+
interface TikTokTrendingParams {
|
|
5493
|
+
/** Content region (ISO 3166-1 alpha-2, default "US") */
|
|
5494
|
+
region?: string;
|
|
5495
|
+
/** Trailing window in days (default 7) */
|
|
5496
|
+
period?: number;
|
|
5497
|
+
/** Number of items to return (1-50) */
|
|
5498
|
+
count?: number;
|
|
5499
|
+
}
|
|
5500
|
+
/** Options for the Ad Library search endpoint. */
|
|
5501
|
+
interface TikTokAdSearchParams {
|
|
5502
|
+
/** Keyword (ignored when advertiserId is set) */
|
|
5503
|
+
query?: string;
|
|
5504
|
+
/** Advertiser business id(s) for advertiser search */
|
|
5505
|
+
advertiser_id?: string;
|
|
5506
|
+
/** EU region code (the Ad Library is EU-only, default "DE") */
|
|
5507
|
+
region?: string;
|
|
5508
|
+
/** Trailing window in days (1-365, default 30) */
|
|
5509
|
+
days?: number;
|
|
5510
|
+
/** Sort order (default "last_shown_date,desc") */
|
|
5511
|
+
sort?: string;
|
|
5512
|
+
/** Result offset for pagination */
|
|
5513
|
+
offset?: number;
|
|
5514
|
+
/** Opaque search id chained from a previous page */
|
|
5515
|
+
search_id?: string;
|
|
5516
|
+
/** Number of items to return (1-50) */
|
|
5517
|
+
count?: number;
|
|
5518
|
+
}
|
|
5519
|
+
|
|
5520
|
+
/**
|
|
5521
|
+
* TikTok Users API client.
|
|
5522
|
+
*
|
|
5523
|
+
* Provides methods for user profiles and their cursor-paginated lists
|
|
5524
|
+
* (videos, followers, following, liked, reposts).
|
|
5525
|
+
*/
|
|
5526
|
+
|
|
5527
|
+
/**
|
|
5528
|
+
* Client for TikTok user endpoints (profile, videos, followers, following, liked, reposts).
|
|
5529
|
+
*
|
|
5530
|
+
* @example
|
|
5531
|
+
* ```typescript
|
|
5532
|
+
* const client = new ScrapeBadger({ apiKey: "key" });
|
|
5533
|
+
*
|
|
5534
|
+
* const profile = await client.tiktok.users.get("charlidamelio");
|
|
5535
|
+
* console.log(profile.user.stats.follower_count);
|
|
5536
|
+
*
|
|
5537
|
+
* const videos = await client.tiktok.users.videos("charlidamelio", { count: 30 });
|
|
5538
|
+
* ```
|
|
5539
|
+
*/
|
|
5540
|
+
declare class UsersClient {
|
|
5541
|
+
private readonly client;
|
|
5542
|
+
constructor(client: BaseClient);
|
|
5543
|
+
/**
|
|
5544
|
+
* Get a TikTok user's full profile.
|
|
5545
|
+
*
|
|
5546
|
+
* @param username - The user's @handle (without the leading '@').
|
|
5547
|
+
* @param options - Optional parameters (region).
|
|
5548
|
+
* @returns The user profile response.
|
|
5549
|
+
* @throws NotFoundError - If the user doesn't exist.
|
|
5550
|
+
*/
|
|
5551
|
+
get(username: string, options?: TikTokUserParams): Promise<ProfileResponse>;
|
|
5552
|
+
/**
|
|
5553
|
+
* Get a TikTok user's posted videos.
|
|
5554
|
+
*
|
|
5555
|
+
* @param username - The user's @handle.
|
|
5556
|
+
* @param options - Optional parameters (region, count, cursor).
|
|
5557
|
+
* @returns A cursor-paginated list of videos.
|
|
5558
|
+
*/
|
|
5559
|
+
videos(username: string, options?: TikTokUserListParams): Promise<VideoListResponse>;
|
|
5560
|
+
/**
|
|
5561
|
+
* Get a TikTok user's followers (best-effort; often guest-gated).
|
|
5562
|
+
*
|
|
5563
|
+
* @deprecated Requires an authenticated session; currently returns 410.
|
|
5564
|
+
* Kept for forward-compatibility — the endpoint may be re-enabled when
|
|
5565
|
+
* session-based access is supported.
|
|
5566
|
+
*
|
|
5567
|
+
* @param username - The user's @handle.
|
|
5568
|
+
* @param options - Optional parameters (region, count, cursor).
|
|
5569
|
+
* @returns A cursor-paginated list of follower authors.
|
|
5570
|
+
*/
|
|
5571
|
+
followers(username: string, options?: TikTokUserListParams): Promise<UserListResponse>;
|
|
5572
|
+
/**
|
|
5573
|
+
* Get accounts a TikTok user follows (best-effort).
|
|
5574
|
+
*
|
|
5575
|
+
* @deprecated Requires an authenticated session; currently returns 410.
|
|
5576
|
+
* Kept for forward-compatibility — the endpoint may be re-enabled when
|
|
5577
|
+
* session-based access is supported.
|
|
5578
|
+
*
|
|
5579
|
+
* @param username - The user's @handle.
|
|
5580
|
+
* @param options - Optional parameters (region, count, cursor).
|
|
5581
|
+
* @returns A cursor-paginated list of followed authors.
|
|
5582
|
+
*/
|
|
5583
|
+
following(username: string, options?: TikTokUserListParams): Promise<UserListResponse>;
|
|
5584
|
+
/**
|
|
5585
|
+
* Get a TikTok user's liked videos (only if their Liked tab is public).
|
|
5586
|
+
*
|
|
5587
|
+
* @deprecated Requires an authenticated session; currently returns 410.
|
|
5588
|
+
* Kept for forward-compatibility — the endpoint may be re-enabled when
|
|
5589
|
+
* session-based access is supported.
|
|
5590
|
+
*
|
|
5591
|
+
* @param username - The user's @handle.
|
|
5592
|
+
* @param options - Optional parameters (region, count).
|
|
5593
|
+
* @returns A cursor-paginated list of videos.
|
|
5594
|
+
*/
|
|
5595
|
+
liked(username: string, options?: TikTokUserListParams): Promise<VideoListResponse>;
|
|
5596
|
+
/**
|
|
5597
|
+
* Get videos a TikTok user has reposted.
|
|
5598
|
+
*
|
|
5599
|
+
* @param username - The user's @handle.
|
|
5600
|
+
* @param options - Optional parameters (region, count).
|
|
5601
|
+
* @returns A cursor-paginated list of videos.
|
|
5602
|
+
*/
|
|
5603
|
+
reposts(username: string, options?: TikTokUserListParams): Promise<VideoListResponse>;
|
|
5604
|
+
}
|
|
5605
|
+
|
|
5606
|
+
/**
|
|
5607
|
+
* TikTok Videos API client.
|
|
5608
|
+
*
|
|
5609
|
+
* Provides methods for video detail, comments, comment replies, related
|
|
5610
|
+
* videos, transcript, and oEmbed metadata.
|
|
5611
|
+
*/
|
|
5612
|
+
|
|
5613
|
+
/**
|
|
5614
|
+
* Client for TikTok video endpoints (detail, comments, replies, related, transcript, oEmbed).
|
|
5615
|
+
*
|
|
5616
|
+
* @example
|
|
5617
|
+
* ```typescript
|
|
5618
|
+
* const client = new ScrapeBadger({ apiKey: "key" });
|
|
5619
|
+
*
|
|
5620
|
+
* const video = await client.tiktok.videos.get("7372...");
|
|
5621
|
+
* console.log(video.video.stats.play_count);
|
|
5622
|
+
*
|
|
5623
|
+
* const comments = await client.tiktok.videos.comments("7372...");
|
|
5624
|
+
* ```
|
|
5625
|
+
*/
|
|
5626
|
+
declare class VideosClient {
|
|
5627
|
+
private readonly client;
|
|
5628
|
+
constructor(client: BaseClient);
|
|
5629
|
+
/**
|
|
5630
|
+
* Get full metadata for a single TikTok video/post.
|
|
5631
|
+
*
|
|
5632
|
+
* @param videoId - The video/post id.
|
|
5633
|
+
* @param options - Optional parameters (region, username).
|
|
5634
|
+
* @returns The video detail response.
|
|
5635
|
+
* @throws NotFoundError - If the video doesn't exist.
|
|
5636
|
+
*/
|
|
5637
|
+
get(videoId: string, options?: TikTokVideoParams): Promise<VideoResponse>;
|
|
5638
|
+
/**
|
|
5639
|
+
* Get top-level comments on a TikTok video.
|
|
5640
|
+
*
|
|
5641
|
+
* @param videoId - The video/post id.
|
|
5642
|
+
* @param options - Optional parameters (region, count, cursor).
|
|
5643
|
+
* @returns A cursor-paginated list of comments.
|
|
5644
|
+
*/
|
|
5645
|
+
comments(videoId: string, options?: TikTokCommentsParams): Promise<CommentListResponse>;
|
|
5646
|
+
/**
|
|
5647
|
+
* Get replies to a TikTok comment (best-effort).
|
|
5648
|
+
*
|
|
5649
|
+
* @param commentId - The comment id.
|
|
5650
|
+
* @param options - Parameters including the required `videoId` (region, count, cursor).
|
|
5651
|
+
* @returns A cursor-paginated list of reply comments.
|
|
5652
|
+
*/
|
|
5653
|
+
commentReplies(commentId: string, options: TikTokCommentRepliesParams): Promise<CommentListResponse>;
|
|
5654
|
+
/**
|
|
5655
|
+
* Get TikTok's related videos for a given video.
|
|
5656
|
+
*
|
|
5657
|
+
* @param videoId - The video/post id.
|
|
5658
|
+
* @param options - Optional parameters (region, count).
|
|
5659
|
+
* @returns A cursor-paginated list of related videos.
|
|
5660
|
+
*/
|
|
5661
|
+
related(videoId: string, options?: TikTokRelatedParams): Promise<VideoListResponse>;
|
|
5662
|
+
/**
|
|
5663
|
+
* Get subtitle/caption tracks for a TikTok video.
|
|
5664
|
+
*
|
|
5665
|
+
* @param videoId - The video/post id.
|
|
5666
|
+
* @param options - Optional parameters (region).
|
|
5667
|
+
* @returns The transcript response with subtitle tracks and voice-to-text.
|
|
5668
|
+
*/
|
|
5669
|
+
transcript(videoId: string, options?: TikTokTranscriptParams): Promise<TranscriptResponse>;
|
|
5670
|
+
/**
|
|
5671
|
+
* Get cheap unauthenticated oEmbed metadata for a TikTok URL.
|
|
5672
|
+
*
|
|
5673
|
+
* @param url - Full TikTok video or profile URL.
|
|
5674
|
+
* @param options - Optional parameters (region).
|
|
5675
|
+
* @returns The oEmbed metadata.
|
|
5676
|
+
*/
|
|
5677
|
+
oembed(url: string, options?: TikTokOEmbedParams): Promise<TikTokOEmbed>;
|
|
5678
|
+
}
|
|
5679
|
+
|
|
5680
|
+
/**
|
|
5681
|
+
* TikTok Search API client.
|
|
5682
|
+
*
|
|
5683
|
+
* Provides keyword search across videos, users, and hashtags.
|
|
5684
|
+
*/
|
|
5685
|
+
|
|
5686
|
+
/**
|
|
5687
|
+
* Client for TikTok search endpoints (general, videos, users, hashtags).
|
|
5688
|
+
*
|
|
5689
|
+
* @example
|
|
5690
|
+
* ```typescript
|
|
5691
|
+
* const client = new ScrapeBadger({ apiKey: "key" });
|
|
5692
|
+
*
|
|
5693
|
+
* const top = await client.tiktok.search.search({ query: "skincare" });
|
|
5694
|
+
* const users = await client.tiktok.search.users({ query: "skincare" });
|
|
5695
|
+
* ```
|
|
5696
|
+
*/
|
|
5697
|
+
declare class SearchClient {
|
|
5698
|
+
private readonly client;
|
|
5699
|
+
constructor(client: BaseClient);
|
|
5700
|
+
/**
|
|
5701
|
+
* General TikTok search — video results from the Top feed.
|
|
5702
|
+
*
|
|
5703
|
+
* @param params - Search parameters including query, region, count, cursor.
|
|
5704
|
+
* @returns A cursor-paginated list of videos.
|
|
5705
|
+
*/
|
|
5706
|
+
search(params: TikTokSearchParams): Promise<VideoListResponse>;
|
|
5707
|
+
/**
|
|
5708
|
+
* Search TikTok videos by keyword.
|
|
5709
|
+
*
|
|
5710
|
+
* @param params - Search parameters including query, region, count, cursor.
|
|
5711
|
+
* @returns A cursor-paginated list of videos.
|
|
5712
|
+
*/
|
|
5713
|
+
videos(params: TikTokSearchParams): Promise<VideoListResponse>;
|
|
5714
|
+
/**
|
|
5715
|
+
* Search TikTok users by keyword.
|
|
5716
|
+
*
|
|
5717
|
+
* @param params - Search parameters including query, region, count, cursor.
|
|
5718
|
+
* @returns A cursor-paginated list of matching users.
|
|
5719
|
+
*/
|
|
5720
|
+
users(params: TikTokSearchParams): Promise<UserSearchResponse>;
|
|
5721
|
+
/**
|
|
5722
|
+
* Search TikTok hashtags by keyword.
|
|
5723
|
+
*
|
|
5724
|
+
* @param params - Search parameters including query, region, count, cursor.
|
|
5725
|
+
* @returns A cursor-paginated list of matching hashtags.
|
|
5726
|
+
*/
|
|
5727
|
+
hashtags(params: TikTokSearchParams): Promise<HashtagSearchResponse>;
|
|
5728
|
+
}
|
|
5729
|
+
|
|
5730
|
+
/**
|
|
5731
|
+
* TikTok Music API client.
|
|
5732
|
+
*
|
|
5733
|
+
* Provides sound/music detail and the videos using a given sound.
|
|
5734
|
+
*/
|
|
5735
|
+
|
|
5736
|
+
/**
|
|
5737
|
+
* Client for TikTok music endpoints (detail, videos).
|
|
5738
|
+
*
|
|
5739
|
+
* @example
|
|
5740
|
+
* ```typescript
|
|
5741
|
+
* const client = new ScrapeBadger({ apiKey: "key" });
|
|
5742
|
+
*
|
|
5743
|
+
* const music = await client.tiktok.music.get("6975...");
|
|
5744
|
+
* const videos = await client.tiktok.music.videos("6975...");
|
|
5745
|
+
* ```
|
|
5746
|
+
*/
|
|
5747
|
+
declare class MusicClient {
|
|
5748
|
+
private readonly client;
|
|
5749
|
+
constructor(client: BaseClient);
|
|
5750
|
+
/**
|
|
5751
|
+
* Get TikTok sound/music detail.
|
|
5752
|
+
*
|
|
5753
|
+
* @param musicId - The sound/music id.
|
|
5754
|
+
* @param options - Optional parameters (region).
|
|
5755
|
+
* @returns The music detail response.
|
|
5756
|
+
* @throws NotFoundError - If the music doesn't exist.
|
|
5757
|
+
*/
|
|
5758
|
+
get(musicId: string, options?: TikTokMusicParams): Promise<MusicResponse>;
|
|
5759
|
+
/**
|
|
5760
|
+
* Get videos using a given TikTok sound.
|
|
5761
|
+
*
|
|
5762
|
+
* @param musicId - The sound/music id.
|
|
5763
|
+
* @param options - Optional parameters (region, count, cursor).
|
|
5764
|
+
* @returns A cursor-paginated list of videos.
|
|
5765
|
+
*/
|
|
5766
|
+
videos(musicId: string, options?: TikTokListVideosParams): Promise<VideoListResponse>;
|
|
5767
|
+
}
|
|
5768
|
+
|
|
5769
|
+
/**
|
|
5770
|
+
* TikTok Hashtags API client.
|
|
5771
|
+
*
|
|
5772
|
+
* Provides hashtag/challenge detail and the videos tagged with a hashtag.
|
|
5773
|
+
*/
|
|
5774
|
+
|
|
5775
|
+
/**
|
|
5776
|
+
* Client for TikTok hashtag endpoints (detail, videos).
|
|
5777
|
+
*
|
|
5778
|
+
* @example
|
|
5779
|
+
* ```typescript
|
|
5780
|
+
* const client = new ScrapeBadger({ apiKey: "key" });
|
|
5781
|
+
*
|
|
5782
|
+
* const tag = await client.tiktok.hashtags.get("fyp");
|
|
5783
|
+
* const videos = await client.tiktok.hashtags.videos("fyp");
|
|
5784
|
+
* ```
|
|
5785
|
+
*/
|
|
5786
|
+
declare class HashtagsClient {
|
|
5787
|
+
private readonly client;
|
|
5788
|
+
constructor(client: BaseClient);
|
|
5789
|
+
/**
|
|
5790
|
+
* Get TikTok hashtag/challenge detail.
|
|
5791
|
+
*
|
|
5792
|
+
* @param name - The hashtag name (without the leading '#').
|
|
5793
|
+
* @param options - Optional parameters (region).
|
|
5794
|
+
* @returns The hashtag detail response.
|
|
5795
|
+
* @throws NotFoundError - If the hashtag doesn't exist.
|
|
5796
|
+
*/
|
|
5797
|
+
get(name: string, options?: TikTokHashtagParams): Promise<HashtagResponse>;
|
|
5798
|
+
/**
|
|
5799
|
+
* Get videos tagged with a TikTok hashtag.
|
|
5800
|
+
*
|
|
5801
|
+
* @param name - The hashtag name (without the leading '#').
|
|
5802
|
+
* @param options - Optional parameters (region, count, cursor).
|
|
5803
|
+
* @returns A cursor-paginated list of videos.
|
|
5804
|
+
*/
|
|
5805
|
+
videos(name: string, options?: TikTokListVideosParams): Promise<VideoListResponse>;
|
|
5806
|
+
}
|
|
5807
|
+
|
|
5808
|
+
/**
|
|
5809
|
+
* TikTok Trending API client.
|
|
5810
|
+
*
|
|
5811
|
+
* Provides trending videos, hashtags, and songs.
|
|
5812
|
+
*/
|
|
5813
|
+
|
|
5814
|
+
/**
|
|
5815
|
+
* Client for TikTok trending endpoints (videos, hashtags, songs).
|
|
5816
|
+
*
|
|
5817
|
+
* @example
|
|
5818
|
+
* ```typescript
|
|
5819
|
+
* const client = new ScrapeBadger({ apiKey: "key" });
|
|
5820
|
+
*
|
|
5821
|
+
* const videos = await client.tiktok.trending.videos({ region: "US" });
|
|
5822
|
+
* const hashtags = await client.tiktok.trending.hashtags({ region: "US", period: 7 });
|
|
5823
|
+
* const songs = await client.tiktok.trending.songs({ region: "US" });
|
|
5824
|
+
* ```
|
|
5825
|
+
*/
|
|
5826
|
+
declare class TrendingClient {
|
|
5827
|
+
private readonly client;
|
|
5828
|
+
constructor(client: BaseClient);
|
|
5829
|
+
/**
|
|
5830
|
+
* Get trending videos from the TikTok Explore feed.
|
|
5831
|
+
*
|
|
5832
|
+
* @param options - Optional parameters (region, count).
|
|
5833
|
+
* @returns A cursor-paginated list of trending videos.
|
|
5834
|
+
*/
|
|
5835
|
+
videos(options?: TikTokTrendingVideosParams): Promise<VideoListResponse>;
|
|
5836
|
+
/**
|
|
5837
|
+
* Get trending hashtags (mobile Discover surface — view_count + creators).
|
|
5838
|
+
*
|
|
5839
|
+
* @param options - Optional parameters (region, period, count).
|
|
5840
|
+
* @returns The trending hashtags response.
|
|
5841
|
+
*/
|
|
5842
|
+
hashtags(options?: TikTokTrendingParams): Promise<TrendingHashtagsResponse>;
|
|
5843
|
+
/**
|
|
5844
|
+
* Get trending songs/sounds (mobile hot-music feed — ranked by usage).
|
|
5845
|
+
*
|
|
5846
|
+
* @param options - Optional parameters (region, period, count).
|
|
5847
|
+
* @returns The trending songs response.
|
|
5848
|
+
*/
|
|
5849
|
+
songs(options?: TikTokTrendingParams): Promise<TrendingSongsResponse>;
|
|
5850
|
+
}
|
|
5851
|
+
|
|
5852
|
+
/**
|
|
5853
|
+
* TikTok Ads API client.
|
|
5854
|
+
*
|
|
5855
|
+
* Provides access to TikTok's Commercial Content Library (EU-DSA ad
|
|
5856
|
+
* transparency) via keyword or advertiser search.
|
|
5857
|
+
*/
|
|
5858
|
+
|
|
5859
|
+
/**
|
|
5860
|
+
* Client for the TikTok Ad Library (Commercial Content Library) endpoint.
|
|
5861
|
+
*
|
|
5862
|
+
* @example
|
|
5863
|
+
* ```typescript
|
|
5864
|
+
* const client = new ScrapeBadger({ apiKey: "key" });
|
|
5865
|
+
*
|
|
5866
|
+
* const ads = await client.tiktok.ads.search({ query: "shoes", region: "DE" });
|
|
5867
|
+
* for (const ad of ads.ads) {
|
|
5868
|
+
* console.log(ad.name);
|
|
5869
|
+
* }
|
|
5870
|
+
* ```
|
|
5871
|
+
*/
|
|
5872
|
+
declare class AdsClient {
|
|
5873
|
+
private readonly client;
|
|
5874
|
+
constructor(client: BaseClient);
|
|
5875
|
+
/**
|
|
5876
|
+
* Search TikTok's Commercial Content Library (ad transparency) by keyword or advertiser.
|
|
5877
|
+
*
|
|
5878
|
+
* @param params - Optional parameters (query, advertiser_id, region, days, sort, offset, search_id, count).
|
|
5879
|
+
* @returns The ad-library search response with ads and pagination.
|
|
5880
|
+
*/
|
|
5881
|
+
search(params?: TikTokAdSearchParams): Promise<AdLibrarySearchResponse>;
|
|
5882
|
+
}
|
|
5883
|
+
|
|
5884
|
+
/**
|
|
5885
|
+
* TikTok Reference Data API client.
|
|
5886
|
+
*
|
|
5887
|
+
* Provides the supported-regions list and a service health check.
|
|
5888
|
+
*/
|
|
5889
|
+
|
|
5890
|
+
/**
|
|
5891
|
+
* Client for TikTok reference data endpoints (regions, health).
|
|
5892
|
+
*
|
|
5893
|
+
* @example
|
|
5894
|
+
* ```typescript
|
|
5895
|
+
* const client = new ScrapeBadger({ apiKey: "key" });
|
|
5896
|
+
*
|
|
5897
|
+
* const regions = await client.tiktok.reference.regions();
|
|
5898
|
+
* for (const r of regions.regions) {
|
|
5899
|
+
* console.log(`${r.code}: ${r.name} (${r.locale})`);
|
|
5900
|
+
* }
|
|
5901
|
+
* ```
|
|
5902
|
+
*/
|
|
5903
|
+
declare class ReferenceClient {
|
|
5904
|
+
private readonly client;
|
|
5905
|
+
constructor(client: BaseClient);
|
|
5906
|
+
/**
|
|
5907
|
+
* List supported TikTok content regions.
|
|
5908
|
+
*
|
|
5909
|
+
* @returns The regions response with all supported content regions.
|
|
5910
|
+
*/
|
|
5911
|
+
regions(): Promise<RegionsResponse>;
|
|
5912
|
+
/**
|
|
5913
|
+
* Check the health of the TikTok scraper service.
|
|
5914
|
+
*
|
|
5915
|
+
* @returns The raw health payload from the scraper service.
|
|
5916
|
+
*/
|
|
5917
|
+
health(): Promise<unknown>;
|
|
5918
|
+
}
|
|
5919
|
+
|
|
5920
|
+
/**
|
|
5921
|
+
* TikTok API client.
|
|
5922
|
+
*
|
|
5923
|
+
* Provides access to all TikTok API endpoints through specialized sub-clients.
|
|
5924
|
+
*/
|
|
5925
|
+
|
|
5926
|
+
/**
|
|
5927
|
+
* TikTok API client with access to all TikTok endpoints.
|
|
5928
|
+
*
|
|
5929
|
+
* Provides sub-clients for different resource types:
|
|
5930
|
+
* - `users` - Profiles, videos, followers, following, liked, reposts
|
|
5931
|
+
* - `videos` - Detail, comments, replies, related, transcript, oEmbed
|
|
5932
|
+
* - `search` - Keyword search across videos, users, and hashtags
|
|
5933
|
+
* - `music` - Sound/music detail and videos using a sound
|
|
5934
|
+
* - `hashtags` - Hashtag detail and tagged videos
|
|
5935
|
+
* - `trending` - Trending videos, hashtags, and songs
|
|
5936
|
+
* - `ads` - The Commercial Content Library (ad transparency)
|
|
5937
|
+
* - `reference` - Reference data (regions) and service health
|
|
5938
|
+
*
|
|
5939
|
+
* @example
|
|
5940
|
+
* ```typescript
|
|
5941
|
+
* const client = new ScrapeBadger({ apiKey: "key" });
|
|
5942
|
+
*
|
|
5943
|
+
* // Get a user profile
|
|
5944
|
+
* const profile = await client.tiktok.users.get("charlidamelio");
|
|
5945
|
+
*
|
|
5946
|
+
* // Get video detail
|
|
5947
|
+
* const video = await client.tiktok.videos.get("7372...");
|
|
5948
|
+
*
|
|
5949
|
+
* // Search videos
|
|
5950
|
+
* const results = await client.tiktok.search.videos({ query: "skincare" });
|
|
5951
|
+
*
|
|
5952
|
+
* // Get trending songs
|
|
5953
|
+
* const songs = await client.tiktok.trending.songs({ region: "US" });
|
|
5954
|
+
*
|
|
5955
|
+
* // Search the ad library
|
|
5956
|
+
* const ads = await client.tiktok.ads.search({ query: "shoes", region: "DE" });
|
|
5957
|
+
*
|
|
5958
|
+
* // List regions
|
|
5959
|
+
* const regions = await client.tiktok.reference.regions();
|
|
5960
|
+
* ```
|
|
5961
|
+
*/
|
|
5962
|
+
declare class TikTokClient {
|
|
5963
|
+
/** Client for profiles, videos, followers, following, liked, reposts */
|
|
5964
|
+
readonly users: UsersClient;
|
|
5965
|
+
/** Client for video detail, comments, replies, related, transcript, oEmbed */
|
|
5966
|
+
readonly videos: VideosClient;
|
|
5967
|
+
/** Client for keyword search across videos, users, and hashtags */
|
|
5968
|
+
readonly search: SearchClient;
|
|
5969
|
+
/** Client for sound/music detail and videos using a sound */
|
|
5970
|
+
readonly music: MusicClient;
|
|
5971
|
+
/** Client for hashtag detail and tagged videos */
|
|
5972
|
+
readonly hashtags: HashtagsClient;
|
|
5973
|
+
/** Client for trending videos, hashtags, and songs */
|
|
5974
|
+
readonly trending: TrendingClient;
|
|
5975
|
+
/** Client for the Commercial Content Library (ad transparency) */
|
|
5976
|
+
readonly ads: AdsClient;
|
|
5977
|
+
/** Client for reference data (regions) and service health */
|
|
5978
|
+
readonly reference: ReferenceClient;
|
|
5979
|
+
/**
|
|
5980
|
+
* Create a new TikTok client.
|
|
5981
|
+
*
|
|
5982
|
+
* @param client - The base HTTP client for making requests.
|
|
5983
|
+
*/
|
|
5984
|
+
constructor(client: BaseClient);
|
|
5985
|
+
}
|
|
5986
|
+
|
|
4344
5987
|
/**
|
|
4345
5988
|
* Main ScrapeBadger client.
|
|
4346
5989
|
*
|
|
@@ -4393,6 +6036,10 @@ declare class ScrapeBadger {
|
|
|
4393
6036
|
readonly reddit: RedditClient;
|
|
4394
6037
|
/** Amazon scraper API client — 14 endpoints */
|
|
4395
6038
|
readonly amazon: AmazonClient;
|
|
6039
|
+
/** Shopee scraper API client — 6 endpoints across 11 markets */
|
|
6040
|
+
readonly shopee: ShopeeClient;
|
|
6041
|
+
/** TikTok scraper API client — 26 endpoints */
|
|
6042
|
+
readonly tiktok: TikTokClient;
|
|
4396
6043
|
/**
|
|
4397
6044
|
* Create a new ScrapeBadger client.
|
|
4398
6045
|
*
|
|
@@ -4421,4 +6068,4 @@ declare class ScrapeBadger {
|
|
|
4421
6068
|
constructor(config?: Partial<ScrapeBadgerConfig>);
|
|
4422
6069
|
}
|
|
4423
6070
|
|
|
4424
|
-
export { type AiListItem, type AiModeResponse, type AiModeSearchParams, type AiReference, type AiTableRow, type AiTextBlock, type AmazonAutocompleteParams, type AutocompleteResponse as AmazonAutocompleteResponse, type AutocompleteSuggestion as AmazonAutocompleteSuggestion, type Bestseller as AmazonBestseller, type BestsellersRankEntry as AmazonBestsellersRankEntry, type BestsellersResponse as AmazonBestsellersResponse, type Buybox as AmazonBuybox, type CategoriesResponse as AmazonCategoriesResponse, type CategoryInfo as AmazonCategoryInfo, type AmazonCategoryParams, type CategoryResponse as AmazonCategoryResponse, AmazonClient, type Coupon as AmazonCoupon, type Deal as AmazonDeal, type AmazonDealsParams, type DealsResponse as AmazonDealsResponse, type Delivery as AmazonDelivery, type FeedbackWindow as AmazonFeedbackWindow, ListingsClient as AmazonListingsClient, type AmazonListingsParams, type MarketInfo as AmazonMarketInfo, type MarketsResponse as AmazonMarketsResponse, type NewReleasesResponse as AmazonNewReleasesResponse, type Offer as AmazonOffer, type OfferCondition as AmazonOfferCondition, type OfferDelivery as AmazonOfferDelivery, type OfferSeller as AmazonOfferSeller, type AmazonOffersParams, type OffersResponse as AmazonOffersResponse, type Pagination as AmazonPagination, type AmazonPrice, type Product as AmazonProduct, type ProductBadges as AmazonProductBadges, type ProductDeal as AmazonProductDeal, type ProductDetailResponse as AmazonProductDetailResponse, type AmazonProductParams, type ProductVariant as AmazonProductVariant, ProductsClient as AmazonProductsClient, type RatingBreakdown as AmazonRatingBreakdown, ReferenceClient as AmazonReferenceClient, type RelatedProduct as AmazonRelatedProduct, type Review as AmazonReview, type ReviewProfile as AmazonReviewProfile, type AmazonReviewsParams, type ReviewsResponse as AmazonReviewsResponse, SearchClient as AmazonSearchClient, type AmazonSearchParams, type SearchResponse as AmazonSearchResponse, type SearchResult as AmazonSearchResult, type Seller as AmazonSeller, type SellerFeedbackEntry as AmazonSellerFeedbackEntry, type SellerFeedbackResponse as AmazonSellerFeedbackResponse, type SellerFeedbackSummary as AmazonSellerFeedbackSummary, type AmazonSellerListParams, type AmazonSellerParams, type SellerProductsResponse as AmazonSellerProductsResponse, type SellerProfileResponse as AmazonSellerProfileResponse, SellersClient as AmazonSellersClient, type AutocompleteParams, type DetectOptions, type DetectResult, type DomainPostsResponse, type FinanceQuoteParams, type FlightsSearchParams, type FlightsStopsFilter, type FlightsTravelClass, type FlightsTripType, AiModeClient as GoogleAiModeClient, AutocompleteClient as GoogleAutocompleteClient, GoogleClient, FinanceClient as GoogleFinanceClient, FlightsClient as GoogleFlightsClient, HotelsClient as GoogleHotelsClient, ImagesClient as GoogleImagesClient, JobsClient as GoogleJobsClient, LensClient as GoogleLensClient, MapsClient as GoogleMapsClient, NewsClient as GoogleNewsClient, PatentsClient as GooglePatentsClient, ProductsClient$
|
|
6071
|
+
export { type AiListItem, type AiModeResponse, type AiModeSearchParams, type AiReference, type AiTableRow, type AiTextBlock, type AmazonAutocompleteParams, type AutocompleteResponse as AmazonAutocompleteResponse, type AutocompleteSuggestion as AmazonAutocompleteSuggestion, type Bestseller as AmazonBestseller, type BestsellersRankEntry as AmazonBestsellersRankEntry, type BestsellersResponse as AmazonBestsellersResponse, type Buybox as AmazonBuybox, type CategoriesResponse as AmazonCategoriesResponse, type CategoryInfo as AmazonCategoryInfo, type AmazonCategoryParams, type CategoryResponse as AmazonCategoryResponse, AmazonClient, type Coupon as AmazonCoupon, type Deal as AmazonDeal, type AmazonDealsParams, type DealsResponse as AmazonDealsResponse, type Delivery as AmazonDelivery, type FeedbackWindow as AmazonFeedbackWindow, ListingsClient as AmazonListingsClient, type AmazonListingsParams, type MarketInfo as AmazonMarketInfo, type MarketsResponse$1 as AmazonMarketsResponse, type NewReleasesResponse as AmazonNewReleasesResponse, type Offer as AmazonOffer, type OfferCondition as AmazonOfferCondition, type OfferDelivery as AmazonOfferDelivery, type OfferSeller as AmazonOfferSeller, type AmazonOffersParams, type OffersResponse as AmazonOffersResponse, type Pagination as AmazonPagination, type AmazonPrice, type Product as AmazonProduct, type ProductBadges as AmazonProductBadges, type ProductDeal as AmazonProductDeal, type ProductDetailResponse as AmazonProductDetailResponse, type AmazonProductParams, type ProductVariant as AmazonProductVariant, ProductsClient$1 as AmazonProductsClient, type RatingBreakdown$1 as AmazonRatingBreakdown, ReferenceClient$2 as AmazonReferenceClient, type RelatedProduct as AmazonRelatedProduct, type Review as AmazonReview, type ReviewProfile as AmazonReviewProfile, type AmazonReviewsParams, type ReviewsResponse as AmazonReviewsResponse, SearchClient$2 as AmazonSearchClient, type AmazonSearchParams, type SearchResponse as AmazonSearchResponse, type SearchResult$1 as AmazonSearchResult, type Seller as AmazonSeller, type SellerFeedbackEntry as AmazonSellerFeedbackEntry, type SellerFeedbackResponse as AmazonSellerFeedbackResponse, type SellerFeedbackSummary as AmazonSellerFeedbackSummary, type AmazonSellerListParams, type AmazonSellerParams, type SellerProductsResponse as AmazonSellerProductsResponse, type SellerProfileResponse as AmazonSellerProfileResponse, SellersClient as AmazonSellersClient, type AutocompleteParams, type DetectOptions, type DetectResult, type DomainPostsResponse, type FinanceQuoteParams, type FlightsSearchParams, type FlightsStopsFilter, type FlightsTravelClass, type FlightsTripType, AiModeClient as GoogleAiModeClient, AutocompleteClient as GoogleAutocompleteClient, GoogleClient, FinanceClient as GoogleFinanceClient, FlightsClient as GoogleFlightsClient, HotelsClient as GoogleHotelsClient, ImagesClient as GoogleImagesClient, JobsClient as GoogleJobsClient, LensClient as GoogleLensClient, MapsClient as GoogleMapsClient, NewsClient as GoogleNewsClient, PatentsClient as GooglePatentsClient, ProductsClient$2 as GoogleProductsClient, type GoogleResponse, ScholarClient as GoogleScholarClient, SearchClient$4 as GoogleSearchClient, type GoogleSearchParams, ShoppingClient as GoogleShoppingClient, ShortsClient as GoogleShortsClient, TrendsClient as GoogleTrendsClient, VideosClient$1 as GoogleVideosClient, type HotelsDetailsParams, type HotelsSearchParams, type ImagesSearchParams, type JobsSearchParams, type LensSearchParams, type MapsPhotosParams, type MapsPlaceParams, type MapsPostsParams, type MapsReviewsParams, type MapsSearchParams, type NewsSearchParams, type NewsTopicsParams, type NewsTrendingParams, type PatentsDetailParams, type PatentsSearchParams, type PopularSubredditsResponse, type PostCommentsResponse, type PostDetailResponse, type PostDuplicatesResponse, type ProductsDetailParams, type RedditAward, RedditClient, type RedditComment, type RedditModeratedSubreddit, type RedditPagination, type RedditPost, PostsClient as RedditPostsClient, type RedditRule, SearchClient$3 as RedditSearchClient, type RedditSubreddit, SubredditsClient as RedditSubredditsClient, type RedditTrophy, type RedditUser, type UserProfileResponse as RedditUserProfileResponse, type RedditUserSubreddit, UsersClient$1 as RedditUsersClient, type RedditWikiPage, type ScholarAuthorCitationParams, type ScholarAuthorParams, type ScholarCiteParams, type ScholarProfilesParams, type ScholarSearchParams, ScrapeBadger, ScrapeBadgerConfig, type ScrapeOptions, type ScrapeResult, type SearchPostsResponse, type SearchSubredditsResponse, type SearchUsersResponse, type ShopeeCategoriesParams, type ShopeeCategoryItemsParams, type CategoryNode as ShopeeCategoryNode, type CategoryTree as ShopeeCategoryTree, ShopeeClient, type ShopeeMarket, type MarketsResponse as ShopeeMarketsResponse, type ShopeeProduct, type ProductAttribute as ShopeeProductAttribute, type ProductImage as ShopeeProductImage, type ProductModel as ShopeeProductModel, type ShopeeProductParams, ProductsClient as ShopeeProductsClient, type RatingBreakdown as ShopeeRatingBreakdown, ReferenceClient$1 as ShopeeReferenceClient, type ShopeeReview, type ReviewReply as ShopeeReviewReply, type ReviewSummary as ShopeeReviewSummary, ReviewsClient as ShopeeReviewsClient, type ShopeeReviewsParams, type ReviewsResult as ShopeeReviewsResult, SearchClient$1 as ShopeeSearchClient, type ShopeeSearchParams, type SearchResult as ShopeeSearchResult, type ShoppingClickParams, type ShoppingProductParams, type ShoppingSearchParams, type ShortsSearchParams, type SubredditDetailResponse, type SubredditPostsResponse, type SubredditRulesResponse, type SubredditWikiPagesResponse, type TikTokAd, type AdLibraryPage as TikTokAdLibraryPage, type AdLibrarySearchResponse as TikTokAdLibrarySearchResponse, type TikTokAdSearchParams, type TikTokAdVideo, AdsClient as TikTokAdsClient, type TikTokAnchor, type TikTokAuthor, type TikTokChallenge, TikTokClient, type TikTokComment, type CommentListResponse as TikTokCommentListResponse, type TikTokCommentRepliesParams, type TikTokCommentsParams, type TikTokCursorPage, type TikTokEffectSticker, type TikTokHashtag, type TikTokHashtagParams, type HashtagResponse as TikTokHashtagResponse, type HashtagSearchResponse as TikTokHashtagSearchResponse, HashtagsClient as TikTokHashtagsClient, type TikTokListVideosParams, type TikTokMusic, MusicClient as TikTokMusicClient, type TikTokMusicParams, type MusicResponse as TikTokMusicResponse, type TikTokOEmbed, type TikTokOEmbedParams, type ProfileResponse as TikTokProfileResponse, ReferenceClient as TikTokReferenceClient, type RegionInfo as TikTokRegionInfo, type RegionsResponse as TikTokRegionsResponse, type TikTokRelatedParams, SearchClient as TikTokSearchClient, type TikTokSearchParams, type TikTokStats, type TikTokSubtitle, type TikTokTextExtra, type TikTokTranscriptParams, type TranscriptResponse as TikTokTranscriptResponse, TrendingClient as TikTokTrendingClient, type TikTokTrendingHashtag, type TrendingHashtagsResponse as TikTokTrendingHashtagsResponse, type TikTokTrendingParams, type TikTokTrendingSong, type TrendingSongsResponse as TikTokTrendingSongsResponse, type TikTokTrendingVideosParams, type TikTokUser, type TikTokUserListParams, type UserListResponse as TikTokUserListResponse, type TikTokUserParams, type UserSearchResponse as TikTokUserSearchResponse, type TikTokUserStats, UsersClient as TikTokUsersClient, type TikTokVideo, type TikTokVideoControl, type VideoListResponse as TikTokVideoListResponse, type TikTokVideoMeta, type TikTokVideoParams, type VideoResponse as TikTokVideoResponse, type TikTokVideoStatus, VideosClient as TikTokVideosClient, type TrendingPostsResponse, type TrendsAutocompleteParams, type TrendsInterestParams, type TrendsRegionsParams, type TrendsRelatedParams, type TrendsTrendingParams, TwitterClient, type UserCommentsResponse, type UserModeratedResponse, type UserPostsResponse, type UserTrophiesResponse, type VideosSearchParams, type VintedBrand, type BrandsResponse as VintedBrandsResponse, VintedClient, type VintedColor, type ColorsResponse as VintedColorsResponse, type VintedItemDetail, type ItemDetailResponse as VintedItemDetailResponse, type VintedItemSummary, ItemsClient as VintedItemsClient, type VintedMarket, type MarketsResponse$2 as VintedMarketsResponse, type VintedPagination, type VintedPhoto, type VintedPrice, ReferenceClient$3 as VintedReferenceClient, SearchClient$5 as VintedSearchClient, type VintedSearchParams, type SearchResponse$1 as VintedSearchResponse, type VintedSellerSummary, type VintedStatus, type StatusesResponse as VintedStatusesResponse, type UserItemsResponse as VintedUserItemsResponse, type VintedUserProfile, type UserProfileResponse$1 as VintedUserProfileResponse, type VintedUserSummary, UsersClient$2 as VintedUsersClient, WebClient, type WikiPageResponse };
|