import type { ApiResponse, SearchResponse, ProductResponse, ReviewsResponse } from '../types/api.js'; /** * API Client for Optima Scout Backend */ export declare class ApiClient { private baseUrl; constructor(baseUrl?: string); /** * 获取认证 headers */ private getAuthHeaders; /** * fetch 包装:统一加请求超时(AbortSignal.timeout)。原来所有 fetch 无超时,跨境/上游 * 慢就无限挂 → agent 卡死。超时由 getHttpTimeoutMs() 控制(默认 30s,--timeout 可调)。 * 若调用方已带 signal,则与超时信号合并(任一触发即中止)。超时抛明确错误供 LLM 感知。 */ private doFetch; /** * 处理 API 错误响应,提取有意义的错误信息 */ private handleErrorResponse; /** * Search for products */ search(query: string, domain?: string): Promise>; /** * Get product details by ASIN */ getProduct(asin: string, domain?: string): Promise>; /** * Get product reviews with pagination */ getReviews(asin: string, params?: { domain?: string; pages?: number; sort?: string; star?: string; allStars?: boolean; verified?: boolean; }): Promise>; /** * Search for 1688 suppliers by keyword */ searchSuppliers(keyword: string, limit?: number): Promise; /** * Search for 1688 suppliers by image */ searchSuppliersByImage(params: { imageUrl?: string; imageData?: string; contentType?: string; limit?: number; }): Promise; /** * Search TikTok Shop products */ searchTikTokShop(keyword: string, limit?: number, region?: string): Promise; /** * Get TikTok Shop product details */ getTikTokProduct(productId: string): Promise; /** * Get TikTok Shop product reviews (review text, rating, buyer photos) */ getTikTokShopReviews(productId: string, params?: { region?: string; }): Promise; /** * Get popular TikTok creators */ getTikTokCreators(params: { country?: string; followerCount?: string; audienceCountry?: string; sort?: string; limit?: number; }): Promise; /** * Get products from creator videos */ getTikTokCreatorProducts(username: string, params: { sort?: string; limit?: number; }): Promise; /** * Search TikTok videos by keyword */ searchTikTokVideos(keyword: string, params: { limit?: number; region?: string; hasProductLink?: boolean; }): Promise; /** * Get trending TikTok videos */ getTikTokTrending(params: { region?: string; timePeriod?: string; hasProductLink?: boolean; limit?: number; }): Promise; /** * Get video insights (details + transcript + comments) */ getTikTokVideoInsights(url: string, params: { includeTranscript?: boolean; includeComments?: boolean; }): Promise; /** * Get popular hashtags */ getTikTokHashtags(params: { region?: string; limit?: number; }): Promise; /** * Search Instagram Reels */ searchInstagramReels(keyword: string, params: { limit?: number; minPlays?: number; }): Promise; /** * Get creator Reels */ getInstagramCreatorReels(username: string, params: { limit?: number; }): Promise; /** * Get Reel insights (details + transcript + comments) */ getInstagramReelInsights(url: string, params: { includeTranscript?: boolean; includeComments?: boolean; }): Promise; /** * Get Instagram profile */ getInstagramProfile(username: string): Promise; /** * Search Shein products */ searchShein(keyword: string, params: { limit?: number; country?: string; currency?: string; language?: string; }): Promise; /** * Search Temu products */ searchTemu(keyword: string, params: { limit?: number; currency?: string; }): Promise; searchDouyinVideos(keyword: string, params?: { cursor?: number; sortType?: string; publishTime?: string; filterDuration?: string; }): Promise; getDouyinVideoDetail(awemeId: string): Promise; getDouyinVideoByUrl(shareUrl: string): Promise; getDouyinVideoDownloadUrl(awemeId: string): Promise; getDouyinVideoComments(awemeId: string, count?: number): Promise; getDouyinVideoInsights(awemeId: string, params?: { includeComments?: boolean; }): Promise; searchDouyinUsers(keyword: string, cursor?: number): Promise; getDouyinUserProfile(secUserId: string): Promise; getDouyinUserVideos(secUserId: string, params?: { count?: number; maxCursor?: number; }): Promise; getDouyinHotSearch(): Promise; getDouyinChallenges(params?: { page?: number; pageSize?: number; }): Promise; getDouyinBillboard(params?: { page?: number; pageSize?: number; type?: string; snapshotTime?: string; startDate?: string; endDate?: string; }): Promise; searchDouyinChallenges(keyword: string, cursor?: number): Promise; getDouyinProductReviews(productId: string, shopId: string, count?: number, sortType?: number): Promise; getDouyinProduct(productId: string, shopId: string, authorId?: string): Promise; searchXhsNotes(keyword: string, params?: { page?: number; sortType?: string; noteType?: string; }): Promise; getXhsNoteDetail(noteId: string): Promise; getXhsUserProfile(userId: string): Promise; getXhsUserNotes(userId: string, params?: { cursor?: string; }): Promise; searchRedditPosts(query: string, params?: { sort?: string; timeframe?: string; }): Promise; getRedditSubreddit(subreddit: string, params?: { sort?: string; timeframe?: string; }): Promise; getRedditSubredditInfo(subreddit: string): Promise; getRedditPostComments(postUrl: string): Promise; searchRedditAds(query: string, params?: { industries?: string; }): Promise; discoverRedditTrends(query: string, params?: { subreddits?: string; timeframe?: string; }): Promise; searchTwitter(keyword: string, params?: { searchType?: string; }): Promise; getTwitterTrending(): Promise; getTwitterProfile(screenName: string): Promise; getTwitterTweet(tweetId: string): Promise; getTwitterComments(tweetId: string): Promise; getTwitterFollowers(screenName: string): Promise; getTwitterTopTweets(screenName: string): Promise; getTwitterTranscript(tweetUrl: string): Promise; getTwitterCommunity(communityUrl: string): Promise; getTwitterCommunityTweets(communityUrl: string): Promise; discoverTwitterTrends(keyword?: string): Promise; searchTaobao(keyword: string, params?: { page?: number; sort?: string; tmall?: boolean; startPrice?: number; endPrice?: number; }): Promise; getTaobaoDetail(itemId: string): Promise; getTaobaoComments(itemId: string, params?: { page?: number; }): Promise; getTaobaoInsights(itemId: string): Promise; getKeepaProduct(asin: string, params?: { domain?: string; stats?: number; days?: number; buybox?: boolean; rating?: boolean; offers?: number; }): Promise; keepaSearch(selection: Record, params?: { domain?: string; page?: number; perPage?: number; }): Promise; getKeepaBestsellers(category: number, params?: { domain?: string; range?: number; }): Promise; getKeepaSeller(sellerId: string, params?: { domain?: string; storefront?: boolean; }): Promise; getKeepaDeals(selection: Record, params?: { domain?: string; }): Promise; getKeepaCategory(category: number, params?: { domain?: string; parents?: boolean; }): Promise; searchKeepaCategories(term: string, params?: { domain?: string; }): Promise; getKeepaGraph(asin: string, params?: { domain?: string; width?: number; height?: number; }): Promise; getKeepaTokens(): Promise; getKeepaHistory(asin: string, type: string, params?: { domain?: string; days?: number; }): Promise; /** Generic GET helper for simple /api/* routes */ private get; getSpKeywords(asin: string, marketplace?: string): Promise; getSpKeywordsMine(keyword: string, marketplace?: string): Promise; getSpKeywordsOrder(asin: string, marketplace?: string, reverseType?: string, date?: string): Promise; getSpKeywordsResearch(keyword: string, marketplace?: string): Promise; getSpKeywordsTrends(keyword: string, marketplace?: string): Promise; getSpTrafficStats(asin: string, marketplace?: string): Promise; getSpTrafficSource(asin: string, marketplace?: string): Promise; getSpTrafficListing(asin: string, marketplace?: string): Promise; getSpTrafficRelated(asin: string, marketplace?: string): Promise; getSpTrafficExtend(asin: string, marketplace?: string): Promise; getSpPredict(asin: string, marketplace?: string): Promise; getSpCompetitors(asin: string, marketplace?: string): Promise; getSpCoupon(asin: string, marketplace?: string): Promise; getSpCategory(keyword: string, marketplace?: string): Promise; getSpMarket(nodeIdPath: string, marketplace?: string, month?: string, topN?: number): Promise; private getSpMarketRoute; getSpMarketStats(nodeIdPath: string, marketplace?: string, month?: string, topN?: number): Promise; getSpBrands(nodeIdPath: string, marketplace?: string, month?: string, topN?: number): Promise; getSpSellers(nodeIdPath: string, marketplace?: string, month?: string, topN?: number): Promise; getSpDemand(nodeIdPath: string, marketplace?: string, month?: string, topN?: number): Promise; getSpPrices(nodeIdPath: string, marketplace?: string, month?: string, topN?: number): Promise; getSpRatings(nodeIdPath: string, marketplace?: string, month?: string, topN?: number): Promise; getSpRatingValues(nodeIdPath: string, marketplace?: string, month?: string, topN?: number): Promise; getSpListingDates(nodeIdPath: string, marketplace?: string, month?: string, topN?: number): Promise; getSpListingTrends(nodeIdPath: string, marketplace?: string, month?: string, topN?: number): Promise; getSpSellerCountries(nodeIdPath: string, marketplace?: string, month?: string, topN?: number): Promise; getSpSellerTypes(nodeIdPath: string, marketplace?: string, month?: string, topN?: number): Promise; getSpEbc(nodeIdPath: string, marketplace?: string, month?: string, topN?: number): Promise; getSpProductConcentration(nodeIdPath: string, marketplace?: string, month?: string, topN?: number): Promise; getSpGoogleTrend(keyword: string, marketplace?: string): Promise; getSpAbaWeekly(keyword: string, marketplace?: string): Promise; getSpAbaMonthly(keyword: string, marketplace?: string): Promise; getSpAbaTrend(keyword: string, marketplace?: string): Promise; /** * IP infringement pre-screen via Zhihuiya patent image search */ ipCheck(params: { imageUrl?: string; imageData?: string; contentType?: string; productUrl?: string; country: string; platform: string; limit?: number; }): Promise; /** * Health check */ health(): Promise<{ status: string; timestamp: string; environment: string; }>; /** * 拿可播放视频 + metadata (完整 pipeline) */ fetchWechatChannelsVideo(opts: { url?: string; exportId?: string; }): Promise; /** * 只拿 metadata, 不下载/解密视频 (省 S3 流量) */ fetchWechatChannelsMetadata(opts: { url?: string; exportId?: string; }): Promise; } export declare const api: ApiClient; //# sourceMappingURL=api.d.ts.map