scrapebadger 0.11.0 → 0.13.1

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/dist/index.d.cts CHANGED
@@ -469,7 +469,7 @@ interface StatusesResponse {
469
469
  /**
470
470
  * Response from the markets endpoint.
471
471
  */
472
- interface MarketsResponse$1 {
472
+ interface MarketsResponse$2 {
473
473
  /** List of available markets */
474
474
  markets: VintedMarket[];
475
475
  }
@@ -528,7 +528,7 @@ interface VintedSearchParams {
528
528
  * });
529
529
  * ```
530
530
  */
531
- declare class SearchClient$3 {
531
+ declare class SearchClient$5 {
532
532
  private readonly client;
533
533
  constructor(client: BaseClient);
534
534
  /**
@@ -623,7 +623,7 @@ declare class ItemsClient {
623
623
  * }
624
624
  * ```
625
625
  */
626
- declare class UsersClient$1 {
626
+ declare class UsersClient$2 {
627
627
  private readonly client;
628
628
  constructor(client: BaseClient);
629
629
  /**
@@ -706,7 +706,7 @@ declare class UsersClient$1 {
706
706
  * }
707
707
  * ```
708
708
  */
709
- declare class ReferenceClient$1 {
709
+ declare class ReferenceClient$3 {
710
710
  private readonly client;
711
711
  constructor(client: BaseClient);
712
712
  /**
@@ -784,7 +784,7 @@ declare class ReferenceClient$1 {
784
784
  * }
785
785
  * ```
786
786
  */
787
- markets(): Promise<MarketsResponse$1>;
787
+ markets(): Promise<MarketsResponse$2>;
788
788
  }
789
789
 
790
790
  /**
@@ -821,13 +821,13 @@ declare class ReferenceClient$1 {
821
821
  */
822
822
  declare class VintedClient {
823
823
  /** Client for item search operations */
824
- readonly search: SearchClient$3;
824
+ readonly search: SearchClient$5;
825
825
  /** Client for individual item operations */
826
826
  readonly items: ItemsClient;
827
827
  /** Client for user operations */
828
- readonly users: UsersClient$1;
828
+ readonly users: UsersClient$2;
829
829
  /** Client for reference data (brands, colors, statuses, markets) */
830
- readonly reference: ReferenceClient$1;
830
+ readonly reference: ReferenceClient$3;
831
831
  /**
832
832
  * Create a new Vinted client.
833
833
  *
@@ -1232,6 +1232,65 @@ interface AiModeSearchParams {
1232
1232
  q: string;
1233
1233
  gl?: string;
1234
1234
  hl?: string;
1235
+ /**
1236
+ * Include the raw `answer_html` body in the response (can be 100s of
1237
+ * KB). Defaults to true; set false when you only need `text_blocks` /
1238
+ * `markdown`.
1239
+ */
1240
+ include_html?: boolean;
1241
+ }
1242
+ /** A source cited by an AI Mode / AI Overview answer. */
1243
+ interface AiReference {
1244
+ title?: string | null;
1245
+ link?: string | null;
1246
+ snippet?: string | null;
1247
+ source?: string | null;
1248
+ favicon?: string | null;
1249
+ thumbnail?: string | null;
1250
+ index?: number | null;
1251
+ }
1252
+ /** One item inside a `list` text block. */
1253
+ interface AiListItem {
1254
+ type?: string;
1255
+ snippet?: string | null;
1256
+ links?: Array<Record<string, unknown>>;
1257
+ }
1258
+ /** One row of a `table` text block (ordered cell values). */
1259
+ interface AiTableRow {
1260
+ cells: string[];
1261
+ }
1262
+ /**
1263
+ * A single block of the AI-generated answer. `type` is one of
1264
+ * `paragraph` | `heading` | `list` | `table`. A `table` block carries
1265
+ * `header` + `rows`; a `list` block carries `items`.
1266
+ */
1267
+ interface AiTextBlock {
1268
+ type?: string | null;
1269
+ snippet?: string | null;
1270
+ text?: string | null;
1271
+ level?: number | null;
1272
+ items?: AiListItem[];
1273
+ citation_links?: AiReference[];
1274
+ links?: Array<Record<string, unknown>>;
1275
+ header?: string[];
1276
+ rows?: AiTableRow[];
1277
+ }
1278
+ /**
1279
+ * Response for `/v1/google/ai-mode/search`. `markdown` is a compact
1280
+ * rendering of the whole answer; `answer_html` is the raw answer body
1281
+ * (present unless `include_html: false`).
1282
+ */
1283
+ interface AiModeResponse {
1284
+ text_blocks: AiTextBlock[];
1285
+ references: AiReference[];
1286
+ shopping_results?: Array<Record<string, unknown>>;
1287
+ inline_images?: Array<Record<string, unknown>>;
1288
+ local_results?: Array<Record<string, unknown>>;
1289
+ markdown?: string | null;
1290
+ answer_html?: string | null;
1291
+ query: string;
1292
+ language: string;
1293
+ country: string;
1235
1294
  }
1236
1295
  /**
1237
1296
  * Params for `/v1/google/lens/search`. Response carries `lens_results`
@@ -1344,7 +1403,15 @@ interface FlightsSearchParams {
1344
1403
  declare class AiModeClient {
1345
1404
  private readonly client;
1346
1405
  constructor(client: BaseClient);
1347
- search(params: AiModeSearchParams): Promise<GoogleResponse>;
1406
+ /**
1407
+ * Get an AI-generated answer from Google's AI Mode (udm=50).
1408
+ *
1409
+ * The response carries structured `text_blocks` (prose, headings,
1410
+ * comparison `table` blocks and lists), a flat `references` list, a
1411
+ * compact `markdown` rendering and — unless `include_html: false` —
1412
+ * the raw `answer_html` body.
1413
+ */
1414
+ search(params: AiModeSearchParams): Promise<AiModeResponse>;
1348
1415
  }
1349
1416
 
1350
1417
  /**
@@ -1668,7 +1735,7 @@ declare class PatentsClient {
1668
1735
  /**
1669
1736
  * Client for Google's immersive product detail endpoint.
1670
1737
  */
1671
- declare class ProductsClient$1 {
1738
+ declare class ProductsClient$2 {
1672
1739
  private readonly client;
1673
1740
  constructor(client: BaseClient);
1674
1741
  detail(params: ProductsDetailParams): Promise<GoogleResponse>;
@@ -1746,7 +1813,7 @@ declare class ScholarClient {
1746
1813
  * }
1747
1814
  * ```
1748
1815
  */
1749
- declare class SearchClient$2 {
1816
+ declare class SearchClient$4 {
1750
1817
  private readonly client;
1751
1818
  constructor(client: BaseClient);
1752
1819
  /**
@@ -1899,7 +1966,7 @@ declare class TrendsClient {
1899
1966
  * }
1900
1967
  * ```
1901
1968
  */
1902
- declare class VideosClient {
1969
+ declare class VideosClient$1 {
1903
1970
  private readonly client;
1904
1971
  constructor(client: BaseClient);
1905
1972
  search(params: VideosSearchParams): Promise<GoogleResponse>;
@@ -1942,7 +2009,7 @@ declare class VideosClient {
1942
2009
  */
1943
2010
  declare class GoogleClient {
1944
2011
  /** Google Web Search (SERP) — with optional deferred AI Overview follow-up. */
1945
- readonly search: SearchClient$2;
2012
+ readonly search: SearchClient$4;
1946
2013
  /** Google Maps — places, reviews, photos, posts. */
1947
2014
  readonly maps: MapsClient;
1948
2015
  /** Google News — articles, topics, trending. */
@@ -1964,7 +2031,7 @@ declare class GoogleClient {
1964
2031
  /** Google Images. */
1965
2032
  readonly images: ImagesClient;
1966
2033
  /** Google Videos. */
1967
- readonly videos: VideosClient;
2034
+ readonly videos: VideosClient$1;
1968
2035
  /** Google Finance — stock and index quotes. */
1969
2036
  readonly finance: FinanceClient;
1970
2037
  /** Google AI Mode — generative answer responses. */
@@ -1976,7 +2043,7 @@ declare class GoogleClient {
1976
2043
  /** Google Flights — one-way, round-trip, and multi-city itineraries. */
1977
2044
  readonly flights: FlightsClient;
1978
2045
  /** Google Products — immersive product detail. */
1979
- readonly products: ProductsClient$1;
2046
+ readonly products: ProductsClient$2;
1980
2047
  constructor(client: BaseClient);
1981
2048
  }
1982
2049
 
@@ -2773,7 +2840,7 @@ interface DomainPostsResponse {
2773
2840
  * const domainPosts = await client.reddit.search.domainPosts({ domain: "github.com" });
2774
2841
  * ```
2775
2842
  */
2776
- declare class SearchClient$1 {
2843
+ declare class SearchClient$3 {
2777
2844
  private readonly client;
2778
2845
  constructor(client: BaseClient);
2779
2846
  /**
@@ -3230,7 +3297,7 @@ declare class SubredditsClient {
3230
3297
  * const comments = await client.reddit.users.comments("spez", { sort: "new" });
3231
3298
  * ```
3232
3299
  */
3233
- declare class UsersClient {
3300
+ declare class UsersClient$1 {
3234
3301
  private readonly client;
3235
3302
  constructor(client: BaseClient);
3236
3303
  /**
@@ -3382,13 +3449,13 @@ declare class UsersClient {
3382
3449
  */
3383
3450
  declare class RedditClient {
3384
3451
  /** Client for search operations (posts, subreddits, users, domain posts) */
3385
- readonly search: SearchClient$1;
3452
+ readonly search: SearchClient$3;
3386
3453
  /** Client for post operations (trending, details, comments, duplicates) */
3387
3454
  readonly posts: PostsClient;
3388
3455
  /** Client for subreddit operations (details, posts, rules, moderators, wiki) */
3389
3456
  readonly subreddits: SubredditsClient;
3390
3457
  /** Client for user operations (profile, posts, comments, moderated, trophies) */
3391
- readonly users: UsersClient;
3458
+ readonly users: UsersClient$1;
3392
3459
  /**
3393
3460
  * Create a new Reddit client.
3394
3461
  *
@@ -3462,7 +3529,7 @@ interface CategoryInfo {
3462
3529
  /**
3463
3530
  * Per-star rating distribution (percentages 0-100).
3464
3531
  */
3465
- interface RatingBreakdown {
3532
+ interface RatingBreakdown$1 {
3466
3533
  five_star: number | null;
3467
3534
  four_star: number | null;
3468
3535
  three_star: number | null;
@@ -3556,7 +3623,7 @@ interface Product {
3556
3623
  discount_percent: number | null;
3557
3624
  rating: number | null;
3558
3625
  ratings_total: number | null;
3559
- rating_breakdown: RatingBreakdown | null;
3626
+ rating_breakdown: RatingBreakdown$1 | null;
3560
3627
  bought_past_month: string | null;
3561
3628
  in_stock: boolean | null;
3562
3629
  availability: string | null;
@@ -3598,7 +3665,7 @@ interface Product {
3598
3665
  /**
3599
3666
  * A single search / category-browse result row.
3600
3667
  */
3601
- interface SearchResult {
3668
+ interface SearchResult$1 {
3602
3669
  position: number;
3603
3670
  asin: string;
3604
3671
  title: string | null;
@@ -3781,7 +3848,7 @@ interface AutocompleteSuggestion {
3781
3848
  interface SearchResponse {
3782
3849
  query: string;
3783
3850
  domain: string;
3784
- results: SearchResult[];
3851
+ results: SearchResult$1[];
3785
3852
  pagination: Pagination;
3786
3853
  scraped_utc: number | null;
3787
3854
  scraped_at: string | null;
@@ -3808,7 +3875,7 @@ interface ReviewsResponse {
3808
3875
  reviews: Review[];
3809
3876
  rating: number | null;
3810
3877
  ratings_total: number | null;
3811
- rating_breakdown: RatingBreakdown | null;
3878
+ rating_breakdown: RatingBreakdown$1 | null;
3812
3879
  pagination: Pagination;
3813
3880
  scraped_utc: number | null;
3814
3881
  scraped_at: string | null;
@@ -3844,7 +3911,7 @@ interface DealsResponse {
3844
3911
  interface CategoryResponse {
3845
3912
  domain: string;
3846
3913
  node: string;
3847
- results: SearchResult[];
3914
+ results: SearchResult$1[];
3848
3915
  pagination: Pagination;
3849
3916
  scraped_utc: number | null;
3850
3917
  scraped_at: string | null;
@@ -3858,7 +3925,7 @@ interface SellerProfileResponse {
3858
3925
  interface SellerProductsResponse {
3859
3926
  domain: string;
3860
3927
  seller_id: string;
3861
- products: SearchResult[];
3928
+ products: SearchResult$1[];
3862
3929
  pagination: Pagination;
3863
3930
  scraped_utc: number | null;
3864
3931
  scraped_at: string | null;
@@ -3879,7 +3946,7 @@ interface AutocompleteResponse {
3879
3946
  suggestions: AutocompleteSuggestion[];
3880
3947
  }
3881
3948
  /** Response from the /markets endpoint. */
3882
- interface MarketsResponse {
3949
+ interface MarketsResponse$1 {
3883
3950
  markets: MarketInfo[];
3884
3951
  }
3885
3952
  /** Response from the /categories endpoint. */
@@ -4006,7 +4073,7 @@ interface AmazonAutocompleteParams {
4006
4073
  * const suggestions = await client.amazon.search.autocomplete("lapt");
4007
4074
  * ```
4008
4075
  */
4009
- declare class SearchClient {
4076
+ declare class SearchClient$2 {
4010
4077
  private readonly client;
4011
4078
  constructor(client: BaseClient);
4012
4079
  /**
@@ -4050,7 +4117,7 @@ declare class SearchClient {
4050
4117
  * const reviews = await client.amazon.products.reviews("B08N5WRWNW");
4051
4118
  * ```
4052
4119
  */
4053
- declare class ProductsClient {
4120
+ declare class ProductsClient$1 {
4054
4121
  private readonly client;
4055
4122
  constructor(client: BaseClient);
4056
4123
  /**
@@ -4202,7 +4269,7 @@ declare class SellersClient {
4202
4269
  * const categories = await client.amazon.reference.categories();
4203
4270
  * ```
4204
4271
  */
4205
- declare class ReferenceClient {
4272
+ declare class ReferenceClient$2 {
4206
4273
  private readonly client;
4207
4274
  constructor(client: BaseClient);
4208
4275
  /**
@@ -4210,7 +4277,7 @@ declare class ReferenceClient {
4210
4277
  *
4211
4278
  * @returns Markets response with all supported marketplaces.
4212
4279
  */
4213
- markets(): Promise<MarketsResponse>;
4280
+ markets(): Promise<MarketsResponse$1>;
4214
4281
  /**
4215
4282
  * Get the reference department / category aliases.
4216
4283
  *
@@ -4257,15 +4324,15 @@ declare class ReferenceClient {
4257
4324
  */
4258
4325
  declare class AmazonClient {
4259
4326
  /** Client for keyword search and autocomplete */
4260
- readonly search: SearchClient;
4327
+ readonly search: SearchClient$2;
4261
4328
  /** Client for product detail, offers, and reviews */
4262
- readonly products: ProductsClient;
4329
+ readonly products: ProductsClient$1;
4263
4330
  /** Client for bestsellers, new releases, deals, and category browse */
4264
4331
  readonly listings: ListingsClient;
4265
4332
  /** Client for seller profile, products, and feedback */
4266
4333
  readonly sellers: SellersClient;
4267
4334
  /** Client for reference data (markets, categories) */
4268
- readonly reference: ReferenceClient;
4335
+ readonly reference: ReferenceClient$2;
4269
4336
  /**
4270
4337
  * Create a new Amazon client.
4271
4338
  *
@@ -4274,6 +4341,1614 @@ declare class AmazonClient {
4274
4341
  constructor(client: BaseClient);
4275
4342
  }
4276
4343
 
4344
+ /**
4345
+ * TypeScript types for Shopee API responses.
4346
+ *
4347
+ * These interfaces mirror the backend `shopee_scraper` response schema
4348
+ * field-for-field. Optional / nullable backend fields are typed as
4349
+ * `Type | null`; backend list fields default to `[]` and are typed as arrays.
4350
+ * Every timestamp field ships in BOTH `*_utc` (number) and `*_at` (string) form.
4351
+ *
4352
+ * Supported markets: id, ph, vn, br, my, th, sg, tw, co, cl, mx.
4353
+ */
4354
+ /**
4355
+ * Per-star rating counts for a product.
4356
+ */
4357
+ interface RatingBreakdown {
4358
+ rating_star: number | null;
4359
+ /** Array of counts per star level [1★, 2★, 3★, 4★, 5★] */
4360
+ rating_count: number[];
4361
+ rcount_with_context: number | null;
4362
+ rcount_with_image: number | null;
4363
+ }
4364
+ /**
4365
+ * A product image with its CDN hash and resolved URL.
4366
+ */
4367
+ interface ProductImage {
4368
+ hash: string;
4369
+ url: string;
4370
+ }
4371
+ /**
4372
+ * A purchasable variation (SKU) of a product.
4373
+ */
4374
+ interface ProductModel {
4375
+ model_id: number | null;
4376
+ name: string | null;
4377
+ /** Normalised price in market currency */
4378
+ price: number | null;
4379
+ /** Raw Shopee-scaled integer price (×100000) */
4380
+ price_raw: number | null;
4381
+ price_before_discount: number | null;
4382
+ stock: number | null;
4383
+ sold: number | null;
4384
+ currency: string | null;
4385
+ sku: string | null;
4386
+ }
4387
+ /**
4388
+ * A name/value specification attribute of a product.
4389
+ */
4390
+ interface ProductAttribute {
4391
+ name: string | null;
4392
+ value: string | null;
4393
+ id: number | null;
4394
+ }
4395
+ /**
4396
+ * A Shopee product — covers both search-result and full PDP shapes.
4397
+ */
4398
+ interface ShopeeProduct {
4399
+ item_id: number;
4400
+ shop_id: number;
4401
+ name: string | null;
4402
+ /** Normalised price in market currency */
4403
+ price: number | null;
4404
+ /** Raw Shopee-scaled integer price (×100000) */
4405
+ price_raw: number | null;
4406
+ price_min: number | null;
4407
+ price_max: number | null;
4408
+ price_before_discount: number | null;
4409
+ discount: string | null;
4410
+ currency: string | null;
4411
+ rating_star: number | null;
4412
+ rating_count_total: number | null;
4413
+ rating: RatingBreakdown | null;
4414
+ stock: number | null;
4415
+ sold: number | null;
4416
+ historical_sold: number | null;
4417
+ liked_count: number | null;
4418
+ comment_count: number | null;
4419
+ view_count: number | null;
4420
+ image: string | null;
4421
+ images: ProductImage[];
4422
+ description: string | null;
4423
+ brand: string | null;
4424
+ categories: string[];
4425
+ attributes: ProductAttribute[];
4426
+ models: ProductModel[];
4427
+ tier_variations: Record<string, unknown>[];
4428
+ shop_location: string | null;
4429
+ shop_name: string | null;
4430
+ is_official_shop: boolean | null;
4431
+ is_preferred_plus_seller: boolean | null;
4432
+ item_status: string | null;
4433
+ is_adult: boolean | null;
4434
+ condition: number | null;
4435
+ /** Unix timestamp of item creation */
4436
+ ctime_utc: number | null;
4437
+ /** ISO-8601 UTC string of item creation */
4438
+ created_at: string | null;
4439
+ url: string | null;
4440
+ }
4441
+ /**
4442
+ * A page of search/category results.
4443
+ */
4444
+ interface SearchResult {
4445
+ market: string;
4446
+ keyword: string | null;
4447
+ category_id: number | null;
4448
+ total_count: number | null;
4449
+ page: number;
4450
+ limit: number;
4451
+ has_more: boolean;
4452
+ next_offset: number | null;
4453
+ items: ShopeeProduct[];
4454
+ }
4455
+ /**
4456
+ * A seller's reply to a review.
4457
+ */
4458
+ interface ReviewReply {
4459
+ comment: string | null;
4460
+ ctime_utc: number | null;
4461
+ created_at: string | null;
4462
+ }
4463
+ /**
4464
+ * A single product rating/review.
4465
+ */
4466
+ interface ShopeeReview {
4467
+ comment_id: number | null;
4468
+ item_id: number | null;
4469
+ shop_id: number | null;
4470
+ order_id: number | null;
4471
+ rating_star: number | null;
4472
+ comment: string | null;
4473
+ author_username: string | null;
4474
+ author_shopid: number | null;
4475
+ author_portrait: string | null;
4476
+ anonymous: boolean | null;
4477
+ images: string[];
4478
+ videos: Record<string, unknown>[];
4479
+ product_variation: string | null;
4480
+ like_count: number | null;
4481
+ reply: ReviewReply | null;
4482
+ ctime_utc: number | null;
4483
+ created_at: string | null;
4484
+ editable: number | null;
4485
+ is_hidden: boolean | null;
4486
+ }
4487
+ /**
4488
+ * Aggregate rating summary returned alongside reviews.
4489
+ */
4490
+ interface ReviewSummary {
4491
+ rating_star: number | null;
4492
+ rating_total: number | null;
4493
+ /** Array of counts per star level */
4494
+ rating_count: number[];
4495
+ rcount_with_media: number | null;
4496
+ rcount_with_context: number | null;
4497
+ }
4498
+ /**
4499
+ * A page of reviews for a product.
4500
+ */
4501
+ interface ReviewsResult {
4502
+ market: string;
4503
+ item_id: number;
4504
+ shop_id: number;
4505
+ offset: number;
4506
+ limit: number;
4507
+ has_more: boolean;
4508
+ next_offset: number | null;
4509
+ summary: ReviewSummary | null;
4510
+ reviews: ShopeeReview[];
4511
+ }
4512
+ /**
4513
+ * A node in the Shopee category tree.
4514
+ */
4515
+ interface CategoryNode {
4516
+ category_id: number;
4517
+ parent_id: number | null;
4518
+ name: string | null;
4519
+ display_name: string | null;
4520
+ image: string | null;
4521
+ no_sub: boolean | null;
4522
+ block_buyer_platform: number[];
4523
+ children: CategoryNode[];
4524
+ }
4525
+ /**
4526
+ * The full category tree for a market.
4527
+ */
4528
+ interface CategoryTree {
4529
+ market: string;
4530
+ categories: CategoryNode[];
4531
+ }
4532
+ /**
4533
+ * A single supported Shopee marketplace.
4534
+ */
4535
+ interface ShopeeMarket {
4536
+ /** Market code (e.g. "sg", "my", "ph") */
4537
+ code: string;
4538
+ /** Shopee domain (e.g. "shopee.sg") */
4539
+ domain: string;
4540
+ /** Country name */
4541
+ country: string;
4542
+ /** Currency code (e.g. "SGD") */
4543
+ currency: string;
4544
+ /** Locale (e.g. "en") */
4545
+ locale: string;
4546
+ /** Market display name */
4547
+ name: string;
4548
+ }
4549
+ /**
4550
+ * Response from the /v1/shopee/markets endpoint.
4551
+ */
4552
+ interface MarketsResponse {
4553
+ markets: ShopeeMarket[];
4554
+ }
4555
+ /** Parameters for searching Shopee products. */
4556
+ interface ShopeeSearchParams {
4557
+ /** Search keyword string */
4558
+ keyword: string;
4559
+ /** Shopee market code (default: "sg") */
4560
+ market?: string;
4561
+ /** Maximum number of results (default: 60) */
4562
+ limit?: number;
4563
+ /** Pagination offset (default: 0) */
4564
+ offset?: number;
4565
+ /** Sort order (default: "relevancy") */
4566
+ sort_by?: "relevancy" | "ctime" | "sales" | "price_low_to_high" | "price_high_to_low";
4567
+ }
4568
+ /** Parameters for category-items listing. */
4569
+ interface ShopeeCategoryItemsParams {
4570
+ /** Shopee market code (default: "sg") */
4571
+ market?: string;
4572
+ /** Maximum number of results (default: 60) */
4573
+ limit?: number;
4574
+ /** Pagination offset (default: 0) */
4575
+ offset?: number;
4576
+ /** Sort order (default: "relevancy") */
4577
+ sort_by?: "relevancy" | "ctime" | "sales" | "price_low_to_high" | "price_high_to_low";
4578
+ }
4579
+ /** Options for fetching product detail. */
4580
+ interface ShopeeProductParams {
4581
+ /** Shopee market code (default: "sg") */
4582
+ market?: string;
4583
+ }
4584
+ /** Options for fetching product reviews. */
4585
+ interface ShopeeReviewsParams {
4586
+ /** Shopee market code (default: "sg") */
4587
+ market?: string;
4588
+ /** Maximum number of reviews (default: 20) */
4589
+ limit?: number;
4590
+ /** Pagination offset (default: 0) */
4591
+ offset?: number;
4592
+ /** Star filter — 0=all, 1-5 for a specific star count (default: 0) */
4593
+ rating?: number;
4594
+ /** Content filter — 0=all, 1=comment, 2=media, 3=local (default: 0) */
4595
+ filter?: number;
4596
+ }
4597
+ /** Options for fetching the category tree. */
4598
+ interface ShopeeCategoriesParams {
4599
+ /** Shopee market code (default: "sg") */
4600
+ market?: string;
4601
+ }
4602
+
4603
+ /**
4604
+ * Shopee Search API client.
4605
+ *
4606
+ * Provides methods for keyword search and category-item listing.
4607
+ */
4608
+
4609
+ /**
4610
+ * Client for Shopee search and category-items endpoints.
4611
+ *
4612
+ * @example
4613
+ * ```typescript
4614
+ * const client = new ScrapeBadger({ apiKey: "key" });
4615
+ *
4616
+ * const results = await client.shopee.search.search({
4617
+ * keyword: "wireless headphones",
4618
+ * market: "sg",
4619
+ * });
4620
+ * for (const item of results.items) {
4621
+ * console.log(`${item.name}: ${item.price} ${item.currency}`);
4622
+ * }
4623
+ *
4624
+ * const cat = await client.shopee.search.categoryItems(100001, { market: "sg" });
4625
+ * ```
4626
+ */
4627
+ declare class SearchClient$1 {
4628
+ private readonly client;
4629
+ constructor(client: BaseClient);
4630
+ /**
4631
+ * Search Shopee for products by keyword.
4632
+ *
4633
+ * @param params - Search parameters including keyword, market, pagination, and sort.
4634
+ * @returns Search result page with matched products and pagination metadata.
4635
+ * @throws AuthenticationError - If the API key is invalid.
4636
+ * @throws ValidationError - If the parameters are invalid.
4637
+ */
4638
+ search(params: ShopeeSearchParams): Promise<SearchResult>;
4639
+ /**
4640
+ * List products within a specific Shopee category.
4641
+ *
4642
+ * @param categoryId - The Shopee category ID.
4643
+ * @param options - Optional parameters (market, limit, offset, sort_by).
4644
+ * @returns Search result page with products in the category.
4645
+ * @throws AuthenticationError - If the API key is invalid.
4646
+ * @throws ValidationError - If the category ID or market is invalid.
4647
+ */
4648
+ categoryItems(categoryId: number, options?: ShopeeCategoryItemsParams): Promise<SearchResult>;
4649
+ }
4650
+
4651
+ /**
4652
+ * Shopee Products API client.
4653
+ *
4654
+ * Provides methods for fetching full product detail pages (PDP).
4655
+ */
4656
+
4657
+ /**
4658
+ * Client for the Shopee product detail endpoint.
4659
+ *
4660
+ * @example
4661
+ * ```typescript
4662
+ * const client = new ScrapeBadger({ apiKey: "key" });
4663
+ *
4664
+ * const product = await client.shopee.products.get(12345, 67890, { market: "sg" });
4665
+ * console.log(`${product.name}: ${product.price} ${product.currency}`);
4666
+ *
4667
+ * for (const model of product.models) {
4668
+ * console.log(` Variant: ${model.name} — ${model.price}`);
4669
+ * }
4670
+ * ```
4671
+ */
4672
+ declare class ProductsClient {
4673
+ private readonly client;
4674
+ constructor(client: BaseClient);
4675
+ /**
4676
+ * Get full product detail (PDP) for a Shopee item.
4677
+ *
4678
+ * @param shopId - The Shopee shop identifier.
4679
+ * @param itemId - The Shopee item identifier.
4680
+ * @param options - Optional parameters (market).
4681
+ * @returns Full product detail including pricing, ratings, images, and variations.
4682
+ * @throws NotFoundError - If the product doesn't exist.
4683
+ * @throws AuthenticationError - If the API key is invalid.
4684
+ * @throws ValidationError - If the market code is invalid.
4685
+ */
4686
+ get(shopId: number, itemId: number, options?: ShopeeProductParams): Promise<ShopeeProduct>;
4687
+ }
4688
+
4689
+ /**
4690
+ * Shopee Reviews API client.
4691
+ *
4692
+ * Provides methods for fetching product reviews and rating summaries.
4693
+ */
4694
+
4695
+ /**
4696
+ * Client for the Shopee product reviews endpoint.
4697
+ *
4698
+ * @example
4699
+ * ```typescript
4700
+ * const client = new ScrapeBadger({ apiKey: "key" });
4701
+ *
4702
+ * const reviews = await client.shopee.reviews.get(12345, 67890, { market: "sg" });
4703
+ * console.log(`${reviews.summary?.rating_total} reviews`);
4704
+ * for (const review of reviews.reviews) {
4705
+ * console.log(`${review.author_username}: ${review.rating_star}* ${review.comment}`);
4706
+ * }
4707
+ * ```
4708
+ */
4709
+ declare class ReviewsClient {
4710
+ private readonly client;
4711
+ constructor(client: BaseClient);
4712
+ /**
4713
+ * Get product reviews for a Shopee item.
4714
+ *
4715
+ * @param shopId - The Shopee shop identifier.
4716
+ * @param itemId - The Shopee item identifier.
4717
+ * @param options - Optional parameters (market, limit, offset, rating, filter).
4718
+ * @returns Reviews result page with review items and aggregate summary.
4719
+ * @throws NotFoundError - If the product doesn't exist.
4720
+ * @throws AuthenticationError - If the API key is invalid.
4721
+ * @throws ValidationError - If the parameters are invalid.
4722
+ */
4723
+ get(shopId: number, itemId: number, options?: ShopeeReviewsParams): Promise<ReviewsResult>;
4724
+ }
4725
+
4726
+ /**
4727
+ * Shopee Reference Data API client.
4728
+ *
4729
+ * Provides methods for fetching the static category tree and markets list.
4730
+ */
4731
+
4732
+ /**
4733
+ * Client for Shopee reference data endpoints (markets, categories).
4734
+ *
4735
+ * @example
4736
+ * ```typescript
4737
+ * const client = new ScrapeBadger({ apiKey: "key" });
4738
+ *
4739
+ * const markets = await client.shopee.reference.markets();
4740
+ * for (const m of markets.markets) {
4741
+ * console.log(`${m.code}: ${m.domain} (${m.currency})`);
4742
+ * }
4743
+ *
4744
+ * const tree = await client.shopee.reference.categories({ market: "sg" });
4745
+ * for (const cat of tree.categories) {
4746
+ * console.log(`${cat.category_id}: ${cat.display_name}`);
4747
+ * }
4748
+ * ```
4749
+ */
4750
+ declare class ReferenceClient$1 {
4751
+ private readonly client;
4752
+ constructor(client: BaseClient);
4753
+ /**
4754
+ * Get all supported Shopee marketplaces.
4755
+ *
4756
+ * @returns Markets response with all supported Shopee markets (0 credits).
4757
+ */
4758
+ markets(): Promise<MarketsResponse>;
4759
+ /**
4760
+ * Get the full category tree for a Shopee market.
4761
+ *
4762
+ * @param options - Optional parameters (market).
4763
+ * @returns Category tree with all top-level and nested category nodes.
4764
+ * @throws AuthenticationError - If the API key is invalid.
4765
+ * @throws ValidationError - If the market code is invalid.
4766
+ */
4767
+ categories(options?: ShopeeCategoriesParams): Promise<CategoryTree>;
4768
+ }
4769
+
4770
+ /**
4771
+ * Shopee API client.
4772
+ *
4773
+ * Provides access to all Shopee API endpoints through specialized sub-clients.
4774
+ */
4775
+
4776
+ /**
4777
+ * Shopee API client with access to all Shopee endpoints.
4778
+ *
4779
+ * Provides sub-clients for different resource types:
4780
+ * - `search` - Keyword search and category-item listing
4781
+ * - `products` - Full product detail pages (PDP)
4782
+ * - `reviews` - Product reviews and rating summaries
4783
+ * - `reference` - Reference data (markets, category tree)
4784
+ *
4785
+ * Supported markets: id, ph, vn, br, my, th, sg, tw, co, cl, mx.
4786
+ *
4787
+ * @example
4788
+ * ```typescript
4789
+ * const client = new ScrapeBadger({ apiKey: "key" });
4790
+ *
4791
+ * // Search products
4792
+ * const results = await client.shopee.search.search({
4793
+ * keyword: "wireless headphones",
4794
+ * market: "sg",
4795
+ * });
4796
+ *
4797
+ * // Get product detail
4798
+ * const product = await client.shopee.products.get(12345, 67890, { market: "sg" });
4799
+ *
4800
+ * // Get reviews
4801
+ * const reviews = await client.shopee.reviews.get(12345, 67890, { rating: 5 });
4802
+ *
4803
+ * // Get reference data
4804
+ * const markets = await client.shopee.reference.markets();
4805
+ * const tree = await client.shopee.reference.categories({ market: "sg" });
4806
+ * ```
4807
+ */
4808
+ declare class ShopeeClient {
4809
+ /** Client for keyword search and category-item listing */
4810
+ readonly search: SearchClient$1;
4811
+ /** Client for full product detail pages */
4812
+ readonly products: ProductsClient;
4813
+ /** Client for product reviews and rating summaries */
4814
+ readonly reviews: ReviewsClient;
4815
+ /** Client for reference data (markets, category tree) */
4816
+ readonly reference: ReferenceClient$1;
4817
+ /**
4818
+ * Create a new Shopee client.
4819
+ *
4820
+ * @param client - The base HTTP client for making requests.
4821
+ */
4822
+ constructor(client: BaseClient);
4823
+ }
4824
+
4825
+ /**
4826
+ * TypeScript types for TikTok API responses.
4827
+ *
4828
+ * These interfaces mirror the backend `tiktok_scraper` response schema
4829
+ * field-for-field. Optional / nullable backend fields are typed as
4830
+ * `Type | null`; backend list fields default to `[]` and are typed as arrays.
4831
+ * Every datetime field ships in BOTH `*_utc` (number) and `*_at` (string) form.
4832
+ */
4833
+ /**
4834
+ * Author summary embedded in a video, comment, or search result.
4835
+ */
4836
+ interface TikTokAuthor {
4837
+ id: string;
4838
+ sec_uid?: string | null;
4839
+ /** @handle */
4840
+ unique_id: string;
4841
+ nickname?: string | null;
4842
+ avatar_thumb?: string | null;
4843
+ avatar_medium?: string | null;
4844
+ avatar_larger?: string | null;
4845
+ /** bio */
4846
+ signature?: string | null;
4847
+ verified: boolean;
4848
+ private_account?: boolean | null;
4849
+ follower_count?: number | null;
4850
+ following_count?: number | null;
4851
+ /** total likes received */
4852
+ heart_count?: number | null;
4853
+ video_count?: number | null;
4854
+ /** likes given */
4855
+ digg_count?: number | null;
4856
+ region?: string | null;
4857
+ sec_uid_present: boolean;
4858
+ short_id?: string | null;
4859
+ /** custom_verify / enterprise_verify_reason text */
4860
+ verify_reason?: string | null;
4861
+ verification_type?: number | null;
4862
+ account_region?: string | null;
4863
+ language?: string | null;
4864
+ original_musician?: boolean | null;
4865
+ /** featured / star creator */
4866
+ is_star?: boolean | null;
4867
+ ins_id?: string | null;
4868
+ twitter_name?: string | null;
4869
+ youtube_channel_title?: string | null;
4870
+ /** non-empty when live */
4871
+ room_id?: string | null;
4872
+ commerce_user_level?: number | null;
4873
+ with_shop_entry?: boolean | null;
4874
+ }
4875
+ /**
4876
+ * Engagement statistics for a video.
4877
+ */
4878
+ interface TikTokStats {
4879
+ /** views */
4880
+ play_count: number;
4881
+ /** likes */
4882
+ digg_count: number;
4883
+ comment_count: number;
4884
+ share_count: number;
4885
+ /** saves / bookmarks */
4886
+ collect_count: number;
4887
+ download_count?: number | null;
4888
+ forward_count?: number | null;
4889
+ whatsapp_share_count?: number | null;
4890
+ repost_count?: number | null;
4891
+ }
4892
+ /**
4893
+ * Playable-media metadata for a video.
4894
+ */
4895
+ interface TikTokVideoMeta {
4896
+ height?: number | null;
4897
+ width?: number | null;
4898
+ /** seconds */
4899
+ duration?: number | null;
4900
+ ratio?: string | null;
4901
+ format?: string | null;
4902
+ definition?: string | null;
4903
+ codec_type?: string | null;
4904
+ encoded_type?: string | null;
4905
+ bitrate?: number | null;
4906
+ cover?: string | null;
4907
+ origin_cover?: string | null;
4908
+ dynamic_cover?: string | null;
4909
+ animated_cover?: string | null;
4910
+ ai_dynamic_cover?: string | null;
4911
+ share_cover?: string | null;
4912
+ /** direct play URL */
4913
+ play_addr?: string | null;
4914
+ /** direct download URL (watermarked) */
4915
+ download_addr?: string | null;
4916
+ /** clean MP4 */
4917
+ download_no_watermark_addr?: string | null;
4918
+ has_watermark?: boolean | null;
4919
+ volume_loudness?: number | null;
4920
+ volume_peak?: number | null;
4921
+ }
4922
+ /**
4923
+ * Sound / music attached to a video, or a standalone music entity.
4924
+ */
4925
+ interface TikTokMusic {
4926
+ id: string;
4927
+ title?: string | null;
4928
+ author_name?: string | null;
4929
+ album?: string | null;
4930
+ /** seconds */
4931
+ duration?: number | null;
4932
+ play_url?: string | null;
4933
+ cover_thumb?: string | null;
4934
+ cover_medium?: string | null;
4935
+ cover_large?: string | null;
4936
+ original?: boolean | null;
4937
+ is_copyrighted?: boolean | null;
4938
+ mid?: string | null;
4939
+ owner_id?: string | null;
4940
+ owner_nickname?: string | null;
4941
+ is_commerce_music?: boolean | null;
4942
+ is_original_sound?: boolean | null;
4943
+ /** Present only on standalone music endpoints */
4944
+ video_count?: number | null;
4945
+ user_count?: number | null;
4946
+ }
4947
+ /**
4948
+ * A hashtag/challenge as referenced from a video.
4949
+ */
4950
+ interface TikTokChallenge {
4951
+ id: string;
4952
+ /** hashtag text, no '#' */
4953
+ title: string;
4954
+ desc?: string | null;
4955
+ cover?: string | null;
4956
+ is_commerce?: boolean | null;
4957
+ }
4958
+ /**
4959
+ * An effect / sticker applied to a video.
4960
+ */
4961
+ interface TikTokEffectSticker {
4962
+ id: string;
4963
+ name?: string | null;
4964
+ photo_url?: string | null;
4965
+ }
4966
+ /**
4967
+ * An entity (hashtag mention or @user mention) inside the caption.
4968
+ */
4969
+ interface TikTokTextExtra {
4970
+ /** "hashtag" | "mention" */
4971
+ type?: string | null;
4972
+ hashtag_name?: string | null;
4973
+ user_unique_id?: string | null;
4974
+ user_id?: string | null;
4975
+ start?: number | null;
4976
+ end?: number | null;
4977
+ }
4978
+ /**
4979
+ * A subtitle/caption track for a video.
4980
+ */
4981
+ interface TikTokSubtitle {
4982
+ language?: string | null;
4983
+ language_code?: string | null;
4984
+ url?: string | null;
4985
+ /** ASR vs creator */
4986
+ source?: string | null;
4987
+ version?: string | null;
4988
+ format?: string | null;
4989
+ }
4990
+ /**
4991
+ * Moderation / availability state of a post (mobile aweme `status` block).
4992
+ */
4993
+ interface TikTokVideoStatus {
4994
+ is_delete?: boolean | null;
4995
+ allow_share?: boolean | null;
4996
+ allow_comment?: boolean | null;
4997
+ /** 0 public, 1 friends, 2 private */
4998
+ private_status?: number | null;
4999
+ in_reviewing?: boolean | null;
5000
+ reviewed?: boolean | null;
5001
+ is_prohibited?: boolean | null;
5002
+ download_status?: number | null;
5003
+ self_see?: boolean | null;
5004
+ }
5005
+ /**
5006
+ * Per-post interaction permissions (mobile aweme `video_control` block).
5007
+ */
5008
+ interface TikTokVideoControl {
5009
+ allow_download?: boolean | null;
5010
+ allow_duet?: boolean | null;
5011
+ allow_stitch?: boolean | null;
5012
+ allow_react?: boolean | null;
5013
+ allow_comment?: boolean | null;
5014
+ share_type?: number | null;
5015
+ prevent_download?: boolean | null;
5016
+ }
5017
+ /**
5018
+ * A link/shopping/POI anchor attached to a post.
5019
+ */
5020
+ interface TikTokAnchor {
5021
+ id?: string | null;
5022
+ type?: number | null;
5023
+ keyword?: string | null;
5024
+ url?: string | null;
5025
+ icon?: string | null;
5026
+ }
5027
+ /**
5028
+ * A TikTok post (video or photo slideshow) with full metadata.
5029
+ */
5030
+ interface TikTokVideo {
5031
+ id: string;
5032
+ /** caption text */
5033
+ description: string;
5034
+ text_language?: string | null;
5035
+ create_time_utc?: number | null;
5036
+ create_time_at?: string | null;
5037
+ /** locationCreated */
5038
+ region?: string | null;
5039
+ /** web video URL */
5040
+ url: string;
5041
+ /** canonical share link (mobile share_url) */
5042
+ share_url?: string | null;
5043
+ group_id?: string | null;
5044
+ /** 0 video, 150 photo/slideshow, … */
5045
+ aweme_type?: number | null;
5046
+ /** mobile content_type label */
5047
+ content_type?: string | null;
5048
+ author?: TikTokAuthor | null;
5049
+ music?: TikTokMusic | null;
5050
+ stats: TikTokStats;
5051
+ video?: TikTokVideoMeta | null;
5052
+ status?: TikTokVideoStatus | null;
5053
+ video_control?: TikTokVideoControl | null;
5054
+ anchors: TikTokAnchor[];
5055
+ hashtags: string[];
5056
+ mentions: string[];
5057
+ text_extra: TikTokTextExtra[];
5058
+ challenges: TikTokChallenge[];
5059
+ effect_stickers: TikTokEffectSticker[];
5060
+ is_slideshow: boolean;
5061
+ image_urls: string[];
5062
+ is_ad: boolean;
5063
+ is_aigc?: boolean | null;
5064
+ aigc_description?: string | null;
5065
+ is_pinned: boolean;
5066
+ is_muted?: boolean | null;
5067
+ secret?: boolean | null;
5068
+ private_item?: boolean | null;
5069
+ duet_enabled?: boolean | null;
5070
+ stitch_enabled?: boolean | null;
5071
+ share_enabled?: boolean | null;
5072
+ comment_status?: string | null;
5073
+ can_repost?: boolean | null;
5074
+ is_paid_content?: boolean | null;
5075
+ is_on_this_day?: boolean | null;
5076
+ /** supports bullet comments */
5077
+ support_danmaku?: boolean | null;
5078
+ subtitles: TikTokSubtitle[];
5079
+ voice_to_text?: string | null;
5080
+ diversification_labels: string[];
5081
+ suggested_words: string[];
5082
+ }
5083
+ /**
5084
+ * Aggregate counts for a user profile.
5085
+ */
5086
+ interface TikTokUserStats {
5087
+ follower_count: number;
5088
+ following_count: number;
5089
+ /** total likes received */
5090
+ heart_count: number;
5091
+ video_count: number;
5092
+ /** likes given */
5093
+ digg_count: number;
5094
+ friend_count?: number | null;
5095
+ }
5096
+ /**
5097
+ * A full TikTok user profile.
5098
+ */
5099
+ interface TikTokUser {
5100
+ id: string;
5101
+ /** needed to call list endpoints */
5102
+ sec_uid: string;
5103
+ /** @handle */
5104
+ unique_id: string;
5105
+ nickname?: string | null;
5106
+ /** bio */
5107
+ signature?: string | null;
5108
+ bio_link?: string | null;
5109
+ verified: boolean;
5110
+ /** enterprise_verify_reason / custom_verify text */
5111
+ verify_reason?: string | null;
5112
+ verification_type?: number | null;
5113
+ private_account: boolean;
5114
+ is_commerce_account?: boolean | null;
5115
+ /** TikTok Shop seller */
5116
+ is_seller?: boolean | null;
5117
+ is_organization?: boolean | null;
5118
+ original_musician?: boolean | null;
5119
+ is_star?: boolean | null;
5120
+ region?: string | null;
5121
+ language?: string | null;
5122
+ ins_id?: string | null;
5123
+ twitter_name?: string | null;
5124
+ youtube_channel_title?: string | null;
5125
+ avatar_thumb?: string | null;
5126
+ avatar_medium?: string | null;
5127
+ avatar_larger?: string | null;
5128
+ stats: TikTokUserStats;
5129
+ open_favorite?: boolean | null;
5130
+ comment_setting?: number | null;
5131
+ duet_setting?: number | null;
5132
+ stitch_setting?: number | null;
5133
+ download_setting?: number | null;
5134
+ following_visibility?: number | null;
5135
+ is_live?: boolean | null;
5136
+ room_id?: string | null;
5137
+ commerce_category?: string | null;
5138
+ commerce_user_level?: number | null;
5139
+ with_shop_entry?: boolean | null;
5140
+ create_time_utc?: number | null;
5141
+ create_time_at?: string | null;
5142
+ profile_url: string;
5143
+ }
5144
+ /**
5145
+ * A comment (or reply) on a video.
5146
+ */
5147
+ interface TikTokComment {
5148
+ /** cid */
5149
+ id: string;
5150
+ text: string;
5151
+ /** parent video id */
5152
+ aweme_id?: string | null;
5153
+ parent_comment_id?: string | null;
5154
+ digg_count: number;
5155
+ reply_count: number;
5156
+ create_time_utc?: number | null;
5157
+ create_time_at?: string | null;
5158
+ liked_by_author?: boolean | null;
5159
+ pinned_by_author?: boolean | null;
5160
+ comment_language?: string | null;
5161
+ status?: number | null;
5162
+ /** @users in the comment */
5163
+ mentions: string[];
5164
+ text_extra: TikTokTextExtra[];
5165
+ /** comment sticker/images */
5166
+ image_urls: string[];
5167
+ author?: TikTokAuthor | null;
5168
+ replies: TikTokComment[];
5169
+ }
5170
+ /**
5171
+ * A hashtag / challenge detail.
5172
+ */
5173
+ interface TikTokHashtag {
5174
+ id: string;
5175
+ /** name without '#' */
5176
+ title: string;
5177
+ description?: string | null;
5178
+ cover?: string | null;
5179
+ profile_larger?: string | null;
5180
+ video_count?: number | null;
5181
+ view_count?: number | null;
5182
+ is_commerce?: boolean | null;
5183
+ url: string;
5184
+ }
5185
+ interface TikTokTrendingHashtag {
5186
+ name: string;
5187
+ id?: string | null;
5188
+ rank?: number | null;
5189
+ rank_diff?: number | null;
5190
+ country_code?: string | null;
5191
+ industry?: string | null;
5192
+ /** videos using it */
5193
+ publish_count?: number | null;
5194
+ view_count?: number | null;
5195
+ /** distinct creators using it (mobile source) */
5196
+ user_count?: number | null;
5197
+ is_promoted?: boolean | null;
5198
+ is_new?: boolean | null;
5199
+ url?: string | null;
5200
+ }
5201
+ interface TikTokTrendingSong {
5202
+ title: string;
5203
+ id?: string | null;
5204
+ author?: string | null;
5205
+ rank?: number | null;
5206
+ rank_diff?: number | null;
5207
+ country_code?: string | null;
5208
+ duration?: number | null;
5209
+ /** videos using this sound (mobile trending metric) */
5210
+ user_count?: number | null;
5211
+ cover?: string | null;
5212
+ play_url?: string | null;
5213
+ is_new?: boolean | null;
5214
+ link?: string | null;
5215
+ }
5216
+ interface TikTokOEmbed {
5217
+ version: string;
5218
+ type: string;
5219
+ title?: string | null;
5220
+ author_name?: string | null;
5221
+ author_url?: string | null;
5222
+ provider_name: string;
5223
+ provider_url: string;
5224
+ html?: string | null;
5225
+ thumbnail_url?: string | null;
5226
+ thumbnail_width?: number | null;
5227
+ thumbnail_height?: number | null;
5228
+ embed_product_id?: string | null;
5229
+ embed_type?: string | null;
5230
+ }
5231
+ /**
5232
+ * Cursor pagination metadata shared by all list endpoints.
5233
+ */
5234
+ interface TikTokCursorPage {
5235
+ has_more: boolean;
5236
+ /** opaque; pass back as ?cursor= */
5237
+ cursor?: string | null;
5238
+ /** number of items in THIS page */
5239
+ count: number;
5240
+ /** search endpoints chain rid → search_id */
5241
+ search_id?: string | null;
5242
+ }
5243
+ /** Response from the /users/{username} endpoint. */
5244
+ interface ProfileResponse {
5245
+ user: TikTokUser;
5246
+ region: string;
5247
+ }
5248
+ /** Response from the /videos/{video_id} endpoint. */
5249
+ interface VideoResponse {
5250
+ video: TikTokVideo;
5251
+ region: string;
5252
+ }
5253
+ /** Response wrapping a cursor-paginated list of videos. */
5254
+ interface VideoListResponse {
5255
+ videos: TikTokVideo[];
5256
+ pagination: TikTokCursorPage;
5257
+ region: string;
5258
+ }
5259
+ /** Response from the /videos/{video_id}/comments endpoint. */
5260
+ interface CommentListResponse {
5261
+ comments: TikTokComment[];
5262
+ pagination: TikTokCursorPage;
5263
+ region: string;
5264
+ }
5265
+ /** Followers / following lists. */
5266
+ interface UserListResponse {
5267
+ users: TikTokAuthor[];
5268
+ pagination: TikTokCursorPage;
5269
+ region: string;
5270
+ }
5271
+ /** Response from the /hashtags/{name} endpoint. */
5272
+ interface HashtagResponse {
5273
+ hashtag: TikTokHashtag;
5274
+ region: string;
5275
+ }
5276
+ /** Response from the /music/{music_id} endpoint. */
5277
+ interface MusicResponse {
5278
+ music: TikTokMusic;
5279
+ region: string;
5280
+ }
5281
+ /** Response from the /search/users endpoint. */
5282
+ interface UserSearchResponse {
5283
+ users: TikTokAuthor[];
5284
+ pagination: TikTokCursorPage;
5285
+ region: string;
5286
+ }
5287
+ /** Response from the /search/hashtags endpoint. */
5288
+ interface HashtagSearchResponse {
5289
+ hashtags: TikTokHashtag[];
5290
+ pagination: TikTokCursorPage;
5291
+ region: string;
5292
+ }
5293
+ /** Response from the /videos/{video_id}/transcript endpoint. */
5294
+ interface TranscriptResponse {
5295
+ video_id: string;
5296
+ subtitles: TikTokSubtitle[];
5297
+ voice_to_text?: string | null;
5298
+ region: string;
5299
+ }
5300
+ /** Response from the /trending/hashtags endpoint. */
5301
+ interface TrendingHashtagsResponse {
5302
+ hashtags: TikTokTrendingHashtag[];
5303
+ region: string;
5304
+ }
5305
+ /** Response from the /trending/songs endpoint. */
5306
+ interface TrendingSongsResponse {
5307
+ songs: TikTokTrendingSong[];
5308
+ region: string;
5309
+ }
5310
+ interface TikTokAdVideo {
5311
+ video_url?: string | null;
5312
+ cover_img?: string | null;
5313
+ }
5314
+ interface TikTokAd {
5315
+ id: string;
5316
+ /** advertiser name */
5317
+ name?: string | null;
5318
+ audit_status?: string | null;
5319
+ type?: string | null;
5320
+ /** epoch ms */
5321
+ first_shown_date?: number | null;
5322
+ /** epoch ms */
5323
+ last_shown_date?: number | null;
5324
+ videos: TikTokAdVideo[];
5325
+ }
5326
+ interface AdLibraryPage {
5327
+ has_more: boolean;
5328
+ total?: number | null;
5329
+ /** pass to the next page request */
5330
+ search_id?: string | null;
5331
+ offset: number;
5332
+ }
5333
+ /** Response from the /ads/search endpoint. */
5334
+ interface AdLibrarySearchResponse {
5335
+ ads: TikTokAd[];
5336
+ pagination: AdLibraryPage;
5337
+ region: string;
5338
+ }
5339
+ interface RegionInfo {
5340
+ code: string;
5341
+ country_code: string;
5342
+ locale: string;
5343
+ name: string;
5344
+ }
5345
+ /** Response from the /regions endpoint. */
5346
+ interface RegionsResponse {
5347
+ regions: RegionInfo[];
5348
+ }
5349
+ /** Options for the user profile endpoint. */
5350
+ interface TikTokUserParams {
5351
+ /** Content region (ISO 3166-1 alpha-2, default "US") */
5352
+ region?: string;
5353
+ }
5354
+ /** Options for cursor-paginated user list endpoints (videos/followers/following/liked/reposts). */
5355
+ interface TikTokUserListParams {
5356
+ /** Content region (ISO 3166-1 alpha-2, default "US") */
5357
+ region?: string;
5358
+ /** Number of items to return (1-50) */
5359
+ count?: number;
5360
+ /**
5361
+ * Opaque cursor from a previous page.
5362
+ * Only accepted by: user videos, followers, following.
5363
+ * Reposts and liked ignore this param — remove before sending.
5364
+ */
5365
+ cursor?: string;
5366
+ }
5367
+ /** Options for the video detail endpoint. */
5368
+ interface TikTokVideoParams {
5369
+ /** Content region (ISO 3166-1 alpha-2, default "US") */
5370
+ region?: string;
5371
+ /** Author handle (skips oEmbed lookup) */
5372
+ username?: string;
5373
+ }
5374
+ /** Options for the video comments endpoint. */
5375
+ interface TikTokCommentsParams {
5376
+ /** Content region (ISO 3166-1 alpha-2, default "US") */
5377
+ region?: string;
5378
+ /** Number of items to return (1-50) */
5379
+ count?: number;
5380
+ /**
5381
+ * Pagination cursor from a prior response's pagination.cursor; omit for the first page.
5382
+ */
5383
+ cursor?: string;
5384
+ }
5385
+ /** Options for the comment replies endpoint. */
5386
+ interface TikTokCommentRepliesParams {
5387
+ /** Parent video id (required) */
5388
+ videoId: string;
5389
+ /** Content region (ISO 3166-1 alpha-2, default "US") */
5390
+ region?: string;
5391
+ /** Number of items to return (1-50, default 20) */
5392
+ count?: number;
5393
+ /**
5394
+ * Pagination cursor from a prior response's pagination.cursor; omit for the first page.
5395
+ */
5396
+ cursor?: string;
5397
+ }
5398
+ /** Options for the related-videos endpoint. */
5399
+ interface TikTokRelatedParams {
5400
+ /** Content region (ISO 3166-1 alpha-2, default "US") */
5401
+ region?: string;
5402
+ /** Number of items to return (1-50) */
5403
+ count?: number;
5404
+ }
5405
+ /** Options for the transcript endpoint. */
5406
+ interface TikTokTranscriptParams {
5407
+ /** Content region (ISO 3166-1 alpha-2, default "US") */
5408
+ region?: string;
5409
+ }
5410
+ /** Options for the oEmbed endpoint. */
5411
+ interface TikTokOEmbedParams {
5412
+ /** Content region (ISO 3166-1 alpha-2, default "US") */
5413
+ region?: string;
5414
+ }
5415
+ /** Options for the hashtag detail endpoint. */
5416
+ interface TikTokHashtagParams {
5417
+ /** Content region (ISO 3166-1 alpha-2, default "US") */
5418
+ region?: string;
5419
+ }
5420
+ /** Options for hashtag/music video listings. */
5421
+ interface TikTokListVideosParams {
5422
+ /** Content region (ISO 3166-1 alpha-2, default "US") */
5423
+ region?: string;
5424
+ /** Number of items to return (1-50) */
5425
+ count?: number;
5426
+ /**
5427
+ * Pagination cursor from a prior response's pagination.cursor; omit for the first page.
5428
+ */
5429
+ cursor?: string;
5430
+ }
5431
+ /** Options for the music detail endpoint. */
5432
+ interface TikTokMusicParams {
5433
+ /** Content region (ISO 3166-1 alpha-2, default "US") */
5434
+ region?: string;
5435
+ }
5436
+ /** Options for the keyword search endpoints (general/videos/users/hashtags). */
5437
+ interface TikTokSearchParams {
5438
+ /** Search keyword (required) */
5439
+ query: string;
5440
+ /** Content region (ISO 3166-1 alpha-2, default "US") */
5441
+ region?: string;
5442
+ /** Number of items to return (1-50) */
5443
+ count?: number;
5444
+ /**
5445
+ * Pagination cursor from a prior response's pagination.cursor; omit for the first page.
5446
+ */
5447
+ cursor?: string;
5448
+ }
5449
+ /** Options for the trending videos endpoint. */
5450
+ interface TikTokTrendingVideosParams {
5451
+ /** Content region (ISO 3166-1 alpha-2, default "US") */
5452
+ region?: string;
5453
+ /** Number of items to return (1-50) */
5454
+ count?: number;
5455
+ }
5456
+ /** Options for the trending hashtags / songs endpoints. */
5457
+ interface TikTokTrendingParams {
5458
+ /** Content region (ISO 3166-1 alpha-2, default "US") */
5459
+ region?: string;
5460
+ /** Trailing window in days (default 7) */
5461
+ period?: number;
5462
+ /** Number of items to return (1-50) */
5463
+ count?: number;
5464
+ }
5465
+ /** Options for the Ad Library search endpoint. */
5466
+ interface TikTokAdSearchParams {
5467
+ /** Keyword (ignored when advertiserId is set) */
5468
+ query?: string;
5469
+ /** Advertiser business id(s) for advertiser search */
5470
+ advertiser_id?: string;
5471
+ /** EU region code (the Ad Library is EU-only, default "DE") */
5472
+ region?: string;
5473
+ /** Trailing window in days (1-365, default 30) */
5474
+ days?: number;
5475
+ /** Sort order (default "last_shown_date,desc") */
5476
+ sort?: string;
5477
+ /** Result offset for pagination */
5478
+ offset?: number;
5479
+ /** Opaque search id chained from a previous page */
5480
+ search_id?: string;
5481
+ /** Number of items to return (1-50) */
5482
+ count?: number;
5483
+ }
5484
+
5485
+ /**
5486
+ * TikTok Users API client.
5487
+ *
5488
+ * Provides methods for user profiles and their cursor-paginated lists
5489
+ * (videos, followers, following, liked, reposts).
5490
+ */
5491
+
5492
+ /**
5493
+ * Client for TikTok user endpoints (profile, videos, followers, following, liked, reposts).
5494
+ *
5495
+ * @example
5496
+ * ```typescript
5497
+ * const client = new ScrapeBadger({ apiKey: "key" });
5498
+ *
5499
+ * const profile = await client.tiktok.users.get("charlidamelio");
5500
+ * console.log(profile.user.stats.follower_count);
5501
+ *
5502
+ * const videos = await client.tiktok.users.videos("charlidamelio", { count: 30 });
5503
+ * ```
5504
+ */
5505
+ declare class UsersClient {
5506
+ private readonly client;
5507
+ constructor(client: BaseClient);
5508
+ /**
5509
+ * Get a TikTok user's full profile.
5510
+ *
5511
+ * @param username - The user's @handle (without the leading '@').
5512
+ * @param options - Optional parameters (region).
5513
+ * @returns The user profile response.
5514
+ * @throws NotFoundError - If the user doesn't exist.
5515
+ */
5516
+ get(username: string, options?: TikTokUserParams): Promise<ProfileResponse>;
5517
+ /**
5518
+ * Get a TikTok user's posted videos.
5519
+ *
5520
+ * @param username - The user's @handle.
5521
+ * @param options - Optional parameters (region, count, cursor).
5522
+ * @returns A cursor-paginated list of videos.
5523
+ */
5524
+ videos(username: string, options?: TikTokUserListParams): Promise<VideoListResponse>;
5525
+ /**
5526
+ * Get a TikTok user's followers (best-effort; often guest-gated).
5527
+ *
5528
+ * @deprecated Requires an authenticated session; currently returns 410.
5529
+ * Kept for forward-compatibility — the endpoint may be re-enabled when
5530
+ * session-based access is supported.
5531
+ *
5532
+ * @param username - The user's @handle.
5533
+ * @param options - Optional parameters (region, count, cursor).
5534
+ * @returns A cursor-paginated list of follower authors.
5535
+ */
5536
+ followers(username: string, options?: TikTokUserListParams): Promise<UserListResponse>;
5537
+ /**
5538
+ * Get accounts a TikTok user follows (best-effort).
5539
+ *
5540
+ * @deprecated Requires an authenticated session; currently returns 410.
5541
+ * Kept for forward-compatibility — the endpoint may be re-enabled when
5542
+ * session-based access is supported.
5543
+ *
5544
+ * @param username - The user's @handle.
5545
+ * @param options - Optional parameters (region, count, cursor).
5546
+ * @returns A cursor-paginated list of followed authors.
5547
+ */
5548
+ following(username: string, options?: TikTokUserListParams): Promise<UserListResponse>;
5549
+ /**
5550
+ * Get a TikTok user's liked videos (only if their Liked tab is public).
5551
+ *
5552
+ * @deprecated Requires an authenticated session; currently returns 410.
5553
+ * Kept for forward-compatibility — the endpoint may be re-enabled when
5554
+ * session-based access is supported.
5555
+ *
5556
+ * @param username - The user's @handle.
5557
+ * @param options - Optional parameters (region, count).
5558
+ * @returns A cursor-paginated list of videos.
5559
+ */
5560
+ liked(username: string, options?: TikTokUserListParams): Promise<VideoListResponse>;
5561
+ /**
5562
+ * Get videos a TikTok user has reposted.
5563
+ *
5564
+ * @param username - The user's @handle.
5565
+ * @param options - Optional parameters (region, count).
5566
+ * @returns A cursor-paginated list of videos.
5567
+ */
5568
+ reposts(username: string, options?: TikTokUserListParams): Promise<VideoListResponse>;
5569
+ }
5570
+
5571
+ /**
5572
+ * TikTok Videos API client.
5573
+ *
5574
+ * Provides methods for video detail, comments, comment replies, related
5575
+ * videos, transcript, and oEmbed metadata.
5576
+ */
5577
+
5578
+ /**
5579
+ * Client for TikTok video endpoints (detail, comments, replies, related, transcript, oEmbed).
5580
+ *
5581
+ * @example
5582
+ * ```typescript
5583
+ * const client = new ScrapeBadger({ apiKey: "key" });
5584
+ *
5585
+ * const video = await client.tiktok.videos.get("7372...");
5586
+ * console.log(video.video.stats.play_count);
5587
+ *
5588
+ * const comments = await client.tiktok.videos.comments("7372...");
5589
+ * ```
5590
+ */
5591
+ declare class VideosClient {
5592
+ private readonly client;
5593
+ constructor(client: BaseClient);
5594
+ /**
5595
+ * Get full metadata for a single TikTok video/post.
5596
+ *
5597
+ * @param videoId - The video/post id.
5598
+ * @param options - Optional parameters (region, username).
5599
+ * @returns The video detail response.
5600
+ * @throws NotFoundError - If the video doesn't exist.
5601
+ */
5602
+ get(videoId: string, options?: TikTokVideoParams): Promise<VideoResponse>;
5603
+ /**
5604
+ * Get top-level comments on a TikTok video.
5605
+ *
5606
+ * @param videoId - The video/post id.
5607
+ * @param options - Optional parameters (region, count, cursor).
5608
+ * @returns A cursor-paginated list of comments.
5609
+ */
5610
+ comments(videoId: string, options?: TikTokCommentsParams): Promise<CommentListResponse>;
5611
+ /**
5612
+ * Get replies to a TikTok comment (best-effort).
5613
+ *
5614
+ * @param commentId - The comment id.
5615
+ * @param options - Parameters including the required `videoId` (region, count, cursor).
5616
+ * @returns A cursor-paginated list of reply comments.
5617
+ */
5618
+ commentReplies(commentId: string, options: TikTokCommentRepliesParams): Promise<CommentListResponse>;
5619
+ /**
5620
+ * Get TikTok's related videos for a given video.
5621
+ *
5622
+ * @param videoId - The video/post id.
5623
+ * @param options - Optional parameters (region, count).
5624
+ * @returns A cursor-paginated list of related videos.
5625
+ */
5626
+ related(videoId: string, options?: TikTokRelatedParams): Promise<VideoListResponse>;
5627
+ /**
5628
+ * Get subtitle/caption tracks for a TikTok video.
5629
+ *
5630
+ * @param videoId - The video/post id.
5631
+ * @param options - Optional parameters (region).
5632
+ * @returns The transcript response with subtitle tracks and voice-to-text.
5633
+ */
5634
+ transcript(videoId: string, options?: TikTokTranscriptParams): Promise<TranscriptResponse>;
5635
+ /**
5636
+ * Get cheap unauthenticated oEmbed metadata for a TikTok URL.
5637
+ *
5638
+ * @param url - Full TikTok video or profile URL.
5639
+ * @param options - Optional parameters (region).
5640
+ * @returns The oEmbed metadata.
5641
+ */
5642
+ oembed(url: string, options?: TikTokOEmbedParams): Promise<TikTokOEmbed>;
5643
+ }
5644
+
5645
+ /**
5646
+ * TikTok Search API client.
5647
+ *
5648
+ * Provides keyword search across videos, users, and hashtags.
5649
+ */
5650
+
5651
+ /**
5652
+ * Client for TikTok search endpoints (general, videos, users, hashtags).
5653
+ *
5654
+ * @example
5655
+ * ```typescript
5656
+ * const client = new ScrapeBadger({ apiKey: "key" });
5657
+ *
5658
+ * const top = await client.tiktok.search.search({ query: "skincare" });
5659
+ * const users = await client.tiktok.search.users({ query: "skincare" });
5660
+ * ```
5661
+ */
5662
+ declare class SearchClient {
5663
+ private readonly client;
5664
+ constructor(client: BaseClient);
5665
+ /**
5666
+ * General TikTok search — video results from the Top feed.
5667
+ *
5668
+ * @param params - Search parameters including query, region, count, cursor.
5669
+ * @returns A cursor-paginated list of videos.
5670
+ */
5671
+ search(params: TikTokSearchParams): Promise<VideoListResponse>;
5672
+ /**
5673
+ * Search TikTok videos by keyword.
5674
+ *
5675
+ * @param params - Search parameters including query, region, count, cursor.
5676
+ * @returns A cursor-paginated list of videos.
5677
+ */
5678
+ videos(params: TikTokSearchParams): Promise<VideoListResponse>;
5679
+ /**
5680
+ * Search TikTok users by keyword.
5681
+ *
5682
+ * @param params - Search parameters including query, region, count, cursor.
5683
+ * @returns A cursor-paginated list of matching users.
5684
+ */
5685
+ users(params: TikTokSearchParams): Promise<UserSearchResponse>;
5686
+ /**
5687
+ * Search TikTok hashtags by keyword.
5688
+ *
5689
+ * @param params - Search parameters including query, region, count, cursor.
5690
+ * @returns A cursor-paginated list of matching hashtags.
5691
+ */
5692
+ hashtags(params: TikTokSearchParams): Promise<HashtagSearchResponse>;
5693
+ }
5694
+
5695
+ /**
5696
+ * TikTok Music API client.
5697
+ *
5698
+ * Provides sound/music detail and the videos using a given sound.
5699
+ */
5700
+
5701
+ /**
5702
+ * Client for TikTok music endpoints (detail, videos).
5703
+ *
5704
+ * @example
5705
+ * ```typescript
5706
+ * const client = new ScrapeBadger({ apiKey: "key" });
5707
+ *
5708
+ * const music = await client.tiktok.music.get("6975...");
5709
+ * const videos = await client.tiktok.music.videos("6975...");
5710
+ * ```
5711
+ */
5712
+ declare class MusicClient {
5713
+ private readonly client;
5714
+ constructor(client: BaseClient);
5715
+ /**
5716
+ * Get TikTok sound/music detail.
5717
+ *
5718
+ * @param musicId - The sound/music id.
5719
+ * @param options - Optional parameters (region).
5720
+ * @returns The music detail response.
5721
+ * @throws NotFoundError - If the music doesn't exist.
5722
+ */
5723
+ get(musicId: string, options?: TikTokMusicParams): Promise<MusicResponse>;
5724
+ /**
5725
+ * Get videos using a given TikTok sound.
5726
+ *
5727
+ * @param musicId - The sound/music id.
5728
+ * @param options - Optional parameters (region, count, cursor).
5729
+ * @returns A cursor-paginated list of videos.
5730
+ */
5731
+ videos(musicId: string, options?: TikTokListVideosParams): Promise<VideoListResponse>;
5732
+ }
5733
+
5734
+ /**
5735
+ * TikTok Hashtags API client.
5736
+ *
5737
+ * Provides hashtag/challenge detail and the videos tagged with a hashtag.
5738
+ */
5739
+
5740
+ /**
5741
+ * Client for TikTok hashtag endpoints (detail, videos).
5742
+ *
5743
+ * @example
5744
+ * ```typescript
5745
+ * const client = new ScrapeBadger({ apiKey: "key" });
5746
+ *
5747
+ * const tag = await client.tiktok.hashtags.get("fyp");
5748
+ * const videos = await client.tiktok.hashtags.videos("fyp");
5749
+ * ```
5750
+ */
5751
+ declare class HashtagsClient {
5752
+ private readonly client;
5753
+ constructor(client: BaseClient);
5754
+ /**
5755
+ * Get TikTok hashtag/challenge detail.
5756
+ *
5757
+ * @param name - The hashtag name (without the leading '#').
5758
+ * @param options - Optional parameters (region).
5759
+ * @returns The hashtag detail response.
5760
+ * @throws NotFoundError - If the hashtag doesn't exist.
5761
+ */
5762
+ get(name: string, options?: TikTokHashtagParams): Promise<HashtagResponse>;
5763
+ /**
5764
+ * Get videos tagged with a TikTok hashtag.
5765
+ *
5766
+ * @param name - The hashtag name (without the leading '#').
5767
+ * @param options - Optional parameters (region, count, cursor).
5768
+ * @returns A cursor-paginated list of videos.
5769
+ */
5770
+ videos(name: string, options?: TikTokListVideosParams): Promise<VideoListResponse>;
5771
+ }
5772
+
5773
+ /**
5774
+ * TikTok Trending API client.
5775
+ *
5776
+ * Provides trending videos, hashtags, and songs.
5777
+ */
5778
+
5779
+ /**
5780
+ * Client for TikTok trending endpoints (videos, hashtags, songs).
5781
+ *
5782
+ * @example
5783
+ * ```typescript
5784
+ * const client = new ScrapeBadger({ apiKey: "key" });
5785
+ *
5786
+ * const videos = await client.tiktok.trending.videos({ region: "US" });
5787
+ * const hashtags = await client.tiktok.trending.hashtags({ region: "US", period: 7 });
5788
+ * const songs = await client.tiktok.trending.songs({ region: "US" });
5789
+ * ```
5790
+ */
5791
+ declare class TrendingClient {
5792
+ private readonly client;
5793
+ constructor(client: BaseClient);
5794
+ /**
5795
+ * Get trending videos from the TikTok Explore feed.
5796
+ *
5797
+ * @param options - Optional parameters (region, count).
5798
+ * @returns A cursor-paginated list of trending videos.
5799
+ */
5800
+ videos(options?: TikTokTrendingVideosParams): Promise<VideoListResponse>;
5801
+ /**
5802
+ * Get trending hashtags (mobile Discover surface — view_count + creators).
5803
+ *
5804
+ * @param options - Optional parameters (region, period, count).
5805
+ * @returns The trending hashtags response.
5806
+ */
5807
+ hashtags(options?: TikTokTrendingParams): Promise<TrendingHashtagsResponse>;
5808
+ /**
5809
+ * Get trending songs/sounds (mobile hot-music feed — ranked by usage).
5810
+ *
5811
+ * @param options - Optional parameters (region, period, count).
5812
+ * @returns The trending songs response.
5813
+ */
5814
+ songs(options?: TikTokTrendingParams): Promise<TrendingSongsResponse>;
5815
+ }
5816
+
5817
+ /**
5818
+ * TikTok Ads API client.
5819
+ *
5820
+ * Provides access to TikTok's Commercial Content Library (EU-DSA ad
5821
+ * transparency) via keyword or advertiser search.
5822
+ */
5823
+
5824
+ /**
5825
+ * Client for the TikTok Ad Library (Commercial Content Library) endpoint.
5826
+ *
5827
+ * @example
5828
+ * ```typescript
5829
+ * const client = new ScrapeBadger({ apiKey: "key" });
5830
+ *
5831
+ * const ads = await client.tiktok.ads.search({ query: "shoes", region: "DE" });
5832
+ * for (const ad of ads.ads) {
5833
+ * console.log(ad.name);
5834
+ * }
5835
+ * ```
5836
+ */
5837
+ declare class AdsClient {
5838
+ private readonly client;
5839
+ constructor(client: BaseClient);
5840
+ /**
5841
+ * Search TikTok's Commercial Content Library (ad transparency) by keyword or advertiser.
5842
+ *
5843
+ * @param params - Optional parameters (query, advertiser_id, region, days, sort, offset, search_id, count).
5844
+ * @returns The ad-library search response with ads and pagination.
5845
+ */
5846
+ search(params?: TikTokAdSearchParams): Promise<AdLibrarySearchResponse>;
5847
+ }
5848
+
5849
+ /**
5850
+ * TikTok Reference Data API client.
5851
+ *
5852
+ * Provides the supported-regions list and a service health check.
5853
+ */
5854
+
5855
+ /**
5856
+ * Client for TikTok reference data endpoints (regions, health).
5857
+ *
5858
+ * @example
5859
+ * ```typescript
5860
+ * const client = new ScrapeBadger({ apiKey: "key" });
5861
+ *
5862
+ * const regions = await client.tiktok.reference.regions();
5863
+ * for (const r of regions.regions) {
5864
+ * console.log(`${r.code}: ${r.name} (${r.locale})`);
5865
+ * }
5866
+ * ```
5867
+ */
5868
+ declare class ReferenceClient {
5869
+ private readonly client;
5870
+ constructor(client: BaseClient);
5871
+ /**
5872
+ * List supported TikTok content regions.
5873
+ *
5874
+ * @returns The regions response with all supported content regions.
5875
+ */
5876
+ regions(): Promise<RegionsResponse>;
5877
+ /**
5878
+ * Check the health of the TikTok scraper service.
5879
+ *
5880
+ * @returns The raw health payload from the scraper service.
5881
+ */
5882
+ health(): Promise<unknown>;
5883
+ }
5884
+
5885
+ /**
5886
+ * TikTok API client.
5887
+ *
5888
+ * Provides access to all TikTok API endpoints through specialized sub-clients.
5889
+ */
5890
+
5891
+ /**
5892
+ * TikTok API client with access to all TikTok endpoints.
5893
+ *
5894
+ * Provides sub-clients for different resource types:
5895
+ * - `users` - Profiles, videos, followers, following, liked, reposts
5896
+ * - `videos` - Detail, comments, replies, related, transcript, oEmbed
5897
+ * - `search` - Keyword search across videos, users, and hashtags
5898
+ * - `music` - Sound/music detail and videos using a sound
5899
+ * - `hashtags` - Hashtag detail and tagged videos
5900
+ * - `trending` - Trending videos, hashtags, and songs
5901
+ * - `ads` - The Commercial Content Library (ad transparency)
5902
+ * - `reference` - Reference data (regions) and service health
5903
+ *
5904
+ * @example
5905
+ * ```typescript
5906
+ * const client = new ScrapeBadger({ apiKey: "key" });
5907
+ *
5908
+ * // Get a user profile
5909
+ * const profile = await client.tiktok.users.get("charlidamelio");
5910
+ *
5911
+ * // Get video detail
5912
+ * const video = await client.tiktok.videos.get("7372...");
5913
+ *
5914
+ * // Search videos
5915
+ * const results = await client.tiktok.search.videos({ query: "skincare" });
5916
+ *
5917
+ * // Get trending songs
5918
+ * const songs = await client.tiktok.trending.songs({ region: "US" });
5919
+ *
5920
+ * // Search the ad library
5921
+ * const ads = await client.tiktok.ads.search({ query: "shoes", region: "DE" });
5922
+ *
5923
+ * // List regions
5924
+ * const regions = await client.tiktok.reference.regions();
5925
+ * ```
5926
+ */
5927
+ declare class TikTokClient {
5928
+ /** Client for profiles, videos, followers, following, liked, reposts */
5929
+ readonly users: UsersClient;
5930
+ /** Client for video detail, comments, replies, related, transcript, oEmbed */
5931
+ readonly videos: VideosClient;
5932
+ /** Client for keyword search across videos, users, and hashtags */
5933
+ readonly search: SearchClient;
5934
+ /** Client for sound/music detail and videos using a sound */
5935
+ readonly music: MusicClient;
5936
+ /** Client for hashtag detail and tagged videos */
5937
+ readonly hashtags: HashtagsClient;
5938
+ /** Client for trending videos, hashtags, and songs */
5939
+ readonly trending: TrendingClient;
5940
+ /** Client for the Commercial Content Library (ad transparency) */
5941
+ readonly ads: AdsClient;
5942
+ /** Client for reference data (regions) and service health */
5943
+ readonly reference: ReferenceClient;
5944
+ /**
5945
+ * Create a new TikTok client.
5946
+ *
5947
+ * @param client - The base HTTP client for making requests.
5948
+ */
5949
+ constructor(client: BaseClient);
5950
+ }
5951
+
4277
5952
  /**
4278
5953
  * Main ScrapeBadger client.
4279
5954
  *
@@ -4326,6 +6001,10 @@ declare class ScrapeBadger {
4326
6001
  readonly reddit: RedditClient;
4327
6002
  /** Amazon scraper API client — 14 endpoints */
4328
6003
  readonly amazon: AmazonClient;
6004
+ /** Shopee scraper API client — 6 endpoints across 11 markets */
6005
+ readonly shopee: ShopeeClient;
6006
+ /** TikTok scraper API client — 26 endpoints */
6007
+ readonly tiktok: TikTokClient;
4329
6008
  /**
4330
6009
  * Create a new ScrapeBadger client.
4331
6010
  *
@@ -4354,4 +6033,4 @@ declare class ScrapeBadger {
4354
6033
  constructor(config?: Partial<ScrapeBadgerConfig>);
4355
6034
  }
4356
6035
 
4357
- export { type AiModeSearchParams, 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$1 as GoogleProductsClient, type GoogleResponse, ScholarClient as GoogleScholarClient, SearchClient$2 as GoogleSearchClient, type GoogleSearchParams, ShoppingClient as GoogleShoppingClient, ShortsClient as GoogleShortsClient, TrendsClient as GoogleTrendsClient, VideosClient 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$1 as RedditSearchClient, type RedditSubreddit, SubredditsClient as RedditSubredditsClient, type RedditTrophy, type RedditUser, type UserProfileResponse as RedditUserProfileResponse, type RedditUserSubreddit, UsersClient 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 ShoppingClickParams, type ShoppingProductParams, type ShoppingSearchParams, type ShortsSearchParams, type SubredditDetailResponse, type SubredditPostsResponse, type SubredditRulesResponse, type SubredditWikiPagesResponse, 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$1 as VintedMarketsResponse, type VintedPagination, type VintedPhoto, type VintedPrice, ReferenceClient$1 as VintedReferenceClient, SearchClient$3 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$1 as VintedUsersClient, WebClient, type WikiPageResponse };
6036
+ 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 };