scavio 0.7.0 → 0.9.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/dist/index.d.cts CHANGED
@@ -624,6 +624,169 @@ declare class TikTokNamespace {
624
624
  userFollowings(options: TikTokUserFollowingsOptions): Promise<Record<string, unknown>>;
625
625
  }
626
626
 
627
+ /** Marketplace regions served by suggestions, product, reviews, and shop products. */
628
+ type TikTokShopRegion = "US" | "GB" | "SG" | "MY" | "PH" | "TH" | "VN" | "ID";
629
+ /** Marketplace regions served by category listings. */
630
+ type TikTokShopListingRegion = "US" | "GB";
631
+ /** Review ordering: 'relevant' is text-complete and image-heavy, 'recent' is fresher but text-sparse. */
632
+ type TikTokShopReviewSort = "relevant" | "recent";
633
+ interface TikTokShopSearchOptions {
634
+ /** Search query (1-200 characters). US catalog only. */
635
+ search: string;
636
+ /** Opaque cursor from a prior response's next_cursor. */
637
+ cursor?: string;
638
+ [key: string]: unknown;
639
+ }
640
+ interface TikTokShopSuggestionsOptions {
641
+ /** Partial query to expand (1-100 characters). */
642
+ search: string;
643
+ /** Marketplace region (default 'US'). */
644
+ region?: TikTokShopRegion;
645
+ [key: string]: unknown;
646
+ }
647
+ interface TikTokShopProductOptions {
648
+ /** TikTok Shop product id (6-25 digits). */
649
+ product_id: string;
650
+ /** Marketplace region (default 'US'). */
651
+ region?: TikTokShopRegion;
652
+ [key: string]: unknown;
653
+ }
654
+ interface TikTokShopProductReviewsOptions {
655
+ /** TikTok Shop product id (6-25 digits). */
656
+ product_id: string;
657
+ /** 1-based page number (1-500, default 1). */
658
+ page?: number;
659
+ /** Reviews per page (1-200, default 20). */
660
+ page_size?: number;
661
+ /** 'relevant' (default) is text-complete and image-heavy; 'recent' is fresher but far more text-sparse. */
662
+ sort?: TikTokShopReviewSort;
663
+ /** Only reviews with this star rating (1-5). */
664
+ rating?: number;
665
+ /** Only reviews with a photo or video (default false). */
666
+ has_media?: boolean;
667
+ /** Only verified purchases (default false). */
668
+ verified_only?: boolean;
669
+ /** Marketplace region (default 'US'). */
670
+ region?: TikTokShopRegion;
671
+ [key: string]: unknown;
672
+ }
673
+ interface TikTokShopCategoryProductsOptions {
674
+ /** Category id from tiktokShop.categories(); level 1 or 2 both work. */
675
+ category_id: string;
676
+ /** Opaque cursor from a prior response's next_cursor. */
677
+ cursor?: string;
678
+ /** Marketplace region, 'US' or 'GB' only (default 'US'). */
679
+ region?: TikTokShopListingRegion;
680
+ [key: string]: unknown;
681
+ }
682
+ interface TikTokShopShopProductsOptions {
683
+ /** TikTok Shop seller id (also called seller_id elsewhere on TikTok). */
684
+ shop_id: string;
685
+ /** Opaque cursor from a prior response's next_cursor. */
686
+ cursor?: string;
687
+ /** Marketplace region (default 'US'). */
688
+ region?: TikTokShopRegion;
689
+ [key: string]: unknown;
690
+ }
691
+ interface TikTokShopResolveOptions {
692
+ /** A TikTok Shop product or store URL, affiliate share link, or vt.tiktok.com short link. */
693
+ url: string;
694
+ [key: string]: unknown;
695
+ }
696
+ declare class TikTokShopNamespace {
697
+ private client;
698
+ constructor(client: Scavio);
699
+ /**
700
+ * Search TikTok Shop products by keyword (US catalog), up to 30 per page with
701
+ * exact prices, ratings, and shop details. Paginate with next_cursor and dedupe
702
+ * by product_id across pages.
703
+ *
704
+ * This is one of the three endpoints that return exact prices; tiktokShop.product()
705
+ * does not return a price. A product_id returned here is not guaranteed to resolve
706
+ * on tiktokShop.product() - only about 44% do.
707
+ */
708
+ search(options: TikTokShopSearchOptions): Promise<Record<string, unknown>>;
709
+ /**
710
+ * Keyword autocomplete and expansion for a partial query, across 8 marketplace
711
+ * regions. Suggestions are not guaranteed prefix matches: a misspelling returns
712
+ * typo corrections, and results can include brand and shop names.
713
+ */
714
+ searchSuggestions(options: TikTokShopSuggestionsOptions): Promise<Record<string, unknown>>;
715
+ /**
716
+ * Full product detail: description, images, variants with stock, shipping, shop
717
+ * profile, category path, and top reviews.
718
+ *
719
+ * Two limits worth knowing before you build on this:
720
+ *
721
+ * 1. It resolves only about 44% of the product ids returned by tiktokShop.search().
722
+ * Upstream has no detail data for the rest, so an HTTP 404 is a normal outcome,
723
+ * not an error. Skip the item rather than retrying - retries do not help and no
724
+ * other region carries it. Search to product is not a reliable pipeline.
725
+ *
726
+ * This method throws `NotFoundError` on that 404 (there is no `data` field in
727
+ * the response body to test), so a loop over search ids must catch it or it
728
+ * dies on the first miss:
729
+ *
730
+ * ```ts
731
+ * import { NotFoundError } from "scavio";
732
+ *
733
+ * for (const productId of productIds) {
734
+ * try {
735
+ * const detail = await client.tiktokShop.product({ product_id: productId });
736
+ * } catch (e) {
737
+ * if (e instanceof NotFoundError) continue; // no detail upstream; skip
738
+ * throw e;
739
+ * }
740
+ * }
741
+ * ```
742
+ *
743
+ * tiktokShop.productReviews() often works for ids product() cannot resolve: of
744
+ * 8 such ids tested, 8 returned HTTP 200 and 7 carried at least one review, so
745
+ * it is a useful fallback source of product detail.
746
+ * 2. It does NOT return a price. Upstream masks the price on the product page.
747
+ * Exact prices come from tiktokShop.search(), tiktokShop.shopProducts(), and
748
+ * tiktokShop.categoryProducts().
749
+ */
750
+ product(options: TikTokShopProductOptions): Promise<Record<string, unknown>>;
751
+ /**
752
+ * Paginated product reviews with text, images, star histogram, and
753
+ * verified-purchase flags, up to 200 per call. total_reviews drifts between calls
754
+ * and must not be used to compute a page count; page with has_more instead.
755
+ */
756
+ productReviews(options: TikTokShopProductReviewsOptions): Promise<Record<string, unknown>>;
757
+ /**
758
+ * The global TikTok Shop category tree: 28 top-level categories, 240 nodes, two
759
+ * levels deep. Category ids are identical in every region and names are always
760
+ * English.
761
+ */
762
+ categories(): Promise<Record<string, unknown>>;
763
+ /**
764
+ * Products listed under a category id from tiktokShop.categories(), with exact
765
+ * prices. Page size is inconsistent upstream (15 to 20 per page), so always
766
+ * paginate with next_cursor rather than assuming a fixed page size. Category
767
+ * listings are shallow: after a few pages the source stops returning new products
768
+ * and has_more turns false, which is the end of the listing rather than an error.
769
+ */
770
+ categoryProducts(options: TikTokShopCategoryProductsOptions): Promise<Record<string, unknown>>;
771
+ /**
772
+ * A shop's product catalog, 30 per page, with exact prices. Shop follower count,
773
+ * location, and shop-level rating are not available here; call
774
+ * tiktokShop.product() for the full shop profile.
775
+ */
776
+ shopProducts(options: TikTokShopShopProductsOptions): Promise<Record<string, unknown>>;
777
+ /**
778
+ * Resolve any TikTok Shop URL or share link to a product_id or shop_id, ready to
779
+ * pass to the other methods. Accepts canonical product and store pages,
780
+ * tiktok.com/view links, affiliate share links, and vt.tiktok.com short links.
781
+ */
782
+ resolve(options: TikTokShopResolveOptions): Promise<Record<string, unknown>>;
783
+ }
784
+
785
+ /**
786
+ * Instagram endpoints (/api/v1/instagram). Credit cost varies by endpoint:
787
+ * `userPosts` costs 2 credits, every other endpoint costs 8.
788
+ * See https://scavio.dev/docs/instagram-api.
789
+ */
627
790
  interface InstagramProfileOptions {
628
791
  /** Instagram username (without the @). */
629
792
  username?: string;
@@ -924,7 +1087,7 @@ declare class YouTubeNamespace {
924
1087
  streams(options: YouTubeStreamsOptions): Promise<Record<string, unknown>>;
925
1088
  }
926
1089
 
927
- interface TwitterSearchOptions {
1090
+ interface XSearchOptions {
928
1091
  /** Search query (1-500 characters). */
929
1092
  search: string;
930
1093
  /** Result category (default 'Top'). */
@@ -933,12 +1096,12 @@ interface TwitterSearchOptions {
933
1096
  cursor?: string;
934
1097
  [key: string]: unknown;
935
1098
  }
936
- interface TwitterTweetOptions {
1099
+ interface XTweetOptions {
937
1100
  /** Tweet id. */
938
1101
  tweet_id: string;
939
1102
  [key: string]: unknown;
940
1103
  }
941
- interface TwitterTweetCommentsOptions {
1104
+ interface XTweetCommentsOptions {
942
1105
  /** Tweet id. */
943
1106
  tweet_id: string;
944
1107
  /** 'top' (ranked) or 'latest' (chronological); default 'top'. */
@@ -947,44 +1110,44 @@ interface TwitterTweetCommentsOptions {
947
1110
  cursor?: string;
948
1111
  [key: string]: unknown;
949
1112
  }
950
- interface TwitterTweetRetweetersOptions {
1113
+ interface XTweetRetweetersOptions {
951
1114
  /** Tweet id. */
952
1115
  tweet_id: string;
953
1116
  /** Pagination cursor from a prior response. */
954
1117
  cursor?: string;
955
1118
  [key: string]: unknown;
956
1119
  }
957
- interface TwitterUserOptions {
958
- /** A Twitter handle (without the @). */
1120
+ interface XUserOptions {
1121
+ /** An X handle (without the @). */
959
1122
  screen_name: string;
960
1123
  [key: string]: unknown;
961
1124
  }
962
- interface TwitterUserFeedOptions {
963
- /** A Twitter handle (without the @). */
1125
+ interface XUserFeedOptions {
1126
+ /** An X handle (without the @). */
964
1127
  screen_name: string;
965
1128
  /** Pagination cursor from a prior response. */
966
1129
  cursor?: string;
967
1130
  [key: string]: unknown;
968
1131
  }
969
- interface TwitterTrendingOptions {
1132
+ interface XTrendingOptions {
970
1133
  /** Country name (default 'UnitedStates'). */
971
1134
  country?: string;
972
1135
  [key: string]: unknown;
973
1136
  }
974
- declare class TwitterNamespace {
1137
+ declare class XNamespace {
975
1138
  private client;
976
1139
  constructor(client: Scavio);
977
- search(options: TwitterSearchOptions): Promise<Record<string, unknown>>;
978
- tweet(options: TwitterTweetOptions): Promise<Record<string, unknown>>;
979
- tweetComments(options: TwitterTweetCommentsOptions): Promise<Record<string, unknown>>;
980
- tweetRetweeters(options: TwitterTweetRetweetersOptions): Promise<Record<string, unknown>>;
981
- user(options: TwitterUserOptions): Promise<Record<string, unknown>>;
982
- userTweets(options: TwitterUserFeedOptions): Promise<Record<string, unknown>>;
983
- userReplies(options: TwitterUserFeedOptions): Promise<Record<string, unknown>>;
984
- userMedia(options: TwitterUserFeedOptions): Promise<Record<string, unknown>>;
985
- userFollowers(options: TwitterUserFeedOptions): Promise<Record<string, unknown>>;
986
- userFollowings(options: TwitterUserFeedOptions): Promise<Record<string, unknown>>;
987
- trending(options?: TwitterTrendingOptions): Promise<Record<string, unknown>>;
1140
+ search(options: XSearchOptions): Promise<Record<string, unknown>>;
1141
+ tweet(options: XTweetOptions): Promise<Record<string, unknown>>;
1142
+ tweetComments(options: XTweetCommentsOptions): Promise<Record<string, unknown>>;
1143
+ tweetRetweeters(options: XTweetRetweetersOptions): Promise<Record<string, unknown>>;
1144
+ user(options: XUserOptions): Promise<Record<string, unknown>>;
1145
+ userTweets(options: XUserFeedOptions): Promise<Record<string, unknown>>;
1146
+ userReplies(options: XUserFeedOptions): Promise<Record<string, unknown>>;
1147
+ userMedia(options: XUserFeedOptions): Promise<Record<string, unknown>>;
1148
+ userFollowers(options: XUserFeedOptions): Promise<Record<string, unknown>>;
1149
+ userFollowings(options: XUserFeedOptions): Promise<Record<string, unknown>>;
1150
+ trending(options?: XTrendingOptions): Promise<Record<string, unknown>>;
988
1151
  }
989
1152
 
990
1153
  interface LinkedInPersonOptions {
@@ -1152,8 +1315,9 @@ declare class Scavio {
1152
1315
  readonly youtube: YouTubeNamespace;
1153
1316
  readonly reddit: RedditNamespace;
1154
1317
  readonly tiktok: TikTokNamespace;
1318
+ readonly tiktokShop: TikTokShopNamespace;
1155
1319
  readonly instagram: InstagramNamespace;
1156
- readonly twitter: TwitterNamespace;
1320
+ readonly x: XNamespace;
1157
1321
  readonly linkedin: LinkedInNamespace;
1158
1322
  private readonly apiKey;
1159
1323
  private readonly baseUrl;
@@ -1214,4 +1378,4 @@ declare class ScavioAPIError extends ScavioError {
1214
1378
  constructor(statusCode: number, message: string, responseBody?: Record<string, unknown>);
1215
1379
  }
1216
1380
 
1217
- export { type AmazonProductOptions, type AmazonSearchOptions, BadRequestError, type GoogleAiModeOptions, type GoogleFlightsOptions, type GoogleHotelsDetailOptions, type GoogleHotelsOptions, type GoogleMapsPlaceOptions, type GoogleMapsReviewsOptions, type GoogleMapsSearchOptions, type GoogleNewsOptions, type GoogleSearchOptions, type GoogleShoppingOptions, type GoogleShoppingProductOptions, type GoogleShoppingStoresOptions, type GoogleTrendingOptions, type GoogleTrendsOptions, type InstagramCommentRepliesOptions, type InstagramFollowOptions, type InstagramPostCommentsOptions, type InstagramPostOptions, type InstagramProfileOptions, type InstagramSearchOptions, type InstagramStoriesOptions, type InstagramUserFeedOptions, InsufficientCreditsError, InvalidAPIKeyError, type LinkedInCompanyOptions, type LinkedInCompanyPostsOptions, type LinkedInCompanyRefOptions, type LinkedInJobOptions, type LinkedInPersonContactOptions, type LinkedInPersonOptions, type LinkedInPersonPostsOptions, type LinkedInPersonRefOptions, type LinkedInPostCommentsOptions, type LinkedInPostOptions, type LinkedInSearchJobsOptions, type LinkedInSearchPeopleOptions, type LinkedInSearchPostsOptions, MissingAPIKeyError, NotFoundError, RateLimitError, type RedditCommentRepliesOptions, type RedditFeedSort, type RedditPopularOptions, type RedditPostCommentsOptions, type RedditPostOptions, type RedditSearchOptions, type RedditSearchSuggestionsOptions, type RedditSort, type RedditSubredditOptions, type RedditSubredditPostsOptions, type RedditUserFeedOptions, type RedditUserOptions, Scavio, ScavioAPIError, type ScavioConfig, ScavioConnectionError, ScavioError, ScavioTimeoutError, type TikTokCommentRepliesOptions, type TikTokHashtagOptions, type TikTokHashtagVideosOptions, type TikTokProfileOptions, type TikTokSearchUsersOptions, type TikTokSearchVideosOptions, type TikTokUserFollowersOptions, type TikTokUserFollowingsOptions, type TikTokUserPostsOptions, type TikTokVideoCommentsOptions, type TikTokVideoOptions, type TwitterSearchOptions, type TwitterTrendingOptions, type TwitterTweetCommentsOptions, type TwitterTweetOptions, type TwitterTweetRetweetersOptions, type TwitterUserFeedOptions, type TwitterUserOptions, type WalmartProductOptions, type WalmartSearchOptions, type YouTubeChannelCommunityOptions, type YouTubeChannelOptions, type YouTubeChannelResolveOptions, type YouTubeChannelSearchOptions, type YouTubeChannelShortsOptions, type YouTubeChannelVideosOptions, type YouTubeCommentRepliesOptions, type YouTubeCommentsOptions, type YouTubeMetadataOptions, type YouTubeRelatedOptions, type YouTubeSearchOptions, type YouTubeShortsOptions, type YouTubeStreamsOptions, type YouTubeSuggestionsOptions, type YouTubeTranscriptOptions, type YouTubeVideoOptions };
1381
+ export { type AmazonProductOptions, type AmazonSearchOptions, BadRequestError, type GoogleAiModeOptions, type GoogleFlightsOptions, type GoogleHotelsDetailOptions, type GoogleHotelsOptions, type GoogleMapsPlaceOptions, type GoogleMapsReviewsOptions, type GoogleMapsSearchOptions, type GoogleNewsOptions, type GoogleSearchOptions, type GoogleShoppingOptions, type GoogleShoppingProductOptions, type GoogleShoppingStoresOptions, type GoogleTrendingOptions, type GoogleTrendsOptions, type InstagramCommentRepliesOptions, type InstagramFollowOptions, type InstagramPostCommentsOptions, type InstagramPostOptions, type InstagramProfileOptions, type InstagramSearchOptions, type InstagramStoriesOptions, type InstagramUserFeedOptions, InsufficientCreditsError, InvalidAPIKeyError, type LinkedInCompanyOptions, type LinkedInCompanyPostsOptions, type LinkedInCompanyRefOptions, type LinkedInJobOptions, type LinkedInPersonContactOptions, type LinkedInPersonOptions, type LinkedInPersonPostsOptions, type LinkedInPersonRefOptions, type LinkedInPostCommentsOptions, type LinkedInPostOptions, type LinkedInSearchJobsOptions, type LinkedInSearchPeopleOptions, type LinkedInSearchPostsOptions, MissingAPIKeyError, NotFoundError, RateLimitError, type RedditCommentRepliesOptions, type RedditFeedSort, type RedditPopularOptions, type RedditPostCommentsOptions, type RedditPostOptions, type RedditSearchOptions, type RedditSearchSuggestionsOptions, type RedditSort, type RedditSubredditOptions, type RedditSubredditPostsOptions, type RedditUserFeedOptions, type RedditUserOptions, Scavio, ScavioAPIError, type ScavioConfig, ScavioConnectionError, ScavioError, ScavioTimeoutError, type TikTokCommentRepliesOptions, type TikTokHashtagOptions, type TikTokHashtagVideosOptions, type TikTokProfileOptions, type TikTokSearchUsersOptions, type TikTokSearchVideosOptions, type TikTokShopCategoryProductsOptions, type TikTokShopListingRegion, type TikTokShopProductOptions, type TikTokShopProductReviewsOptions, type TikTokShopRegion, type TikTokShopResolveOptions, type TikTokShopReviewSort, type TikTokShopSearchOptions, type TikTokShopShopProductsOptions, type TikTokShopSuggestionsOptions, type TikTokUserFollowersOptions, type TikTokUserFollowingsOptions, type TikTokUserPostsOptions, type TikTokVideoCommentsOptions, type TikTokVideoOptions, type WalmartProductOptions, type WalmartSearchOptions, type XSearchOptions, type XTrendingOptions, type XTweetCommentsOptions, type XTweetOptions, type XTweetRetweetersOptions, type XUserFeedOptions, type XUserOptions, type YouTubeChannelCommunityOptions, type YouTubeChannelOptions, type YouTubeChannelResolveOptions, type YouTubeChannelSearchOptions, type YouTubeChannelShortsOptions, type YouTubeChannelVideosOptions, type YouTubeCommentRepliesOptions, type YouTubeCommentsOptions, type YouTubeMetadataOptions, type YouTubeRelatedOptions, type YouTubeSearchOptions, type YouTubeShortsOptions, type YouTubeStreamsOptions, type YouTubeSuggestionsOptions, type YouTubeTranscriptOptions, type YouTubeVideoOptions };
package/dist/index.d.ts CHANGED
@@ -624,6 +624,169 @@ declare class TikTokNamespace {
624
624
  userFollowings(options: TikTokUserFollowingsOptions): Promise<Record<string, unknown>>;
625
625
  }
626
626
 
627
+ /** Marketplace regions served by suggestions, product, reviews, and shop products. */
628
+ type TikTokShopRegion = "US" | "GB" | "SG" | "MY" | "PH" | "TH" | "VN" | "ID";
629
+ /** Marketplace regions served by category listings. */
630
+ type TikTokShopListingRegion = "US" | "GB";
631
+ /** Review ordering: 'relevant' is text-complete and image-heavy, 'recent' is fresher but text-sparse. */
632
+ type TikTokShopReviewSort = "relevant" | "recent";
633
+ interface TikTokShopSearchOptions {
634
+ /** Search query (1-200 characters). US catalog only. */
635
+ search: string;
636
+ /** Opaque cursor from a prior response's next_cursor. */
637
+ cursor?: string;
638
+ [key: string]: unknown;
639
+ }
640
+ interface TikTokShopSuggestionsOptions {
641
+ /** Partial query to expand (1-100 characters). */
642
+ search: string;
643
+ /** Marketplace region (default 'US'). */
644
+ region?: TikTokShopRegion;
645
+ [key: string]: unknown;
646
+ }
647
+ interface TikTokShopProductOptions {
648
+ /** TikTok Shop product id (6-25 digits). */
649
+ product_id: string;
650
+ /** Marketplace region (default 'US'). */
651
+ region?: TikTokShopRegion;
652
+ [key: string]: unknown;
653
+ }
654
+ interface TikTokShopProductReviewsOptions {
655
+ /** TikTok Shop product id (6-25 digits). */
656
+ product_id: string;
657
+ /** 1-based page number (1-500, default 1). */
658
+ page?: number;
659
+ /** Reviews per page (1-200, default 20). */
660
+ page_size?: number;
661
+ /** 'relevant' (default) is text-complete and image-heavy; 'recent' is fresher but far more text-sparse. */
662
+ sort?: TikTokShopReviewSort;
663
+ /** Only reviews with this star rating (1-5). */
664
+ rating?: number;
665
+ /** Only reviews with a photo or video (default false). */
666
+ has_media?: boolean;
667
+ /** Only verified purchases (default false). */
668
+ verified_only?: boolean;
669
+ /** Marketplace region (default 'US'). */
670
+ region?: TikTokShopRegion;
671
+ [key: string]: unknown;
672
+ }
673
+ interface TikTokShopCategoryProductsOptions {
674
+ /** Category id from tiktokShop.categories(); level 1 or 2 both work. */
675
+ category_id: string;
676
+ /** Opaque cursor from a prior response's next_cursor. */
677
+ cursor?: string;
678
+ /** Marketplace region, 'US' or 'GB' only (default 'US'). */
679
+ region?: TikTokShopListingRegion;
680
+ [key: string]: unknown;
681
+ }
682
+ interface TikTokShopShopProductsOptions {
683
+ /** TikTok Shop seller id (also called seller_id elsewhere on TikTok). */
684
+ shop_id: string;
685
+ /** Opaque cursor from a prior response's next_cursor. */
686
+ cursor?: string;
687
+ /** Marketplace region (default 'US'). */
688
+ region?: TikTokShopRegion;
689
+ [key: string]: unknown;
690
+ }
691
+ interface TikTokShopResolveOptions {
692
+ /** A TikTok Shop product or store URL, affiliate share link, or vt.tiktok.com short link. */
693
+ url: string;
694
+ [key: string]: unknown;
695
+ }
696
+ declare class TikTokShopNamespace {
697
+ private client;
698
+ constructor(client: Scavio);
699
+ /**
700
+ * Search TikTok Shop products by keyword (US catalog), up to 30 per page with
701
+ * exact prices, ratings, and shop details. Paginate with next_cursor and dedupe
702
+ * by product_id across pages.
703
+ *
704
+ * This is one of the three endpoints that return exact prices; tiktokShop.product()
705
+ * does not return a price. A product_id returned here is not guaranteed to resolve
706
+ * on tiktokShop.product() - only about 44% do.
707
+ */
708
+ search(options: TikTokShopSearchOptions): Promise<Record<string, unknown>>;
709
+ /**
710
+ * Keyword autocomplete and expansion for a partial query, across 8 marketplace
711
+ * regions. Suggestions are not guaranteed prefix matches: a misspelling returns
712
+ * typo corrections, and results can include brand and shop names.
713
+ */
714
+ searchSuggestions(options: TikTokShopSuggestionsOptions): Promise<Record<string, unknown>>;
715
+ /**
716
+ * Full product detail: description, images, variants with stock, shipping, shop
717
+ * profile, category path, and top reviews.
718
+ *
719
+ * Two limits worth knowing before you build on this:
720
+ *
721
+ * 1. It resolves only about 44% of the product ids returned by tiktokShop.search().
722
+ * Upstream has no detail data for the rest, so an HTTP 404 is a normal outcome,
723
+ * not an error. Skip the item rather than retrying - retries do not help and no
724
+ * other region carries it. Search to product is not a reliable pipeline.
725
+ *
726
+ * This method throws `NotFoundError` on that 404 (there is no `data` field in
727
+ * the response body to test), so a loop over search ids must catch it or it
728
+ * dies on the first miss:
729
+ *
730
+ * ```ts
731
+ * import { NotFoundError } from "scavio";
732
+ *
733
+ * for (const productId of productIds) {
734
+ * try {
735
+ * const detail = await client.tiktokShop.product({ product_id: productId });
736
+ * } catch (e) {
737
+ * if (e instanceof NotFoundError) continue; // no detail upstream; skip
738
+ * throw e;
739
+ * }
740
+ * }
741
+ * ```
742
+ *
743
+ * tiktokShop.productReviews() often works for ids product() cannot resolve: of
744
+ * 8 such ids tested, 8 returned HTTP 200 and 7 carried at least one review, so
745
+ * it is a useful fallback source of product detail.
746
+ * 2. It does NOT return a price. Upstream masks the price on the product page.
747
+ * Exact prices come from tiktokShop.search(), tiktokShop.shopProducts(), and
748
+ * tiktokShop.categoryProducts().
749
+ */
750
+ product(options: TikTokShopProductOptions): Promise<Record<string, unknown>>;
751
+ /**
752
+ * Paginated product reviews with text, images, star histogram, and
753
+ * verified-purchase flags, up to 200 per call. total_reviews drifts between calls
754
+ * and must not be used to compute a page count; page with has_more instead.
755
+ */
756
+ productReviews(options: TikTokShopProductReviewsOptions): Promise<Record<string, unknown>>;
757
+ /**
758
+ * The global TikTok Shop category tree: 28 top-level categories, 240 nodes, two
759
+ * levels deep. Category ids are identical in every region and names are always
760
+ * English.
761
+ */
762
+ categories(): Promise<Record<string, unknown>>;
763
+ /**
764
+ * Products listed under a category id from tiktokShop.categories(), with exact
765
+ * prices. Page size is inconsistent upstream (15 to 20 per page), so always
766
+ * paginate with next_cursor rather than assuming a fixed page size. Category
767
+ * listings are shallow: after a few pages the source stops returning new products
768
+ * and has_more turns false, which is the end of the listing rather than an error.
769
+ */
770
+ categoryProducts(options: TikTokShopCategoryProductsOptions): Promise<Record<string, unknown>>;
771
+ /**
772
+ * A shop's product catalog, 30 per page, with exact prices. Shop follower count,
773
+ * location, and shop-level rating are not available here; call
774
+ * tiktokShop.product() for the full shop profile.
775
+ */
776
+ shopProducts(options: TikTokShopShopProductsOptions): Promise<Record<string, unknown>>;
777
+ /**
778
+ * Resolve any TikTok Shop URL or share link to a product_id or shop_id, ready to
779
+ * pass to the other methods. Accepts canonical product and store pages,
780
+ * tiktok.com/view links, affiliate share links, and vt.tiktok.com short links.
781
+ */
782
+ resolve(options: TikTokShopResolveOptions): Promise<Record<string, unknown>>;
783
+ }
784
+
785
+ /**
786
+ * Instagram endpoints (/api/v1/instagram). Credit cost varies by endpoint:
787
+ * `userPosts` costs 2 credits, every other endpoint costs 8.
788
+ * See https://scavio.dev/docs/instagram-api.
789
+ */
627
790
  interface InstagramProfileOptions {
628
791
  /** Instagram username (without the @). */
629
792
  username?: string;
@@ -924,7 +1087,7 @@ declare class YouTubeNamespace {
924
1087
  streams(options: YouTubeStreamsOptions): Promise<Record<string, unknown>>;
925
1088
  }
926
1089
 
927
- interface TwitterSearchOptions {
1090
+ interface XSearchOptions {
928
1091
  /** Search query (1-500 characters). */
929
1092
  search: string;
930
1093
  /** Result category (default 'Top'). */
@@ -933,12 +1096,12 @@ interface TwitterSearchOptions {
933
1096
  cursor?: string;
934
1097
  [key: string]: unknown;
935
1098
  }
936
- interface TwitterTweetOptions {
1099
+ interface XTweetOptions {
937
1100
  /** Tweet id. */
938
1101
  tweet_id: string;
939
1102
  [key: string]: unknown;
940
1103
  }
941
- interface TwitterTweetCommentsOptions {
1104
+ interface XTweetCommentsOptions {
942
1105
  /** Tweet id. */
943
1106
  tweet_id: string;
944
1107
  /** 'top' (ranked) or 'latest' (chronological); default 'top'. */
@@ -947,44 +1110,44 @@ interface TwitterTweetCommentsOptions {
947
1110
  cursor?: string;
948
1111
  [key: string]: unknown;
949
1112
  }
950
- interface TwitterTweetRetweetersOptions {
1113
+ interface XTweetRetweetersOptions {
951
1114
  /** Tweet id. */
952
1115
  tweet_id: string;
953
1116
  /** Pagination cursor from a prior response. */
954
1117
  cursor?: string;
955
1118
  [key: string]: unknown;
956
1119
  }
957
- interface TwitterUserOptions {
958
- /** A Twitter handle (without the @). */
1120
+ interface XUserOptions {
1121
+ /** An X handle (without the @). */
959
1122
  screen_name: string;
960
1123
  [key: string]: unknown;
961
1124
  }
962
- interface TwitterUserFeedOptions {
963
- /** A Twitter handle (without the @). */
1125
+ interface XUserFeedOptions {
1126
+ /** An X handle (without the @). */
964
1127
  screen_name: string;
965
1128
  /** Pagination cursor from a prior response. */
966
1129
  cursor?: string;
967
1130
  [key: string]: unknown;
968
1131
  }
969
- interface TwitterTrendingOptions {
1132
+ interface XTrendingOptions {
970
1133
  /** Country name (default 'UnitedStates'). */
971
1134
  country?: string;
972
1135
  [key: string]: unknown;
973
1136
  }
974
- declare class TwitterNamespace {
1137
+ declare class XNamespace {
975
1138
  private client;
976
1139
  constructor(client: Scavio);
977
- search(options: TwitterSearchOptions): Promise<Record<string, unknown>>;
978
- tweet(options: TwitterTweetOptions): Promise<Record<string, unknown>>;
979
- tweetComments(options: TwitterTweetCommentsOptions): Promise<Record<string, unknown>>;
980
- tweetRetweeters(options: TwitterTweetRetweetersOptions): Promise<Record<string, unknown>>;
981
- user(options: TwitterUserOptions): Promise<Record<string, unknown>>;
982
- userTweets(options: TwitterUserFeedOptions): Promise<Record<string, unknown>>;
983
- userReplies(options: TwitterUserFeedOptions): Promise<Record<string, unknown>>;
984
- userMedia(options: TwitterUserFeedOptions): Promise<Record<string, unknown>>;
985
- userFollowers(options: TwitterUserFeedOptions): Promise<Record<string, unknown>>;
986
- userFollowings(options: TwitterUserFeedOptions): Promise<Record<string, unknown>>;
987
- trending(options?: TwitterTrendingOptions): Promise<Record<string, unknown>>;
1140
+ search(options: XSearchOptions): Promise<Record<string, unknown>>;
1141
+ tweet(options: XTweetOptions): Promise<Record<string, unknown>>;
1142
+ tweetComments(options: XTweetCommentsOptions): Promise<Record<string, unknown>>;
1143
+ tweetRetweeters(options: XTweetRetweetersOptions): Promise<Record<string, unknown>>;
1144
+ user(options: XUserOptions): Promise<Record<string, unknown>>;
1145
+ userTweets(options: XUserFeedOptions): Promise<Record<string, unknown>>;
1146
+ userReplies(options: XUserFeedOptions): Promise<Record<string, unknown>>;
1147
+ userMedia(options: XUserFeedOptions): Promise<Record<string, unknown>>;
1148
+ userFollowers(options: XUserFeedOptions): Promise<Record<string, unknown>>;
1149
+ userFollowings(options: XUserFeedOptions): Promise<Record<string, unknown>>;
1150
+ trending(options?: XTrendingOptions): Promise<Record<string, unknown>>;
988
1151
  }
989
1152
 
990
1153
  interface LinkedInPersonOptions {
@@ -1152,8 +1315,9 @@ declare class Scavio {
1152
1315
  readonly youtube: YouTubeNamespace;
1153
1316
  readonly reddit: RedditNamespace;
1154
1317
  readonly tiktok: TikTokNamespace;
1318
+ readonly tiktokShop: TikTokShopNamespace;
1155
1319
  readonly instagram: InstagramNamespace;
1156
- readonly twitter: TwitterNamespace;
1320
+ readonly x: XNamespace;
1157
1321
  readonly linkedin: LinkedInNamespace;
1158
1322
  private readonly apiKey;
1159
1323
  private readonly baseUrl;
@@ -1214,4 +1378,4 @@ declare class ScavioAPIError extends ScavioError {
1214
1378
  constructor(statusCode: number, message: string, responseBody?: Record<string, unknown>);
1215
1379
  }
1216
1380
 
1217
- export { type AmazonProductOptions, type AmazonSearchOptions, BadRequestError, type GoogleAiModeOptions, type GoogleFlightsOptions, type GoogleHotelsDetailOptions, type GoogleHotelsOptions, type GoogleMapsPlaceOptions, type GoogleMapsReviewsOptions, type GoogleMapsSearchOptions, type GoogleNewsOptions, type GoogleSearchOptions, type GoogleShoppingOptions, type GoogleShoppingProductOptions, type GoogleShoppingStoresOptions, type GoogleTrendingOptions, type GoogleTrendsOptions, type InstagramCommentRepliesOptions, type InstagramFollowOptions, type InstagramPostCommentsOptions, type InstagramPostOptions, type InstagramProfileOptions, type InstagramSearchOptions, type InstagramStoriesOptions, type InstagramUserFeedOptions, InsufficientCreditsError, InvalidAPIKeyError, type LinkedInCompanyOptions, type LinkedInCompanyPostsOptions, type LinkedInCompanyRefOptions, type LinkedInJobOptions, type LinkedInPersonContactOptions, type LinkedInPersonOptions, type LinkedInPersonPostsOptions, type LinkedInPersonRefOptions, type LinkedInPostCommentsOptions, type LinkedInPostOptions, type LinkedInSearchJobsOptions, type LinkedInSearchPeopleOptions, type LinkedInSearchPostsOptions, MissingAPIKeyError, NotFoundError, RateLimitError, type RedditCommentRepliesOptions, type RedditFeedSort, type RedditPopularOptions, type RedditPostCommentsOptions, type RedditPostOptions, type RedditSearchOptions, type RedditSearchSuggestionsOptions, type RedditSort, type RedditSubredditOptions, type RedditSubredditPostsOptions, type RedditUserFeedOptions, type RedditUserOptions, Scavio, ScavioAPIError, type ScavioConfig, ScavioConnectionError, ScavioError, ScavioTimeoutError, type TikTokCommentRepliesOptions, type TikTokHashtagOptions, type TikTokHashtagVideosOptions, type TikTokProfileOptions, type TikTokSearchUsersOptions, type TikTokSearchVideosOptions, type TikTokUserFollowersOptions, type TikTokUserFollowingsOptions, type TikTokUserPostsOptions, type TikTokVideoCommentsOptions, type TikTokVideoOptions, type TwitterSearchOptions, type TwitterTrendingOptions, type TwitterTweetCommentsOptions, type TwitterTweetOptions, type TwitterTweetRetweetersOptions, type TwitterUserFeedOptions, type TwitterUserOptions, type WalmartProductOptions, type WalmartSearchOptions, type YouTubeChannelCommunityOptions, type YouTubeChannelOptions, type YouTubeChannelResolveOptions, type YouTubeChannelSearchOptions, type YouTubeChannelShortsOptions, type YouTubeChannelVideosOptions, type YouTubeCommentRepliesOptions, type YouTubeCommentsOptions, type YouTubeMetadataOptions, type YouTubeRelatedOptions, type YouTubeSearchOptions, type YouTubeShortsOptions, type YouTubeStreamsOptions, type YouTubeSuggestionsOptions, type YouTubeTranscriptOptions, type YouTubeVideoOptions };
1381
+ export { type AmazonProductOptions, type AmazonSearchOptions, BadRequestError, type GoogleAiModeOptions, type GoogleFlightsOptions, type GoogleHotelsDetailOptions, type GoogleHotelsOptions, type GoogleMapsPlaceOptions, type GoogleMapsReviewsOptions, type GoogleMapsSearchOptions, type GoogleNewsOptions, type GoogleSearchOptions, type GoogleShoppingOptions, type GoogleShoppingProductOptions, type GoogleShoppingStoresOptions, type GoogleTrendingOptions, type GoogleTrendsOptions, type InstagramCommentRepliesOptions, type InstagramFollowOptions, type InstagramPostCommentsOptions, type InstagramPostOptions, type InstagramProfileOptions, type InstagramSearchOptions, type InstagramStoriesOptions, type InstagramUserFeedOptions, InsufficientCreditsError, InvalidAPIKeyError, type LinkedInCompanyOptions, type LinkedInCompanyPostsOptions, type LinkedInCompanyRefOptions, type LinkedInJobOptions, type LinkedInPersonContactOptions, type LinkedInPersonOptions, type LinkedInPersonPostsOptions, type LinkedInPersonRefOptions, type LinkedInPostCommentsOptions, type LinkedInPostOptions, type LinkedInSearchJobsOptions, type LinkedInSearchPeopleOptions, type LinkedInSearchPostsOptions, MissingAPIKeyError, NotFoundError, RateLimitError, type RedditCommentRepliesOptions, type RedditFeedSort, type RedditPopularOptions, type RedditPostCommentsOptions, type RedditPostOptions, type RedditSearchOptions, type RedditSearchSuggestionsOptions, type RedditSort, type RedditSubredditOptions, type RedditSubredditPostsOptions, type RedditUserFeedOptions, type RedditUserOptions, Scavio, ScavioAPIError, type ScavioConfig, ScavioConnectionError, ScavioError, ScavioTimeoutError, type TikTokCommentRepliesOptions, type TikTokHashtagOptions, type TikTokHashtagVideosOptions, type TikTokProfileOptions, type TikTokSearchUsersOptions, type TikTokSearchVideosOptions, type TikTokShopCategoryProductsOptions, type TikTokShopListingRegion, type TikTokShopProductOptions, type TikTokShopProductReviewsOptions, type TikTokShopRegion, type TikTokShopResolveOptions, type TikTokShopReviewSort, type TikTokShopSearchOptions, type TikTokShopShopProductsOptions, type TikTokShopSuggestionsOptions, type TikTokUserFollowersOptions, type TikTokUserFollowingsOptions, type TikTokUserPostsOptions, type TikTokVideoCommentsOptions, type TikTokVideoOptions, type WalmartProductOptions, type WalmartSearchOptions, type XSearchOptions, type XTrendingOptions, type XTweetCommentsOptions, type XTweetOptions, type XTweetRetweetersOptions, type XUserFeedOptions, type XUserOptions, type YouTubeChannelCommunityOptions, type YouTubeChannelOptions, type YouTubeChannelResolveOptions, type YouTubeChannelSearchOptions, type YouTubeChannelShortsOptions, type YouTubeChannelVideosOptions, type YouTubeCommentRepliesOptions, type YouTubeCommentsOptions, type YouTubeMetadataOptions, type YouTubeRelatedOptions, type YouTubeSearchOptions, type YouTubeShortsOptions, type YouTubeStreamsOptions, type YouTubeSuggestionsOptions, type YouTubeTranscriptOptions, type YouTubeVideoOptions };