scavio 0.18.0 → 0.19.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
@@ -4414,6 +4414,147 @@ declare class CostcoNamespace {
4414
4414
  autocomplete(options: CostcoAutocompleteOptions): Promise<Record<string, unknown>>;
4415
4415
  }
4416
4416
 
4417
+ type TrustpilotReviewsDateRange = "last30days" | "last3months" | "last6months" | "last12months";
4418
+ type TrustpilotReviewsSort = "recency" | "relevance";
4419
+ type TrustpilotCategorySort = "most_relevant" | "reviews_count" | "latest_review";
4420
+ type TrustpilotStars = 1 | 2 | 3 | 4 | 5;
4421
+ interface TrustpilotSearchOptions {
4422
+ /** Business name, keyword or category (1-200 characters). */
4423
+ query: string;
4424
+ /** 2-letter country code to search in (default "US"). */
4425
+ country?: string;
4426
+ /** Results page, 1-based (1-1000). */
4427
+ page?: number;
4428
+ /** Businesses per page (1-100, default 20). */
4429
+ page_size?: number;
4430
+ [key: string]: unknown;
4431
+ }
4432
+ /** A business address: pass exactly one of domain or url. */
4433
+ interface TrustpilotBusinessAddress {
4434
+ /** The business's website domain as listed on Trustpilot (e.g. "www.amazon.com"). */
4435
+ domain?: string;
4436
+ /** A trustpilot.com/review/<domain> page URL, from any Trustpilot country site. */
4437
+ url?: string;
4438
+ }
4439
+ interface TrustpilotBusinessOptions extends TrustpilotBusinessAddress {
4440
+ /**
4441
+ * 2-letter language code (default "en"). The 20 included reviews are this
4442
+ * language's newest, and the AI summary and topics come back in it when
4443
+ * Trustpilot has them for that language (null / empty otherwise). The rating
4444
+ * distribution and review-language breakdown cover every language.
4445
+ */
4446
+ language?: string;
4447
+ [key: string]: unknown;
4448
+ }
4449
+ interface TrustpilotReviewsOptions extends TrustpilotBusinessAddress {
4450
+ /** Reviews page, 1-10 (20 per page). */
4451
+ page?: number;
4452
+ /** Only reviews with these star ratings (e.g. [1, 2]). */
4453
+ stars?: TrustpilotStars[];
4454
+ /** Review language (2-letter code) or "all" (default "all"). */
4455
+ language?: string;
4456
+ /** Only reviews published in this window. */
4457
+ date_range?: TrustpilotReviewsDateRange;
4458
+ /** Review order (default "recency"). */
4459
+ sort?: TrustpilotReviewsSort;
4460
+ /** Only verified reviews. */
4461
+ verified_only?: boolean;
4462
+ /** Only reviews the business replied to. */
4463
+ with_replies?: boolean;
4464
+ /** Topic ids from business()'s topics, up to 10 (e.g. ["delivery_service"]). */
4465
+ topics?: string[];
4466
+ /** Only reviews containing this text (1-100 characters). */
4467
+ search?: string;
4468
+ [key: string]: unknown;
4469
+ }
4470
+ interface TrustpilotCategoriesOptions {
4471
+ /** Find categories by name (1-100 characters). Omit for the full tree. */
4472
+ query?: string;
4473
+ /** 2-letter country code for the name lookup (default "US"). */
4474
+ country?: string;
4475
+ [key: string]: unknown;
4476
+ }
4477
+ interface TrustpilotCategoryOptions {
4478
+ /** Category id from categories() (e.g. "vpn_service"). */
4479
+ category_id: string;
4480
+ /** 2-letter country code (default "US"). */
4481
+ country?: string;
4482
+ /** Result order (default "most_relevant"). */
4483
+ sort?: TrustpilotCategorySort;
4484
+ /**
4485
+ * Minimum star rating: 3, 4 or 4.5. Trustpilot rounds TrustScore to stars,
4486
+ * so 4 includes TrustScore 3.8 and up.
4487
+ */
4488
+ min_trust_score?: 3 | 4 | 4.5;
4489
+ /** Only businesses that have claimed their Trustpilot profile. */
4490
+ claimed_only?: boolean;
4491
+ /** Results page, 1-based (20 businesses per page). */
4492
+ page?: number;
4493
+ [key: string]: unknown;
4494
+ }
4495
+ interface TrustpilotReviewOptions {
4496
+ /** 24-character review id, as returned in review_id by business() or reviews(). */
4497
+ review_id: string;
4498
+ [key: string]: unknown;
4499
+ }
4500
+ declare class TrustpilotNamespace {
4501
+ private client;
4502
+ constructor(client: Scavio);
4503
+ /**
4504
+ * Search Trustpilot businesses by keyword in one country: TrustScore, star
4505
+ * rating, review count, categories, website, and the email, phone and
4506
+ * address the business published. Up to 100 businesses per page.
4507
+ *
4508
+ * Costs 2 credits.
4509
+ */
4510
+ search(options: TrustpilotSearchOptions): Promise<Record<string, unknown>>;
4511
+ /**
4512
+ * A Trustpilot business profile: TrustScore, rating distribution, review
4513
+ * languages, categories, contact details, claimed and verification status,
4514
+ * reply rate and reply speed on negative reviews, consumer alerts, the AI
4515
+ * review summary and topics, similar businesses, and the 20 newest reviews
4516
+ * in the chosen language. Pass exactly one of domain or url.
4517
+ *
4518
+ * Costs 2 credits.
4519
+ */
4520
+ business(options: TrustpilotBusinessOptions): Promise<Record<string, unknown>>;
4521
+ /**
4522
+ * One page of 20 Trustpilot reviews for a business, filtered by stars,
4523
+ * language, date range, topics, text search, verified-only and
4524
+ * with-replies, sorted by recency or relevance. Returns total_filtered, so a
4525
+ * date range doubles as review velocity. Up to 10 pages (200 reviews) per
4526
+ * filter combination. Pass exactly one of domain or url.
4527
+ *
4528
+ * Costs 2 credits.
4529
+ */
4530
+ reviews(options: TrustpilotReviewsOptions): Promise<Record<string, unknown>>;
4531
+ /**
4532
+ * The full Trustpilot category tree (top-level categories and their
4533
+ * subcategories), or categories matching a name. Every category_id works
4534
+ * with category().
4535
+ *
4536
+ * Costs 2 credits.
4537
+ */
4538
+ categories(options?: TrustpilotCategoriesOptions): Promise<Record<string, unknown>>;
4539
+ /**
4540
+ * Businesses ranked in a Trustpilot category for one country, with
4541
+ * TrustScore, review count, location, website, email and phone. Sort by
4542
+ * relevance, review count or latest review, set a minimum star rating, or
4543
+ * keep claimed profiles only. 20 per page.
4544
+ *
4545
+ * Costs 2 credits.
4546
+ */
4547
+ category(options: TrustpilotCategoryOptions): Promise<Record<string, unknown>>;
4548
+ /**
4549
+ * One Trustpilot review by id: rating, title, full text, dates,
4550
+ * verification, the reviewer's public profile summary, the business reply,
4551
+ * and the business it is about.
4552
+ *
4553
+ * Costs 2 credits.
4554
+ */
4555
+ review(options: TrustpilotReviewOptions): Promise<Record<string, unknown>>;
4556
+ }
4557
+
4417
4558
  /**
4418
4559
  * Default client-side rate limit, safe on every plan including free.
4419
4560
  */
@@ -4498,6 +4639,7 @@ declare class Scavio {
4498
4639
  readonly googleAds: GoogleAdsNamespace;
4499
4640
  readonly metaAds: MetaAdsNamespace;
4500
4641
  readonly costco: CostcoNamespace;
4642
+ readonly trustpilot: TrustpilotNamespace;
4501
4643
  private readonly apiKey;
4502
4644
  private readonly baseUrl;
4503
4645
  private readonly timeout;
@@ -4584,4 +4726,4 @@ declare class ScavioAPIError extends ScavioError {
4584
4726
  constructor(statusCode: number, message: string, responseBody?: Record<string, unknown>);
4585
4727
  }
4586
4728
 
4587
- export { type AirbnbListingOptions, AirbnbNamespace, type AirbnbReviewsOptions, type AirbnbSearchOptions, AmazonNamespace, type AmazonOffersOptions, type AmazonProductOptions, type AmazonSearchOptions, type AppStoreAppOptions, AppStoreNamespace, type AppStoreReviewsOptions, type AppStoreSearchOptions, BadRequestError, type BookingHotelOptions, BookingNamespace, type BookingReviewsOptions, type BookingSearchOptions, CapterraNamespace, type CapterraProductOptions, type CapterraReviewsOptions, type CapterraSearchOptions, type CompaniesHouseCompanyOptions, type CompaniesHouseFilingHistoryOptions, CompaniesHouseNamespace, type CompaniesHouseOfficersOptions, type CompaniesHouseSearchOptions, type CostcoAutocompleteOptions, type CostcoAvailabilityOptions, type CostcoCategoriesOptions, type CostcoCategoryOptions, type CostcoClearanceOptions, type CostcoCountry, type CostcoCouponsOptions, type CostcoDealType, type CostcoDealsOptions, type CostcoGasOptions, type CostcoListingFilters, type CostcoNaCountry, CostcoNamespace, type CostcoPriceCode, type CostcoPricesOptions, type CostcoProductOptions, type CostcoReviewsOptions, type CostcoSearchOptions, type CostcoSortBy, type CostcoWarehousesOptions, DEFAULT_MAX_REQUESTS_PER_SECOND, EbayNamespace, type EbayProductOptions, type EbaySearchOptions, type EbaySellerOptions, type ExtractOptions, G2Namespace, type G2ProductOptions, type G2ReviewsOptions, type G2SearchOptions, type GlassdoorCompaniesOptions, type GlassdoorCompanyOptions, GlassdoorNamespace, type GlassdoorReviewsOptions, type GlassdoorSalariesOptions, type GoogleAdsAdvertisersOptions, type GoogleAdsCreativeOptions, GoogleAdsNamespace, type GoogleAdsSearchOptions, type GoogleAiModeOptions, type GoogleFlightsOptions, type GoogleHotelsDetailOptions, type GoogleHotelsOptions, type GoogleMapsPlaceOptions, type GoogleMapsReviewsOptions, type GoogleMapsSearchOptions, GoogleNamespace, type GoogleNewsOptions, type GooglePlayAppOptions, GooglePlayNamespace, type GooglePlayReviewsOptions, type GooglePlaySearchOptions, type GoogleSearchOptions, type GoogleShoppingOptions, type GoogleShoppingProductOptions, type GoogleShoppingStoresOptions, type GoogleTrendingOptions, type GoogleTrendsOptions, HomeDepotNamespace, type HomeDepotProductOptions, type HomeDepotReviewsOptions, type HomeDepotSearchOptions, type IndeedCompanyOptions, type IndeedCompanyReviewsOptions, type IndeedJobOptions, IndeedNamespace, type IndeedSearchOptions, type InstagramCommentRepliesOptions, type InstagramFollowOptions, InstagramNamespace, type InstagramPostCommentsOptions, type InstagramPostOptions, type InstagramProfileOptions, type InstagramSearchOptions, type InstagramStoriesOptions, type InstagramUserFeedOptions, InsufficientCreditsError, InvalidAPIKeyError, type KuaishouCommentRepliesOptions, KuaishouNamespace, type KuaishouProfileOptions, type KuaishouSearchLiveOptions, type KuaishouSearchOptions, type KuaishouSearchUsersOptions, type KuaishouSearchVideosOptions, type KuaishouTagFeedOptions, type KuaishouTrendingOptions, type KuaishouUserLiveOptions, type KuaishouUserPostsOptions, type KuaishouUserResolveOptions, type KuaishouVideoCommentsOptions, type KuaishouVideoOptions, type KuaishouVideosBatchOptions, type LinkedInCompanyOptions, type LinkedInCompanyPostsOptions, type LinkedInCompanyPostsRequest, type LinkedInCompanyRefOptions, type LinkedInJobOptions, LinkedInNamespace, type LinkedInPersonContactOptions, type LinkedInPersonOptions, type LinkedInPersonPostsOptions, type LinkedInPersonPostsRequest, type LinkedInPersonRefOptions, type LinkedInPostCommentsOptions, type LinkedInPostOptions, type LinkedInSearchJobsOptions, type LinkedInSearchPeopleOptions, type LinkedInSearchPostsOptions, MAX_REQUESTS_PER_SECOND, type MetaAdsAdOptions, type MetaAdsAdvertiserOptions, MetaAdsNamespace, type MetaAdsSearchOptions, MissingAPIKeyError, NotFoundError, RateLimitError, type RedditCommentRepliesOptions, type RedditFeedSort, RedditNamespace, type RedditPopularOptions, type RedditPostCommentsOptions, type RedditPostOptions, type RedditSearchOptions, type RedditSearchSuggestionsOptions, type RedditSort, type RedditSubredditOptions, type RedditSubredditPostsOptions, type RedditUserFeedOptions, type RedditUserOptions, type RedfinMarketOptions, RedfinNamespace, type RedfinPropertyOptions, type RedfinSearchOptions, type SECCompanyOptions, type SECConceptOptions, type SECFactsOptions, type SECFilingsOptions, type SECLookupOptions, SECNamespace, type SECSearchOptions, Scavio, ScavioAPIError, type ScavioConfig, ScavioConnectionError, ScavioError, ScavioTimeoutError, type TargetCategoryOptions, TargetNamespace, type TargetProductOptions, type TargetReviewsOptions, type TargetSearchOptions, ThreadsNamespace, type ThreadsPostCommentsOptions, type ThreadsPostOptions, type ThreadsProfileOptions, type ThreadsSearchUsersOptions, type ThreadsUserPostsOptions, type ThreadsUserRepliesOptions, type TikTokCommentRepliesOptions, type TikTokHashtagOptions, type TikTokHashtagVideosOptions, TikTokNamespace, type TikTokProfileOptions, type TikTokSearchUsersOptions, type TikTokSearchVideosOptions, type TikTokShopCategoryProductsOptions, type TikTokShopListingRegion, TikTokShopNamespace, 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 TripadvisorLocationOptions, type TripadvisorLocationsOptions, TripadvisorNamespace, type TripadvisorReviewsOptions, type TripadvisorSearchOptions, type WalmartCategoryOptions, WalmartNamespace, type WalmartOffersOptions, type WalmartProductOptions, type WalmartReviewsOptions, type WalmartSearchOptions, type WalmartSellerOptions, type WalmartSellerProductsOptions, type WalmartStore, type WalmartStoresData, type WalmartStoresOptions, type WalmartStoresResponse, XNamespace, type XSearchOptions, type XTrendingOptions, type XTweetCommentsOptions, type XTweetOptions, type XTweetRetweetersOptions, type XUserFeedOptions, type XUserOptions, type YelpBusinessOptions, YelpNamespace, type YelpReviewsOptions, type YelpSearchOptions, type YouTubeChannelCommunityOptions, type YouTubeChannelOptions, type YouTubeChannelResolveOptions, type YouTubeChannelSearchOptions, type YouTubeChannelShortsOptions, type YouTubeChannelVideosOptions, type YouTubeCommentRepliesOptions, type YouTubeCommentsOptions, type YouTubeMetadataOptions, YouTubeNamespace, type YouTubeRelatedOptions, type YouTubeSearchOptions, type YouTubeShortsOptions, type YouTubeStreamsOptions, type YouTubeSuggestionsOptions, type YouTubeTranscriptOptions, type YouTubeVideoOptions, type ZillowAgentReviewsOptions, ZillowNamespace, type ZillowPropertyOptions, type ZillowSearchOptions };
4729
+ export { type AirbnbListingOptions, AirbnbNamespace, type AirbnbReviewsOptions, type AirbnbSearchOptions, AmazonNamespace, type AmazonOffersOptions, type AmazonProductOptions, type AmazonSearchOptions, type AppStoreAppOptions, AppStoreNamespace, type AppStoreReviewsOptions, type AppStoreSearchOptions, BadRequestError, type BookingHotelOptions, BookingNamespace, type BookingReviewsOptions, type BookingSearchOptions, CapterraNamespace, type CapterraProductOptions, type CapterraReviewsOptions, type CapterraSearchOptions, type CompaniesHouseCompanyOptions, type CompaniesHouseFilingHistoryOptions, CompaniesHouseNamespace, type CompaniesHouseOfficersOptions, type CompaniesHouseSearchOptions, type CostcoAutocompleteOptions, type CostcoAvailabilityOptions, type CostcoCategoriesOptions, type CostcoCategoryOptions, type CostcoClearanceOptions, type CostcoCountry, type CostcoCouponsOptions, type CostcoDealType, type CostcoDealsOptions, type CostcoGasOptions, type CostcoListingFilters, type CostcoNaCountry, CostcoNamespace, type CostcoPriceCode, type CostcoPricesOptions, type CostcoProductOptions, type CostcoReviewsOptions, type CostcoSearchOptions, type CostcoSortBy, type CostcoWarehousesOptions, DEFAULT_MAX_REQUESTS_PER_SECOND, EbayNamespace, type EbayProductOptions, type EbaySearchOptions, type EbaySellerOptions, type ExtractOptions, G2Namespace, type G2ProductOptions, type G2ReviewsOptions, type G2SearchOptions, type GlassdoorCompaniesOptions, type GlassdoorCompanyOptions, GlassdoorNamespace, type GlassdoorReviewsOptions, type GlassdoorSalariesOptions, type GoogleAdsAdvertisersOptions, type GoogleAdsCreativeOptions, GoogleAdsNamespace, type GoogleAdsSearchOptions, type GoogleAiModeOptions, type GoogleFlightsOptions, type GoogleHotelsDetailOptions, type GoogleHotelsOptions, type GoogleMapsPlaceOptions, type GoogleMapsReviewsOptions, type GoogleMapsSearchOptions, GoogleNamespace, type GoogleNewsOptions, type GooglePlayAppOptions, GooglePlayNamespace, type GooglePlayReviewsOptions, type GooglePlaySearchOptions, type GoogleSearchOptions, type GoogleShoppingOptions, type GoogleShoppingProductOptions, type GoogleShoppingStoresOptions, type GoogleTrendingOptions, type GoogleTrendsOptions, HomeDepotNamespace, type HomeDepotProductOptions, type HomeDepotReviewsOptions, type HomeDepotSearchOptions, type IndeedCompanyOptions, type IndeedCompanyReviewsOptions, type IndeedJobOptions, IndeedNamespace, type IndeedSearchOptions, type InstagramCommentRepliesOptions, type InstagramFollowOptions, InstagramNamespace, type InstagramPostCommentsOptions, type InstagramPostOptions, type InstagramProfileOptions, type InstagramSearchOptions, type InstagramStoriesOptions, type InstagramUserFeedOptions, InsufficientCreditsError, InvalidAPIKeyError, type KuaishouCommentRepliesOptions, KuaishouNamespace, type KuaishouProfileOptions, type KuaishouSearchLiveOptions, type KuaishouSearchOptions, type KuaishouSearchUsersOptions, type KuaishouSearchVideosOptions, type KuaishouTagFeedOptions, type KuaishouTrendingOptions, type KuaishouUserLiveOptions, type KuaishouUserPostsOptions, type KuaishouUserResolveOptions, type KuaishouVideoCommentsOptions, type KuaishouVideoOptions, type KuaishouVideosBatchOptions, type LinkedInCompanyOptions, type LinkedInCompanyPostsOptions, type LinkedInCompanyPostsRequest, type LinkedInCompanyRefOptions, type LinkedInJobOptions, LinkedInNamespace, type LinkedInPersonContactOptions, type LinkedInPersonOptions, type LinkedInPersonPostsOptions, type LinkedInPersonPostsRequest, type LinkedInPersonRefOptions, type LinkedInPostCommentsOptions, type LinkedInPostOptions, type LinkedInSearchJobsOptions, type LinkedInSearchPeopleOptions, type LinkedInSearchPostsOptions, MAX_REQUESTS_PER_SECOND, type MetaAdsAdOptions, type MetaAdsAdvertiserOptions, MetaAdsNamespace, type MetaAdsSearchOptions, MissingAPIKeyError, NotFoundError, RateLimitError, type RedditCommentRepliesOptions, type RedditFeedSort, RedditNamespace, type RedditPopularOptions, type RedditPostCommentsOptions, type RedditPostOptions, type RedditSearchOptions, type RedditSearchSuggestionsOptions, type RedditSort, type RedditSubredditOptions, type RedditSubredditPostsOptions, type RedditUserFeedOptions, type RedditUserOptions, type RedfinMarketOptions, RedfinNamespace, type RedfinPropertyOptions, type RedfinSearchOptions, type SECCompanyOptions, type SECConceptOptions, type SECFactsOptions, type SECFilingsOptions, type SECLookupOptions, SECNamespace, type SECSearchOptions, Scavio, ScavioAPIError, type ScavioConfig, ScavioConnectionError, ScavioError, ScavioTimeoutError, type TargetCategoryOptions, TargetNamespace, type TargetProductOptions, type TargetReviewsOptions, type TargetSearchOptions, ThreadsNamespace, type ThreadsPostCommentsOptions, type ThreadsPostOptions, type ThreadsProfileOptions, type ThreadsSearchUsersOptions, type ThreadsUserPostsOptions, type ThreadsUserRepliesOptions, type TikTokCommentRepliesOptions, type TikTokHashtagOptions, type TikTokHashtagVideosOptions, TikTokNamespace, type TikTokProfileOptions, type TikTokSearchUsersOptions, type TikTokSearchVideosOptions, type TikTokShopCategoryProductsOptions, type TikTokShopListingRegion, TikTokShopNamespace, 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 TripadvisorLocationOptions, type TripadvisorLocationsOptions, TripadvisorNamespace, type TripadvisorReviewsOptions, type TripadvisorSearchOptions, type TrustpilotBusinessAddress, type TrustpilotBusinessOptions, type TrustpilotCategoriesOptions, type TrustpilotCategoryOptions, type TrustpilotCategorySort, TrustpilotNamespace, type TrustpilotReviewOptions, type TrustpilotReviewsDateRange, type TrustpilotReviewsOptions, type TrustpilotReviewsSort, type TrustpilotSearchOptions, type TrustpilotStars, type WalmartCategoryOptions, WalmartNamespace, type WalmartOffersOptions, type WalmartProductOptions, type WalmartReviewsOptions, type WalmartSearchOptions, type WalmartSellerOptions, type WalmartSellerProductsOptions, type WalmartStore, type WalmartStoresData, type WalmartStoresOptions, type WalmartStoresResponse, XNamespace, type XSearchOptions, type XTrendingOptions, type XTweetCommentsOptions, type XTweetOptions, type XTweetRetweetersOptions, type XUserFeedOptions, type XUserOptions, type YelpBusinessOptions, YelpNamespace, type YelpReviewsOptions, type YelpSearchOptions, type YouTubeChannelCommunityOptions, type YouTubeChannelOptions, type YouTubeChannelResolveOptions, type YouTubeChannelSearchOptions, type YouTubeChannelShortsOptions, type YouTubeChannelVideosOptions, type YouTubeCommentRepliesOptions, type YouTubeCommentsOptions, type YouTubeMetadataOptions, YouTubeNamespace, type YouTubeRelatedOptions, type YouTubeSearchOptions, type YouTubeShortsOptions, type YouTubeStreamsOptions, type YouTubeSuggestionsOptions, type YouTubeTranscriptOptions, type YouTubeVideoOptions, type ZillowAgentReviewsOptions, ZillowNamespace, type ZillowPropertyOptions, type ZillowSearchOptions };
package/dist/index.d.ts CHANGED
@@ -4414,6 +4414,147 @@ declare class CostcoNamespace {
4414
4414
  autocomplete(options: CostcoAutocompleteOptions): Promise<Record<string, unknown>>;
4415
4415
  }
4416
4416
 
4417
+ type TrustpilotReviewsDateRange = "last30days" | "last3months" | "last6months" | "last12months";
4418
+ type TrustpilotReviewsSort = "recency" | "relevance";
4419
+ type TrustpilotCategorySort = "most_relevant" | "reviews_count" | "latest_review";
4420
+ type TrustpilotStars = 1 | 2 | 3 | 4 | 5;
4421
+ interface TrustpilotSearchOptions {
4422
+ /** Business name, keyword or category (1-200 characters). */
4423
+ query: string;
4424
+ /** 2-letter country code to search in (default "US"). */
4425
+ country?: string;
4426
+ /** Results page, 1-based (1-1000). */
4427
+ page?: number;
4428
+ /** Businesses per page (1-100, default 20). */
4429
+ page_size?: number;
4430
+ [key: string]: unknown;
4431
+ }
4432
+ /** A business address: pass exactly one of domain or url. */
4433
+ interface TrustpilotBusinessAddress {
4434
+ /** The business's website domain as listed on Trustpilot (e.g. "www.amazon.com"). */
4435
+ domain?: string;
4436
+ /** A trustpilot.com/review/<domain> page URL, from any Trustpilot country site. */
4437
+ url?: string;
4438
+ }
4439
+ interface TrustpilotBusinessOptions extends TrustpilotBusinessAddress {
4440
+ /**
4441
+ * 2-letter language code (default "en"). The 20 included reviews are this
4442
+ * language's newest, and the AI summary and topics come back in it when
4443
+ * Trustpilot has them for that language (null / empty otherwise). The rating
4444
+ * distribution and review-language breakdown cover every language.
4445
+ */
4446
+ language?: string;
4447
+ [key: string]: unknown;
4448
+ }
4449
+ interface TrustpilotReviewsOptions extends TrustpilotBusinessAddress {
4450
+ /** Reviews page, 1-10 (20 per page). */
4451
+ page?: number;
4452
+ /** Only reviews with these star ratings (e.g. [1, 2]). */
4453
+ stars?: TrustpilotStars[];
4454
+ /** Review language (2-letter code) or "all" (default "all"). */
4455
+ language?: string;
4456
+ /** Only reviews published in this window. */
4457
+ date_range?: TrustpilotReviewsDateRange;
4458
+ /** Review order (default "recency"). */
4459
+ sort?: TrustpilotReviewsSort;
4460
+ /** Only verified reviews. */
4461
+ verified_only?: boolean;
4462
+ /** Only reviews the business replied to. */
4463
+ with_replies?: boolean;
4464
+ /** Topic ids from business()'s topics, up to 10 (e.g. ["delivery_service"]). */
4465
+ topics?: string[];
4466
+ /** Only reviews containing this text (1-100 characters). */
4467
+ search?: string;
4468
+ [key: string]: unknown;
4469
+ }
4470
+ interface TrustpilotCategoriesOptions {
4471
+ /** Find categories by name (1-100 characters). Omit for the full tree. */
4472
+ query?: string;
4473
+ /** 2-letter country code for the name lookup (default "US"). */
4474
+ country?: string;
4475
+ [key: string]: unknown;
4476
+ }
4477
+ interface TrustpilotCategoryOptions {
4478
+ /** Category id from categories() (e.g. "vpn_service"). */
4479
+ category_id: string;
4480
+ /** 2-letter country code (default "US"). */
4481
+ country?: string;
4482
+ /** Result order (default "most_relevant"). */
4483
+ sort?: TrustpilotCategorySort;
4484
+ /**
4485
+ * Minimum star rating: 3, 4 or 4.5. Trustpilot rounds TrustScore to stars,
4486
+ * so 4 includes TrustScore 3.8 and up.
4487
+ */
4488
+ min_trust_score?: 3 | 4 | 4.5;
4489
+ /** Only businesses that have claimed their Trustpilot profile. */
4490
+ claimed_only?: boolean;
4491
+ /** Results page, 1-based (20 businesses per page). */
4492
+ page?: number;
4493
+ [key: string]: unknown;
4494
+ }
4495
+ interface TrustpilotReviewOptions {
4496
+ /** 24-character review id, as returned in review_id by business() or reviews(). */
4497
+ review_id: string;
4498
+ [key: string]: unknown;
4499
+ }
4500
+ declare class TrustpilotNamespace {
4501
+ private client;
4502
+ constructor(client: Scavio);
4503
+ /**
4504
+ * Search Trustpilot businesses by keyword in one country: TrustScore, star
4505
+ * rating, review count, categories, website, and the email, phone and
4506
+ * address the business published. Up to 100 businesses per page.
4507
+ *
4508
+ * Costs 2 credits.
4509
+ */
4510
+ search(options: TrustpilotSearchOptions): Promise<Record<string, unknown>>;
4511
+ /**
4512
+ * A Trustpilot business profile: TrustScore, rating distribution, review
4513
+ * languages, categories, contact details, claimed and verification status,
4514
+ * reply rate and reply speed on negative reviews, consumer alerts, the AI
4515
+ * review summary and topics, similar businesses, and the 20 newest reviews
4516
+ * in the chosen language. Pass exactly one of domain or url.
4517
+ *
4518
+ * Costs 2 credits.
4519
+ */
4520
+ business(options: TrustpilotBusinessOptions): Promise<Record<string, unknown>>;
4521
+ /**
4522
+ * One page of 20 Trustpilot reviews for a business, filtered by stars,
4523
+ * language, date range, topics, text search, verified-only and
4524
+ * with-replies, sorted by recency or relevance. Returns total_filtered, so a
4525
+ * date range doubles as review velocity. Up to 10 pages (200 reviews) per
4526
+ * filter combination. Pass exactly one of domain or url.
4527
+ *
4528
+ * Costs 2 credits.
4529
+ */
4530
+ reviews(options: TrustpilotReviewsOptions): Promise<Record<string, unknown>>;
4531
+ /**
4532
+ * The full Trustpilot category tree (top-level categories and their
4533
+ * subcategories), or categories matching a name. Every category_id works
4534
+ * with category().
4535
+ *
4536
+ * Costs 2 credits.
4537
+ */
4538
+ categories(options?: TrustpilotCategoriesOptions): Promise<Record<string, unknown>>;
4539
+ /**
4540
+ * Businesses ranked in a Trustpilot category for one country, with
4541
+ * TrustScore, review count, location, website, email and phone. Sort by
4542
+ * relevance, review count or latest review, set a minimum star rating, or
4543
+ * keep claimed profiles only. 20 per page.
4544
+ *
4545
+ * Costs 2 credits.
4546
+ */
4547
+ category(options: TrustpilotCategoryOptions): Promise<Record<string, unknown>>;
4548
+ /**
4549
+ * One Trustpilot review by id: rating, title, full text, dates,
4550
+ * verification, the reviewer's public profile summary, the business reply,
4551
+ * and the business it is about.
4552
+ *
4553
+ * Costs 2 credits.
4554
+ */
4555
+ review(options: TrustpilotReviewOptions): Promise<Record<string, unknown>>;
4556
+ }
4557
+
4417
4558
  /**
4418
4559
  * Default client-side rate limit, safe on every plan including free.
4419
4560
  */
@@ -4498,6 +4639,7 @@ declare class Scavio {
4498
4639
  readonly googleAds: GoogleAdsNamespace;
4499
4640
  readonly metaAds: MetaAdsNamespace;
4500
4641
  readonly costco: CostcoNamespace;
4642
+ readonly trustpilot: TrustpilotNamespace;
4501
4643
  private readonly apiKey;
4502
4644
  private readonly baseUrl;
4503
4645
  private readonly timeout;
@@ -4584,4 +4726,4 @@ declare class ScavioAPIError extends ScavioError {
4584
4726
  constructor(statusCode: number, message: string, responseBody?: Record<string, unknown>);
4585
4727
  }
4586
4728
 
4587
- export { type AirbnbListingOptions, AirbnbNamespace, type AirbnbReviewsOptions, type AirbnbSearchOptions, AmazonNamespace, type AmazonOffersOptions, type AmazonProductOptions, type AmazonSearchOptions, type AppStoreAppOptions, AppStoreNamespace, type AppStoreReviewsOptions, type AppStoreSearchOptions, BadRequestError, type BookingHotelOptions, BookingNamespace, type BookingReviewsOptions, type BookingSearchOptions, CapterraNamespace, type CapterraProductOptions, type CapterraReviewsOptions, type CapterraSearchOptions, type CompaniesHouseCompanyOptions, type CompaniesHouseFilingHistoryOptions, CompaniesHouseNamespace, type CompaniesHouseOfficersOptions, type CompaniesHouseSearchOptions, type CostcoAutocompleteOptions, type CostcoAvailabilityOptions, type CostcoCategoriesOptions, type CostcoCategoryOptions, type CostcoClearanceOptions, type CostcoCountry, type CostcoCouponsOptions, type CostcoDealType, type CostcoDealsOptions, type CostcoGasOptions, type CostcoListingFilters, type CostcoNaCountry, CostcoNamespace, type CostcoPriceCode, type CostcoPricesOptions, type CostcoProductOptions, type CostcoReviewsOptions, type CostcoSearchOptions, type CostcoSortBy, type CostcoWarehousesOptions, DEFAULT_MAX_REQUESTS_PER_SECOND, EbayNamespace, type EbayProductOptions, type EbaySearchOptions, type EbaySellerOptions, type ExtractOptions, G2Namespace, type G2ProductOptions, type G2ReviewsOptions, type G2SearchOptions, type GlassdoorCompaniesOptions, type GlassdoorCompanyOptions, GlassdoorNamespace, type GlassdoorReviewsOptions, type GlassdoorSalariesOptions, type GoogleAdsAdvertisersOptions, type GoogleAdsCreativeOptions, GoogleAdsNamespace, type GoogleAdsSearchOptions, type GoogleAiModeOptions, type GoogleFlightsOptions, type GoogleHotelsDetailOptions, type GoogleHotelsOptions, type GoogleMapsPlaceOptions, type GoogleMapsReviewsOptions, type GoogleMapsSearchOptions, GoogleNamespace, type GoogleNewsOptions, type GooglePlayAppOptions, GooglePlayNamespace, type GooglePlayReviewsOptions, type GooglePlaySearchOptions, type GoogleSearchOptions, type GoogleShoppingOptions, type GoogleShoppingProductOptions, type GoogleShoppingStoresOptions, type GoogleTrendingOptions, type GoogleTrendsOptions, HomeDepotNamespace, type HomeDepotProductOptions, type HomeDepotReviewsOptions, type HomeDepotSearchOptions, type IndeedCompanyOptions, type IndeedCompanyReviewsOptions, type IndeedJobOptions, IndeedNamespace, type IndeedSearchOptions, type InstagramCommentRepliesOptions, type InstagramFollowOptions, InstagramNamespace, type InstagramPostCommentsOptions, type InstagramPostOptions, type InstagramProfileOptions, type InstagramSearchOptions, type InstagramStoriesOptions, type InstagramUserFeedOptions, InsufficientCreditsError, InvalidAPIKeyError, type KuaishouCommentRepliesOptions, KuaishouNamespace, type KuaishouProfileOptions, type KuaishouSearchLiveOptions, type KuaishouSearchOptions, type KuaishouSearchUsersOptions, type KuaishouSearchVideosOptions, type KuaishouTagFeedOptions, type KuaishouTrendingOptions, type KuaishouUserLiveOptions, type KuaishouUserPostsOptions, type KuaishouUserResolveOptions, type KuaishouVideoCommentsOptions, type KuaishouVideoOptions, type KuaishouVideosBatchOptions, type LinkedInCompanyOptions, type LinkedInCompanyPostsOptions, type LinkedInCompanyPostsRequest, type LinkedInCompanyRefOptions, type LinkedInJobOptions, LinkedInNamespace, type LinkedInPersonContactOptions, type LinkedInPersonOptions, type LinkedInPersonPostsOptions, type LinkedInPersonPostsRequest, type LinkedInPersonRefOptions, type LinkedInPostCommentsOptions, type LinkedInPostOptions, type LinkedInSearchJobsOptions, type LinkedInSearchPeopleOptions, type LinkedInSearchPostsOptions, MAX_REQUESTS_PER_SECOND, type MetaAdsAdOptions, type MetaAdsAdvertiserOptions, MetaAdsNamespace, type MetaAdsSearchOptions, MissingAPIKeyError, NotFoundError, RateLimitError, type RedditCommentRepliesOptions, type RedditFeedSort, RedditNamespace, type RedditPopularOptions, type RedditPostCommentsOptions, type RedditPostOptions, type RedditSearchOptions, type RedditSearchSuggestionsOptions, type RedditSort, type RedditSubredditOptions, type RedditSubredditPostsOptions, type RedditUserFeedOptions, type RedditUserOptions, type RedfinMarketOptions, RedfinNamespace, type RedfinPropertyOptions, type RedfinSearchOptions, type SECCompanyOptions, type SECConceptOptions, type SECFactsOptions, type SECFilingsOptions, type SECLookupOptions, SECNamespace, type SECSearchOptions, Scavio, ScavioAPIError, type ScavioConfig, ScavioConnectionError, ScavioError, ScavioTimeoutError, type TargetCategoryOptions, TargetNamespace, type TargetProductOptions, type TargetReviewsOptions, type TargetSearchOptions, ThreadsNamespace, type ThreadsPostCommentsOptions, type ThreadsPostOptions, type ThreadsProfileOptions, type ThreadsSearchUsersOptions, type ThreadsUserPostsOptions, type ThreadsUserRepliesOptions, type TikTokCommentRepliesOptions, type TikTokHashtagOptions, type TikTokHashtagVideosOptions, TikTokNamespace, type TikTokProfileOptions, type TikTokSearchUsersOptions, type TikTokSearchVideosOptions, type TikTokShopCategoryProductsOptions, type TikTokShopListingRegion, TikTokShopNamespace, 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 TripadvisorLocationOptions, type TripadvisorLocationsOptions, TripadvisorNamespace, type TripadvisorReviewsOptions, type TripadvisorSearchOptions, type WalmartCategoryOptions, WalmartNamespace, type WalmartOffersOptions, type WalmartProductOptions, type WalmartReviewsOptions, type WalmartSearchOptions, type WalmartSellerOptions, type WalmartSellerProductsOptions, type WalmartStore, type WalmartStoresData, type WalmartStoresOptions, type WalmartStoresResponse, XNamespace, type XSearchOptions, type XTrendingOptions, type XTweetCommentsOptions, type XTweetOptions, type XTweetRetweetersOptions, type XUserFeedOptions, type XUserOptions, type YelpBusinessOptions, YelpNamespace, type YelpReviewsOptions, type YelpSearchOptions, type YouTubeChannelCommunityOptions, type YouTubeChannelOptions, type YouTubeChannelResolveOptions, type YouTubeChannelSearchOptions, type YouTubeChannelShortsOptions, type YouTubeChannelVideosOptions, type YouTubeCommentRepliesOptions, type YouTubeCommentsOptions, type YouTubeMetadataOptions, YouTubeNamespace, type YouTubeRelatedOptions, type YouTubeSearchOptions, type YouTubeShortsOptions, type YouTubeStreamsOptions, type YouTubeSuggestionsOptions, type YouTubeTranscriptOptions, type YouTubeVideoOptions, type ZillowAgentReviewsOptions, ZillowNamespace, type ZillowPropertyOptions, type ZillowSearchOptions };
4729
+ export { type AirbnbListingOptions, AirbnbNamespace, type AirbnbReviewsOptions, type AirbnbSearchOptions, AmazonNamespace, type AmazonOffersOptions, type AmazonProductOptions, type AmazonSearchOptions, type AppStoreAppOptions, AppStoreNamespace, type AppStoreReviewsOptions, type AppStoreSearchOptions, BadRequestError, type BookingHotelOptions, BookingNamespace, type BookingReviewsOptions, type BookingSearchOptions, CapterraNamespace, type CapterraProductOptions, type CapterraReviewsOptions, type CapterraSearchOptions, type CompaniesHouseCompanyOptions, type CompaniesHouseFilingHistoryOptions, CompaniesHouseNamespace, type CompaniesHouseOfficersOptions, type CompaniesHouseSearchOptions, type CostcoAutocompleteOptions, type CostcoAvailabilityOptions, type CostcoCategoriesOptions, type CostcoCategoryOptions, type CostcoClearanceOptions, type CostcoCountry, type CostcoCouponsOptions, type CostcoDealType, type CostcoDealsOptions, type CostcoGasOptions, type CostcoListingFilters, type CostcoNaCountry, CostcoNamespace, type CostcoPriceCode, type CostcoPricesOptions, type CostcoProductOptions, type CostcoReviewsOptions, type CostcoSearchOptions, type CostcoSortBy, type CostcoWarehousesOptions, DEFAULT_MAX_REQUESTS_PER_SECOND, EbayNamespace, type EbayProductOptions, type EbaySearchOptions, type EbaySellerOptions, type ExtractOptions, G2Namespace, type G2ProductOptions, type G2ReviewsOptions, type G2SearchOptions, type GlassdoorCompaniesOptions, type GlassdoorCompanyOptions, GlassdoorNamespace, type GlassdoorReviewsOptions, type GlassdoorSalariesOptions, type GoogleAdsAdvertisersOptions, type GoogleAdsCreativeOptions, GoogleAdsNamespace, type GoogleAdsSearchOptions, type GoogleAiModeOptions, type GoogleFlightsOptions, type GoogleHotelsDetailOptions, type GoogleHotelsOptions, type GoogleMapsPlaceOptions, type GoogleMapsReviewsOptions, type GoogleMapsSearchOptions, GoogleNamespace, type GoogleNewsOptions, type GooglePlayAppOptions, GooglePlayNamespace, type GooglePlayReviewsOptions, type GooglePlaySearchOptions, type GoogleSearchOptions, type GoogleShoppingOptions, type GoogleShoppingProductOptions, type GoogleShoppingStoresOptions, type GoogleTrendingOptions, type GoogleTrendsOptions, HomeDepotNamespace, type HomeDepotProductOptions, type HomeDepotReviewsOptions, type HomeDepotSearchOptions, type IndeedCompanyOptions, type IndeedCompanyReviewsOptions, type IndeedJobOptions, IndeedNamespace, type IndeedSearchOptions, type InstagramCommentRepliesOptions, type InstagramFollowOptions, InstagramNamespace, type InstagramPostCommentsOptions, type InstagramPostOptions, type InstagramProfileOptions, type InstagramSearchOptions, type InstagramStoriesOptions, type InstagramUserFeedOptions, InsufficientCreditsError, InvalidAPIKeyError, type KuaishouCommentRepliesOptions, KuaishouNamespace, type KuaishouProfileOptions, type KuaishouSearchLiveOptions, type KuaishouSearchOptions, type KuaishouSearchUsersOptions, type KuaishouSearchVideosOptions, type KuaishouTagFeedOptions, type KuaishouTrendingOptions, type KuaishouUserLiveOptions, type KuaishouUserPostsOptions, type KuaishouUserResolveOptions, type KuaishouVideoCommentsOptions, type KuaishouVideoOptions, type KuaishouVideosBatchOptions, type LinkedInCompanyOptions, type LinkedInCompanyPostsOptions, type LinkedInCompanyPostsRequest, type LinkedInCompanyRefOptions, type LinkedInJobOptions, LinkedInNamespace, type LinkedInPersonContactOptions, type LinkedInPersonOptions, type LinkedInPersonPostsOptions, type LinkedInPersonPostsRequest, type LinkedInPersonRefOptions, type LinkedInPostCommentsOptions, type LinkedInPostOptions, type LinkedInSearchJobsOptions, type LinkedInSearchPeopleOptions, type LinkedInSearchPostsOptions, MAX_REQUESTS_PER_SECOND, type MetaAdsAdOptions, type MetaAdsAdvertiserOptions, MetaAdsNamespace, type MetaAdsSearchOptions, MissingAPIKeyError, NotFoundError, RateLimitError, type RedditCommentRepliesOptions, type RedditFeedSort, RedditNamespace, type RedditPopularOptions, type RedditPostCommentsOptions, type RedditPostOptions, type RedditSearchOptions, type RedditSearchSuggestionsOptions, type RedditSort, type RedditSubredditOptions, type RedditSubredditPostsOptions, type RedditUserFeedOptions, type RedditUserOptions, type RedfinMarketOptions, RedfinNamespace, type RedfinPropertyOptions, type RedfinSearchOptions, type SECCompanyOptions, type SECConceptOptions, type SECFactsOptions, type SECFilingsOptions, type SECLookupOptions, SECNamespace, type SECSearchOptions, Scavio, ScavioAPIError, type ScavioConfig, ScavioConnectionError, ScavioError, ScavioTimeoutError, type TargetCategoryOptions, TargetNamespace, type TargetProductOptions, type TargetReviewsOptions, type TargetSearchOptions, ThreadsNamespace, type ThreadsPostCommentsOptions, type ThreadsPostOptions, type ThreadsProfileOptions, type ThreadsSearchUsersOptions, type ThreadsUserPostsOptions, type ThreadsUserRepliesOptions, type TikTokCommentRepliesOptions, type TikTokHashtagOptions, type TikTokHashtagVideosOptions, TikTokNamespace, type TikTokProfileOptions, type TikTokSearchUsersOptions, type TikTokSearchVideosOptions, type TikTokShopCategoryProductsOptions, type TikTokShopListingRegion, TikTokShopNamespace, 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 TripadvisorLocationOptions, type TripadvisorLocationsOptions, TripadvisorNamespace, type TripadvisorReviewsOptions, type TripadvisorSearchOptions, type TrustpilotBusinessAddress, type TrustpilotBusinessOptions, type TrustpilotCategoriesOptions, type TrustpilotCategoryOptions, type TrustpilotCategorySort, TrustpilotNamespace, type TrustpilotReviewOptions, type TrustpilotReviewsDateRange, type TrustpilotReviewsOptions, type TrustpilotReviewsSort, type TrustpilotSearchOptions, type TrustpilotStars, type WalmartCategoryOptions, WalmartNamespace, type WalmartOffersOptions, type WalmartProductOptions, type WalmartReviewsOptions, type WalmartSearchOptions, type WalmartSellerOptions, type WalmartSellerProductsOptions, type WalmartStore, type WalmartStoresData, type WalmartStoresOptions, type WalmartStoresResponse, XNamespace, type XSearchOptions, type XTrendingOptions, type XTweetCommentsOptions, type XTweetOptions, type XTweetRetweetersOptions, type XUserFeedOptions, type XUserOptions, type YelpBusinessOptions, YelpNamespace, type YelpReviewsOptions, type YelpSearchOptions, type YouTubeChannelCommunityOptions, type YouTubeChannelOptions, type YouTubeChannelResolveOptions, type YouTubeChannelSearchOptions, type YouTubeChannelShortsOptions, type YouTubeChannelVideosOptions, type YouTubeCommentRepliesOptions, type YouTubeCommentsOptions, type YouTubeMetadataOptions, YouTubeNamespace, type YouTubeRelatedOptions, type YouTubeSearchOptions, type YouTubeShortsOptions, type YouTubeStreamsOptions, type YouTubeSuggestionsOptions, type YouTubeTranscriptOptions, type YouTubeVideoOptions, type ZillowAgentReviewsOptions, ZillowNamespace, type ZillowPropertyOptions, type ZillowSearchOptions };
package/dist/index.js CHANGED
@@ -129,12 +129,25 @@ function parseRetryAfter(header) {
129
129
  var BASE_URL = "https://api.scavio.dev";
130
130
  var DEFAULT_TIMEOUT = 3e4;
131
131
  var DEFAULT_MAX_RETRIES = 2;
132
+ var SDK_VERSION = true ? "0.19.0" : "0.0.0";
133
+ var USER_AGENT = `scavio-js/${SDK_VERSION}`;
134
+ function isServerRuntime() {
135
+ const g = globalThis;
136
+ if (typeof g.window !== "undefined" && typeof g.document !== "undefined") {
137
+ return false;
138
+ }
139
+ return typeof g.process?.versions?.node === "string";
140
+ }
132
141
  function buildHeaders(apiKey) {
133
- return {
142
+ const headers = {
134
143
  Authorization: `Bearer ${apiKey}`,
135
144
  "Content-Type": "application/json",
136
145
  "X-Client-Source": "scavio-js"
137
146
  };
147
+ if (isServerRuntime()) {
148
+ headers["User-Agent"] = USER_AGENT;
149
+ }
150
+ return headers;
138
151
  }
139
152
  function stripUndefined(obj) {
140
153
  const result = {};
@@ -2392,6 +2405,79 @@ var CostcoNamespace = class {
2392
2405
  }
2393
2406
  };
2394
2407
 
2408
+ // src/namespaces/trustpilot.ts
2409
+ var TrustpilotNamespace = class {
2410
+ constructor(client) {
2411
+ this.client = client;
2412
+ }
2413
+ client;
2414
+ /**
2415
+ * Search Trustpilot businesses by keyword in one country: TrustScore, star
2416
+ * rating, review count, categories, website, and the email, phone and
2417
+ * address the business published. Up to 100 businesses per page.
2418
+ *
2419
+ * Costs 2 credits.
2420
+ */
2421
+ async search(options) {
2422
+ return this.client._post("/api/v1/trustpilot/search", options);
2423
+ }
2424
+ /**
2425
+ * A Trustpilot business profile: TrustScore, rating distribution, review
2426
+ * languages, categories, contact details, claimed and verification status,
2427
+ * reply rate and reply speed on negative reviews, consumer alerts, the AI
2428
+ * review summary and topics, similar businesses, and the 20 newest reviews
2429
+ * in the chosen language. Pass exactly one of domain or url.
2430
+ *
2431
+ * Costs 2 credits.
2432
+ */
2433
+ async business(options) {
2434
+ return this.client._post("/api/v1/trustpilot/business", options);
2435
+ }
2436
+ /**
2437
+ * One page of 20 Trustpilot reviews for a business, filtered by stars,
2438
+ * language, date range, topics, text search, verified-only and
2439
+ * with-replies, sorted by recency or relevance. Returns total_filtered, so a
2440
+ * date range doubles as review velocity. Up to 10 pages (200 reviews) per
2441
+ * filter combination. Pass exactly one of domain or url.
2442
+ *
2443
+ * Costs 2 credits.
2444
+ */
2445
+ async reviews(options) {
2446
+ return this.client._post("/api/v1/trustpilot/reviews", options);
2447
+ }
2448
+ /**
2449
+ * The full Trustpilot category tree (top-level categories and their
2450
+ * subcategories), or categories matching a name. Every category_id works
2451
+ * with category().
2452
+ *
2453
+ * Costs 2 credits.
2454
+ */
2455
+ async categories(options = {}) {
2456
+ return this.client._post("/api/v1/trustpilot/categories", options);
2457
+ }
2458
+ /**
2459
+ * Businesses ranked in a Trustpilot category for one country, with
2460
+ * TrustScore, review count, location, website, email and phone. Sort by
2461
+ * relevance, review count or latest review, set a minimum star rating, or
2462
+ * keep claimed profiles only. 20 per page.
2463
+ *
2464
+ * Costs 2 credits.
2465
+ */
2466
+ async category(options) {
2467
+ return this.client._post("/api/v1/trustpilot/category", options);
2468
+ }
2469
+ /**
2470
+ * One Trustpilot review by id: rating, title, full text, dates,
2471
+ * verification, the reviewer's public profile summary, the business reply,
2472
+ * and the business it is about.
2473
+ *
2474
+ * Costs 2 credits.
2475
+ */
2476
+ async review(options) {
2477
+ return this.client._post("/api/v1/trustpilot/review", options);
2478
+ }
2479
+ };
2480
+
2395
2481
  // src/client.ts
2396
2482
  var DEFAULT_MAX_REQUESTS_PER_SECOND = 1;
2397
2483
  var MAX_REQUESTS_PER_SECOND = 50;
@@ -2428,6 +2514,7 @@ var Scavio = class {
2428
2514
  googleAds;
2429
2515
  metaAds;
2430
2516
  costco;
2517
+ trustpilot;
2431
2518
  apiKey;
2432
2519
  baseUrl;
2433
2520
  timeout;
@@ -2480,6 +2567,7 @@ var Scavio = class {
2480
2567
  this.googleAds = new GoogleAdsNamespace(this);
2481
2568
  this.metaAds = new MetaAdsNamespace(this);
2482
2569
  this.costco = new CostcoNamespace(this);
2570
+ this.trustpilot = new TrustpilotNamespace(this);
2483
2571
  }
2484
2572
  /** @internal */
2485
2573
  async _post(path, body) {
@@ -2577,6 +2665,7 @@ export {
2577
2665
  TikTokNamespace,
2578
2666
  TikTokShopNamespace,
2579
2667
  TripadvisorNamespace,
2668
+ TrustpilotNamespace,
2580
2669
  WalmartNamespace,
2581
2670
  XNamespace,
2582
2671
  YelpNamespace,