scavio 0.24.1 → 0.26.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
@@ -377,11 +377,128 @@ interface GoogleTrendingOptions {
377
377
  status?: "all" | "active";
378
378
  [key: string]: unknown;
379
379
  }
380
+ interface GoogleCustomSearchOptions {
381
+ /** Search query. */
382
+ q: string;
383
+ /** Accepted and echoed back; results come from the whole web. */
384
+ cx?: string;
385
+ /** Results to return, 1-10 (default 10). */
386
+ num?: number;
387
+ /** 1-based index of the first result (default 1); start + num <= 100. */
388
+ start?: number;
389
+ /** Country of the search (ISO 3166-1 alpha-2, e.g. 'us'). */
390
+ gl?: string;
391
+ /** UI language (e.g. 'en', 'zh-TW'). */
392
+ hl?: string;
393
+ /** Language restrict (e.g. 'lang_en'). */
394
+ lr?: string;
395
+ /** Country restrict, a single value (e.g. 'countryUS'). */
396
+ cr?: string;
397
+ /** SafeSearch (default 'off'). */
398
+ safe?: "active" | "off";
399
+ /** '0' turns off duplicate-content filtering. */
400
+ filter?: "0" | "1";
401
+ /** d[N], w[N], m[N] or y[N] (e.g. 'm6'). Sent as dateRestrict. */
402
+ date_restrict?: string;
403
+ /** Site to include or exclude (e.g. 'example.com'); enforced on results. Sent as siteSearch. */
404
+ site_search?: string;
405
+ /** 'i' include site_search (default), 'e' exclude it. Sent as siteSearchFilter. */
406
+ site_search_filter?: "i" | "e";
407
+ /** Phrase every result must contain. Sent as exactTerms. */
408
+ exact_terms?: string;
409
+ /** Word or phrase no result may contain. Sent as excludeTerms. */
410
+ exclude_terms?: string;
411
+ /** Space-separated terms; each result contains at least one. Sent as orTerms. */
412
+ or_terms?: string;
413
+ /** Extra terms ANDed onto the query. */
414
+ hq?: string;
415
+ /** File extension to restrict to (e.g. 'pdf'). Sent as fileType. */
416
+ file_type?: string;
417
+ /** Google domain to search (e.g. 'google.co.uk'). */
418
+ googlehost?: string;
419
+ /** Canonical location name (Scavio extension). */
420
+ location?: string;
421
+ /** Device to emulate (Scavio extension). */
422
+ device?: "desktop" | "mobile";
423
+ /** Disable spelling autocorrection when true (Scavio extension). */
424
+ nfpr?: boolean;
425
+ /** Skip the 24h result cache when true (Scavio extension). */
426
+ no_cache?: boolean;
427
+ [key: string]: unknown;
428
+ }
429
+ /** One result in the Custom Search JSON API format. */
430
+ interface GoogleCustomSearchItem {
431
+ kind: "customsearch#result";
432
+ title: string;
433
+ htmlTitle: string;
434
+ link: string;
435
+ displayLink: string;
436
+ snippet: string;
437
+ htmlSnippet: string;
438
+ formattedUrl: string;
439
+ htmlFormattedUrl: string;
440
+ pagemap?: {
441
+ cse_thumbnail?: {
442
+ src: string;
443
+ }[];
444
+ [key: string]: unknown;
445
+ };
446
+ }
447
+ /** queries.request / nextPage / previousPage entry. */
448
+ interface GoogleCustomSearchQuery {
449
+ title: string;
450
+ totalResults: string;
451
+ searchTerms: string;
452
+ count: number;
453
+ startIndex: number;
454
+ inputEncoding: string;
455
+ outputEncoding: string;
456
+ safe: string;
457
+ cx?: string;
458
+ [key: string]: unknown;
459
+ }
460
+ /** customsearch#search response, plus Scavio's billing object. */
461
+ interface GoogleCustomSearchResponse {
462
+ kind: "customsearch#search";
463
+ url: {
464
+ type: string;
465
+ template: string;
466
+ };
467
+ queries: {
468
+ request: GoogleCustomSearchQuery[];
469
+ nextPage?: GoogleCustomSearchQuery[];
470
+ previousPage?: GoogleCustomSearchQuery[];
471
+ };
472
+ searchInformation: {
473
+ searchTime: number;
474
+ formattedSearchTime: string;
475
+ totalResults: string;
476
+ formattedTotalResults: string;
477
+ };
478
+ /** Omitted when there are no results, as in the Custom Search JSON API. */
479
+ items?: GoogleCustomSearchItem[];
480
+ scavio: {
481
+ credits_used: number;
482
+ credits_remaining: number;
483
+ cached: boolean;
484
+ response_time: number;
485
+ };
486
+ [key: string]: unknown;
487
+ }
380
488
  declare class GoogleNamespace {
381
489
  private client;
382
490
  constructor(client: Scavio);
383
491
  /** Google SERP search (includes the AI Overview when Google returns one). */
384
492
  search(options: GoogleSearchOptions): Promise<Record<string, unknown>>;
493
+ /**
494
+ * Google search in the Custom Search JSON API format: a drop-in for cse.list.
495
+ * Returns customsearch#search (items[], searchInformation, queries.nextPage)
496
+ * plus a scavio billing object, so CSE parsing code keeps working. For the
497
+ * full SERP (knowledge graph, AI overview, People Also Ask) use search().
498
+ * Unsupported CSE params (image search, sort, rights) throw BadRequestError.
499
+ * 1 credit.
500
+ */
501
+ customSearch(options: GoogleCustomSearchOptions): Promise<GoogleCustomSearchResponse>;
385
502
  /** Google AI Mode answer. */
386
503
  aiMode(options: GoogleAiModeOptions): Promise<Record<string, unknown>>;
387
504
  /** Google Maps local results. */
@@ -4864,6 +4981,50 @@ declare class TrustpilotNamespace {
4864
4981
  review(options: TrustpilotReviewOptions): Promise<Record<string, unknown>>;
4865
4982
  }
4866
4983
 
4984
+ /** Minimum request timeout (ms) for chatgpt.prompt() and gemini.prompt(). */
4985
+ declare const AI_PROMPT_TIMEOUT = 120000;
4986
+ interface ChatgptPromptOptions {
4987
+ /** The prompt (1-1024 characters). */
4988
+ prompt: string;
4989
+ /** Model to answer with (default "auto"). */
4990
+ model?: string;
4991
+ /** 2-letter country code the answer is localized for (default "us"). */
4992
+ country?: string;
4993
+ /** Also return the answer as HTML in data.answer.html. */
4994
+ include_html?: boolean;
4995
+ [key: string]: unknown;
4996
+ }
4997
+ declare class ChatgptNamespace {
4998
+ private client;
4999
+ constructor(client: Scavio);
5000
+ /**
5001
+ * Send a prompt to ChatGPT and get the answer it gives: the full Markdown
5002
+ * answer, every page it cites (title, publisher, date), the web searches it
5003
+ * ran and the products it recommended. Built for AI visibility monitoring.
5004
+ *
5005
+ * Costs 5 credits per answered prompt; failed prompts are not charged.
5006
+ */
5007
+ prompt(options: ChatgptPromptOptions): Promise<Record<string, unknown>>;
5008
+ }
5009
+
5010
+ interface GeminiPromptOptions {
5011
+ /** The prompt (1-4000 characters). */
5012
+ prompt: string;
5013
+ [key: string]: unknown;
5014
+ }
5015
+ declare class GeminiNamespace {
5016
+ private client;
5017
+ constructor(client: Scavio);
5018
+ /**
5019
+ * Send a prompt to Google Gemini and get the answer it gives as Markdown,
5020
+ * with the URLs it cites and the products it recommended. Same response
5021
+ * shape as chatgpt.prompt().
5022
+ *
5023
+ * Costs 5 credits per answered prompt; failed prompts are not charged.
5024
+ */
5025
+ prompt(options: GeminiPromptOptions): Promise<Record<string, unknown>>;
5026
+ }
5027
+
4867
5028
  type RealtorListingStatus = "for_sale" | "pending" | "for_rent" | "sold";
4868
5029
  type RealtorPropertyType = "single_family" | "condos" | "townhomes" | "multi_family" | "land" | "mobile" | "farm";
4869
5030
  type RealtorSort = "relevance" | "newest" | "price_low" | "price_high" | "sold_newest" | "sqft_high" | "lot_size_high" | "year_built_new" | "recently_updated" | "recently_reduced";
@@ -5797,6 +5958,8 @@ declare class Scavio extends ScavioCore {
5797
5958
  readonly metaAds: MetaAdsNamespace;
5798
5959
  readonly costco: CostcoNamespace;
5799
5960
  readonly trustpilot: TrustpilotNamespace;
5961
+ readonly chatgpt: ChatgptNamespace;
5962
+ readonly gemini: GeminiNamespace;
5800
5963
  readonly realtor: RealtorNamespace;
5801
5964
  readonly rightmove: RightmoveNamespace;
5802
5965
  readonly mercadolibre: MercadoLibreNamespace;
@@ -5807,7 +5970,9 @@ declare class Scavio extends ScavioCore {
5807
5970
  private readonly rateLimiter;
5808
5971
  constructor(config?: ScavioConfig);
5809
5972
  /** @internal */
5810
- _post(path: string, body: object, headers?: Record<string, string>): Promise<Record<string, unknown>>;
5973
+ _post(path: string, body: object, headers?: Record<string, string>,
5974
+ /** Raise the timeout to at least this many ms for a slow endpoint; never lowers it. */
5975
+ minTimeout?: number): Promise<Record<string, unknown>>;
5811
5976
  /** @internal */
5812
5977
  _get(path: string, query?: Record<string, string | number | boolean | undefined>): Promise<Record<string, unknown>>;
5813
5978
  /** @internal */
@@ -5898,4 +6063,4 @@ declare class ScavioJobTimeoutError extends ScavioError {
5898
6063
  constructor(jobType: "crawl" | "batch", jobId: string, statusUrl: string, lastStatus: string);
5899
6064
  }
5900
6065
 
5901
- 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 Extract, type ExtractBatchOptions, type ExtractCrawlOptions, type ExtractFormat, type ExtractJobCreatedResponse, type ExtractJobRequestOptions, type ExtractJobResult, type ExtractJobState, type ExtractJobStatusQuery, type ExtractJobStatusResponse, type ExtractJobSummary, type ExtractJobSummaryResponse, type ExtractJobWaitResponse, type ExtractMapLink, type ExtractMapOptions, type ExtractMapResponse, type ExtractMode, ExtractNamespace, type ExtractOptions, type ExtractSitemapMode, 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, type InstagramHighlightStoriesOptions, type InstagramKeywordOptions, type InstagramMusicPostsOptions, InstagramNamespace, type InstagramPostCommentsOptions, type InstagramPostLikersOptions, type InstagramPostOptions, type InstagramProfileOptions, type InstagramSearchOptions, type InstagramStoriesOptions, type InstagramUserFeedOptions, type InstagramUserRefOptions, 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 MercadoLibreBestSellersCountry, type MercadoLibreBestSellersOptions, type MercadoLibreCondition, type MercadoLibreCountry, type MercadoLibreDiscount, MercadoLibreNamespace, type MercadoLibreProductOptions, type MercadoLibreQuestionsOptions, type MercadoLibreReviewsOptions, type MercadoLibreSearchOptions, type MercadoLibreSort, type MetaAdsAdOptions, type MetaAdsAdvertiserOptions, MetaAdsNamespace, type MetaAdsSearchOptions, MissingAPIKeyError, NotFoundError, RateLimitError, type RealtorAgentOptions, type RealtorAgentsOptions, type RealtorListingStatus, type RealtorLocationsOptions, type RealtorMarketOptions, RealtorNamespace, type RealtorPropertyOptions, type RealtorPropertyType, type RealtorSearchOptions, type RealtorSort, type RedditCommentRepliesOptions, type RedditCommentSearchSort, type RedditFeedSort, RedditNamespace, type RedditPopularOptions, type RedditPostCommentsOptions, type RedditPostOptions, type RedditSearchCommentsOptions, type RedditSearchOptions, type RedditSearchSubredditsOptions, type RedditSearchSuggestionsOptions, type RedditSort, type RedditSubredditOptions, type RedditSubredditPostsOptions, type RedditUserFeedOptions, type RedditUserOptions, type RedfinMarketOptions, RedfinNamespace, type RedfinPropertyOptions, type RedfinSearchOptions, type RightmoveAgentOptions, type RightmoveAgentsOptions, type RightmoveExclude, type RightmoveFurnishing, type RightmoveLetType, type RightmoveListingStatus, type RightmoveLocationsOptions, type RightmoveMustHave, RightmoveNamespace, type RightmovePropertyOptions, type RightmovePropertyType, type RightmoveRadius, type RightmoveSearchOptions, type RightmoveSoldOptions, type RightmoveSoldPropertyOptions, type RightmoveSoldPropertyType, type RightmoveSoldSort, type RightmoveSort, type RightmoveTenure, type SECCompanyOptions, type SECConceptOptions, type SECFactsOptions, type SECFilingsOptions, type SECLookupOptions, SECNamespace, type SECSearchOptions, Scavio, ScavioAPIError, type ScavioConfig, ScavioConnectionError, ScavioError, ScavioJobTimeoutError, 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, type TikTokMusicChartOptions, type TikTokMusicOptions, type TikTokMusicVideosOptions, TikTokNamespace, type TikTokPlaylistVideosOptions, type TikTokProfileOptions, type TikTokSearchMusicOptions, type TikTokSearchSuggestionsOptions, 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 TikTokTrendingVideosOptions, type TikTokUserFollowersOptions, type TikTokUserFollowingsOptions, type TikTokUserPlaylistsOptions, type TikTokUserPostsOptions, type TikTokUserSimilarOptions, type TikTokUsernameOptions, type TikTokVideoCommentsOptions, type TikTokVideoOptions, type TikTokVideoTranscriptOptions, 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, type XCommunityOptions, type XCommunityTweetsOptions, XNamespace, type XSearchCommunitiesOptions, 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 YouTubeCommunityPostCommentsOptions, type YouTubeCommunityPostOptions, type YouTubeMetadataOptions, YouTubeNamespace, type YouTubeRelatedOptions, type YouTubeSearchOptions, type YouTubeShortsOptions, type YouTubeStreamsOptions, type YouTubeSuggestionsOptions, type YouTubeTranscriptOptions, type YouTubeVideoOptions, type ZillowAgentReviewsOptions, ZillowNamespace, type ZillowPropertyOptions, type ZillowSearchOptions, verifyWebhook };
6066
+ export { AI_PROMPT_TIMEOUT, 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, ChatgptNamespace, type ChatgptPromptOptions, 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 Extract, type ExtractBatchOptions, type ExtractCrawlOptions, type ExtractFormat, type ExtractJobCreatedResponse, type ExtractJobRequestOptions, type ExtractJobResult, type ExtractJobState, type ExtractJobStatusQuery, type ExtractJobStatusResponse, type ExtractJobSummary, type ExtractJobSummaryResponse, type ExtractJobWaitResponse, type ExtractMapLink, type ExtractMapOptions, type ExtractMapResponse, type ExtractMode, ExtractNamespace, type ExtractOptions, type ExtractSitemapMode, G2Namespace, type G2ProductOptions, type G2ReviewsOptions, type G2SearchOptions, GeminiNamespace, type GeminiPromptOptions, type GlassdoorCompaniesOptions, type GlassdoorCompanyOptions, GlassdoorNamespace, type GlassdoorReviewsOptions, type GlassdoorSalariesOptions, type GoogleAdsAdvertisersOptions, type GoogleAdsCreativeOptions, GoogleAdsNamespace, type GoogleAdsSearchOptions, type GoogleAiModeOptions, type GoogleCustomSearchItem, type GoogleCustomSearchOptions, type GoogleCustomSearchQuery, type GoogleCustomSearchResponse, 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, type InstagramHighlightStoriesOptions, type InstagramKeywordOptions, type InstagramMusicPostsOptions, InstagramNamespace, type InstagramPostCommentsOptions, type InstagramPostLikersOptions, type InstagramPostOptions, type InstagramProfileOptions, type InstagramSearchOptions, type InstagramStoriesOptions, type InstagramUserFeedOptions, type InstagramUserRefOptions, 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 MercadoLibreBestSellersCountry, type MercadoLibreBestSellersOptions, type MercadoLibreCondition, type MercadoLibreCountry, type MercadoLibreDiscount, MercadoLibreNamespace, type MercadoLibreProductOptions, type MercadoLibreQuestionsOptions, type MercadoLibreReviewsOptions, type MercadoLibreSearchOptions, type MercadoLibreSort, type MetaAdsAdOptions, type MetaAdsAdvertiserOptions, MetaAdsNamespace, type MetaAdsSearchOptions, MissingAPIKeyError, NotFoundError, RateLimitError, type RealtorAgentOptions, type RealtorAgentsOptions, type RealtorListingStatus, type RealtorLocationsOptions, type RealtorMarketOptions, RealtorNamespace, type RealtorPropertyOptions, type RealtorPropertyType, type RealtorSearchOptions, type RealtorSort, type RedditCommentRepliesOptions, type RedditCommentSearchSort, type RedditFeedSort, RedditNamespace, type RedditPopularOptions, type RedditPostCommentsOptions, type RedditPostOptions, type RedditSearchCommentsOptions, type RedditSearchOptions, type RedditSearchSubredditsOptions, type RedditSearchSuggestionsOptions, type RedditSort, type RedditSubredditOptions, type RedditSubredditPostsOptions, type RedditUserFeedOptions, type RedditUserOptions, type RedfinMarketOptions, RedfinNamespace, type RedfinPropertyOptions, type RedfinSearchOptions, type RightmoveAgentOptions, type RightmoveAgentsOptions, type RightmoveExclude, type RightmoveFurnishing, type RightmoveLetType, type RightmoveListingStatus, type RightmoveLocationsOptions, type RightmoveMustHave, RightmoveNamespace, type RightmovePropertyOptions, type RightmovePropertyType, type RightmoveRadius, type RightmoveSearchOptions, type RightmoveSoldOptions, type RightmoveSoldPropertyOptions, type RightmoveSoldPropertyType, type RightmoveSoldSort, type RightmoveSort, type RightmoveTenure, type SECCompanyOptions, type SECConceptOptions, type SECFactsOptions, type SECFilingsOptions, type SECLookupOptions, SECNamespace, type SECSearchOptions, Scavio, ScavioAPIError, type ScavioConfig, ScavioConnectionError, ScavioError, ScavioJobTimeoutError, 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, type TikTokMusicChartOptions, type TikTokMusicOptions, type TikTokMusicVideosOptions, TikTokNamespace, type TikTokPlaylistVideosOptions, type TikTokProfileOptions, type TikTokSearchMusicOptions, type TikTokSearchSuggestionsOptions, 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 TikTokTrendingVideosOptions, type TikTokUserFollowersOptions, type TikTokUserFollowingsOptions, type TikTokUserPlaylistsOptions, type TikTokUserPostsOptions, type TikTokUserSimilarOptions, type TikTokUsernameOptions, type TikTokVideoCommentsOptions, type TikTokVideoOptions, type TikTokVideoTranscriptOptions, 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, type XCommunityOptions, type XCommunityTweetsOptions, XNamespace, type XSearchCommunitiesOptions, 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 YouTubeCommunityPostCommentsOptions, type YouTubeCommunityPostOptions, type YouTubeMetadataOptions, YouTubeNamespace, type YouTubeRelatedOptions, type YouTubeSearchOptions, type YouTubeShortsOptions, type YouTubeStreamsOptions, type YouTubeSuggestionsOptions, type YouTubeTranscriptOptions, type YouTubeVideoOptions, type ZillowAgentReviewsOptions, ZillowNamespace, type ZillowPropertyOptions, type ZillowSearchOptions, verifyWebhook };
package/dist/index.d.ts CHANGED
@@ -377,11 +377,128 @@ interface GoogleTrendingOptions {
377
377
  status?: "all" | "active";
378
378
  [key: string]: unknown;
379
379
  }
380
+ interface GoogleCustomSearchOptions {
381
+ /** Search query. */
382
+ q: string;
383
+ /** Accepted and echoed back; results come from the whole web. */
384
+ cx?: string;
385
+ /** Results to return, 1-10 (default 10). */
386
+ num?: number;
387
+ /** 1-based index of the first result (default 1); start + num <= 100. */
388
+ start?: number;
389
+ /** Country of the search (ISO 3166-1 alpha-2, e.g. 'us'). */
390
+ gl?: string;
391
+ /** UI language (e.g. 'en', 'zh-TW'). */
392
+ hl?: string;
393
+ /** Language restrict (e.g. 'lang_en'). */
394
+ lr?: string;
395
+ /** Country restrict, a single value (e.g. 'countryUS'). */
396
+ cr?: string;
397
+ /** SafeSearch (default 'off'). */
398
+ safe?: "active" | "off";
399
+ /** '0' turns off duplicate-content filtering. */
400
+ filter?: "0" | "1";
401
+ /** d[N], w[N], m[N] or y[N] (e.g. 'm6'). Sent as dateRestrict. */
402
+ date_restrict?: string;
403
+ /** Site to include or exclude (e.g. 'example.com'); enforced on results. Sent as siteSearch. */
404
+ site_search?: string;
405
+ /** 'i' include site_search (default), 'e' exclude it. Sent as siteSearchFilter. */
406
+ site_search_filter?: "i" | "e";
407
+ /** Phrase every result must contain. Sent as exactTerms. */
408
+ exact_terms?: string;
409
+ /** Word or phrase no result may contain. Sent as excludeTerms. */
410
+ exclude_terms?: string;
411
+ /** Space-separated terms; each result contains at least one. Sent as orTerms. */
412
+ or_terms?: string;
413
+ /** Extra terms ANDed onto the query. */
414
+ hq?: string;
415
+ /** File extension to restrict to (e.g. 'pdf'). Sent as fileType. */
416
+ file_type?: string;
417
+ /** Google domain to search (e.g. 'google.co.uk'). */
418
+ googlehost?: string;
419
+ /** Canonical location name (Scavio extension). */
420
+ location?: string;
421
+ /** Device to emulate (Scavio extension). */
422
+ device?: "desktop" | "mobile";
423
+ /** Disable spelling autocorrection when true (Scavio extension). */
424
+ nfpr?: boolean;
425
+ /** Skip the 24h result cache when true (Scavio extension). */
426
+ no_cache?: boolean;
427
+ [key: string]: unknown;
428
+ }
429
+ /** One result in the Custom Search JSON API format. */
430
+ interface GoogleCustomSearchItem {
431
+ kind: "customsearch#result";
432
+ title: string;
433
+ htmlTitle: string;
434
+ link: string;
435
+ displayLink: string;
436
+ snippet: string;
437
+ htmlSnippet: string;
438
+ formattedUrl: string;
439
+ htmlFormattedUrl: string;
440
+ pagemap?: {
441
+ cse_thumbnail?: {
442
+ src: string;
443
+ }[];
444
+ [key: string]: unknown;
445
+ };
446
+ }
447
+ /** queries.request / nextPage / previousPage entry. */
448
+ interface GoogleCustomSearchQuery {
449
+ title: string;
450
+ totalResults: string;
451
+ searchTerms: string;
452
+ count: number;
453
+ startIndex: number;
454
+ inputEncoding: string;
455
+ outputEncoding: string;
456
+ safe: string;
457
+ cx?: string;
458
+ [key: string]: unknown;
459
+ }
460
+ /** customsearch#search response, plus Scavio's billing object. */
461
+ interface GoogleCustomSearchResponse {
462
+ kind: "customsearch#search";
463
+ url: {
464
+ type: string;
465
+ template: string;
466
+ };
467
+ queries: {
468
+ request: GoogleCustomSearchQuery[];
469
+ nextPage?: GoogleCustomSearchQuery[];
470
+ previousPage?: GoogleCustomSearchQuery[];
471
+ };
472
+ searchInformation: {
473
+ searchTime: number;
474
+ formattedSearchTime: string;
475
+ totalResults: string;
476
+ formattedTotalResults: string;
477
+ };
478
+ /** Omitted when there are no results, as in the Custom Search JSON API. */
479
+ items?: GoogleCustomSearchItem[];
480
+ scavio: {
481
+ credits_used: number;
482
+ credits_remaining: number;
483
+ cached: boolean;
484
+ response_time: number;
485
+ };
486
+ [key: string]: unknown;
487
+ }
380
488
  declare class GoogleNamespace {
381
489
  private client;
382
490
  constructor(client: Scavio);
383
491
  /** Google SERP search (includes the AI Overview when Google returns one). */
384
492
  search(options: GoogleSearchOptions): Promise<Record<string, unknown>>;
493
+ /**
494
+ * Google search in the Custom Search JSON API format: a drop-in for cse.list.
495
+ * Returns customsearch#search (items[], searchInformation, queries.nextPage)
496
+ * plus a scavio billing object, so CSE parsing code keeps working. For the
497
+ * full SERP (knowledge graph, AI overview, People Also Ask) use search().
498
+ * Unsupported CSE params (image search, sort, rights) throw BadRequestError.
499
+ * 1 credit.
500
+ */
501
+ customSearch(options: GoogleCustomSearchOptions): Promise<GoogleCustomSearchResponse>;
385
502
  /** Google AI Mode answer. */
386
503
  aiMode(options: GoogleAiModeOptions): Promise<Record<string, unknown>>;
387
504
  /** Google Maps local results. */
@@ -4864,6 +4981,50 @@ declare class TrustpilotNamespace {
4864
4981
  review(options: TrustpilotReviewOptions): Promise<Record<string, unknown>>;
4865
4982
  }
4866
4983
 
4984
+ /** Minimum request timeout (ms) for chatgpt.prompt() and gemini.prompt(). */
4985
+ declare const AI_PROMPT_TIMEOUT = 120000;
4986
+ interface ChatgptPromptOptions {
4987
+ /** The prompt (1-1024 characters). */
4988
+ prompt: string;
4989
+ /** Model to answer with (default "auto"). */
4990
+ model?: string;
4991
+ /** 2-letter country code the answer is localized for (default "us"). */
4992
+ country?: string;
4993
+ /** Also return the answer as HTML in data.answer.html. */
4994
+ include_html?: boolean;
4995
+ [key: string]: unknown;
4996
+ }
4997
+ declare class ChatgptNamespace {
4998
+ private client;
4999
+ constructor(client: Scavio);
5000
+ /**
5001
+ * Send a prompt to ChatGPT and get the answer it gives: the full Markdown
5002
+ * answer, every page it cites (title, publisher, date), the web searches it
5003
+ * ran and the products it recommended. Built for AI visibility monitoring.
5004
+ *
5005
+ * Costs 5 credits per answered prompt; failed prompts are not charged.
5006
+ */
5007
+ prompt(options: ChatgptPromptOptions): Promise<Record<string, unknown>>;
5008
+ }
5009
+
5010
+ interface GeminiPromptOptions {
5011
+ /** The prompt (1-4000 characters). */
5012
+ prompt: string;
5013
+ [key: string]: unknown;
5014
+ }
5015
+ declare class GeminiNamespace {
5016
+ private client;
5017
+ constructor(client: Scavio);
5018
+ /**
5019
+ * Send a prompt to Google Gemini and get the answer it gives as Markdown,
5020
+ * with the URLs it cites and the products it recommended. Same response
5021
+ * shape as chatgpt.prompt().
5022
+ *
5023
+ * Costs 5 credits per answered prompt; failed prompts are not charged.
5024
+ */
5025
+ prompt(options: GeminiPromptOptions): Promise<Record<string, unknown>>;
5026
+ }
5027
+
4867
5028
  type RealtorListingStatus = "for_sale" | "pending" | "for_rent" | "sold";
4868
5029
  type RealtorPropertyType = "single_family" | "condos" | "townhomes" | "multi_family" | "land" | "mobile" | "farm";
4869
5030
  type RealtorSort = "relevance" | "newest" | "price_low" | "price_high" | "sold_newest" | "sqft_high" | "lot_size_high" | "year_built_new" | "recently_updated" | "recently_reduced";
@@ -5797,6 +5958,8 @@ declare class Scavio extends ScavioCore {
5797
5958
  readonly metaAds: MetaAdsNamespace;
5798
5959
  readonly costco: CostcoNamespace;
5799
5960
  readonly trustpilot: TrustpilotNamespace;
5961
+ readonly chatgpt: ChatgptNamespace;
5962
+ readonly gemini: GeminiNamespace;
5800
5963
  readonly realtor: RealtorNamespace;
5801
5964
  readonly rightmove: RightmoveNamespace;
5802
5965
  readonly mercadolibre: MercadoLibreNamespace;
@@ -5807,7 +5970,9 @@ declare class Scavio extends ScavioCore {
5807
5970
  private readonly rateLimiter;
5808
5971
  constructor(config?: ScavioConfig);
5809
5972
  /** @internal */
5810
- _post(path: string, body: object, headers?: Record<string, string>): Promise<Record<string, unknown>>;
5973
+ _post(path: string, body: object, headers?: Record<string, string>,
5974
+ /** Raise the timeout to at least this many ms for a slow endpoint; never lowers it. */
5975
+ minTimeout?: number): Promise<Record<string, unknown>>;
5811
5976
  /** @internal */
5812
5977
  _get(path: string, query?: Record<string, string | number | boolean | undefined>): Promise<Record<string, unknown>>;
5813
5978
  /** @internal */
@@ -5898,4 +6063,4 @@ declare class ScavioJobTimeoutError extends ScavioError {
5898
6063
  constructor(jobType: "crawl" | "batch", jobId: string, statusUrl: string, lastStatus: string);
5899
6064
  }
5900
6065
 
5901
- 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 Extract, type ExtractBatchOptions, type ExtractCrawlOptions, type ExtractFormat, type ExtractJobCreatedResponse, type ExtractJobRequestOptions, type ExtractJobResult, type ExtractJobState, type ExtractJobStatusQuery, type ExtractJobStatusResponse, type ExtractJobSummary, type ExtractJobSummaryResponse, type ExtractJobWaitResponse, type ExtractMapLink, type ExtractMapOptions, type ExtractMapResponse, type ExtractMode, ExtractNamespace, type ExtractOptions, type ExtractSitemapMode, 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, type InstagramHighlightStoriesOptions, type InstagramKeywordOptions, type InstagramMusicPostsOptions, InstagramNamespace, type InstagramPostCommentsOptions, type InstagramPostLikersOptions, type InstagramPostOptions, type InstagramProfileOptions, type InstagramSearchOptions, type InstagramStoriesOptions, type InstagramUserFeedOptions, type InstagramUserRefOptions, 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 MercadoLibreBestSellersCountry, type MercadoLibreBestSellersOptions, type MercadoLibreCondition, type MercadoLibreCountry, type MercadoLibreDiscount, MercadoLibreNamespace, type MercadoLibreProductOptions, type MercadoLibreQuestionsOptions, type MercadoLibreReviewsOptions, type MercadoLibreSearchOptions, type MercadoLibreSort, type MetaAdsAdOptions, type MetaAdsAdvertiserOptions, MetaAdsNamespace, type MetaAdsSearchOptions, MissingAPIKeyError, NotFoundError, RateLimitError, type RealtorAgentOptions, type RealtorAgentsOptions, type RealtorListingStatus, type RealtorLocationsOptions, type RealtorMarketOptions, RealtorNamespace, type RealtorPropertyOptions, type RealtorPropertyType, type RealtorSearchOptions, type RealtorSort, type RedditCommentRepliesOptions, type RedditCommentSearchSort, type RedditFeedSort, RedditNamespace, type RedditPopularOptions, type RedditPostCommentsOptions, type RedditPostOptions, type RedditSearchCommentsOptions, type RedditSearchOptions, type RedditSearchSubredditsOptions, type RedditSearchSuggestionsOptions, type RedditSort, type RedditSubredditOptions, type RedditSubredditPostsOptions, type RedditUserFeedOptions, type RedditUserOptions, type RedfinMarketOptions, RedfinNamespace, type RedfinPropertyOptions, type RedfinSearchOptions, type RightmoveAgentOptions, type RightmoveAgentsOptions, type RightmoveExclude, type RightmoveFurnishing, type RightmoveLetType, type RightmoveListingStatus, type RightmoveLocationsOptions, type RightmoveMustHave, RightmoveNamespace, type RightmovePropertyOptions, type RightmovePropertyType, type RightmoveRadius, type RightmoveSearchOptions, type RightmoveSoldOptions, type RightmoveSoldPropertyOptions, type RightmoveSoldPropertyType, type RightmoveSoldSort, type RightmoveSort, type RightmoveTenure, type SECCompanyOptions, type SECConceptOptions, type SECFactsOptions, type SECFilingsOptions, type SECLookupOptions, SECNamespace, type SECSearchOptions, Scavio, ScavioAPIError, type ScavioConfig, ScavioConnectionError, ScavioError, ScavioJobTimeoutError, 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, type TikTokMusicChartOptions, type TikTokMusicOptions, type TikTokMusicVideosOptions, TikTokNamespace, type TikTokPlaylistVideosOptions, type TikTokProfileOptions, type TikTokSearchMusicOptions, type TikTokSearchSuggestionsOptions, 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 TikTokTrendingVideosOptions, type TikTokUserFollowersOptions, type TikTokUserFollowingsOptions, type TikTokUserPlaylistsOptions, type TikTokUserPostsOptions, type TikTokUserSimilarOptions, type TikTokUsernameOptions, type TikTokVideoCommentsOptions, type TikTokVideoOptions, type TikTokVideoTranscriptOptions, 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, type XCommunityOptions, type XCommunityTweetsOptions, XNamespace, type XSearchCommunitiesOptions, 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 YouTubeCommunityPostCommentsOptions, type YouTubeCommunityPostOptions, type YouTubeMetadataOptions, YouTubeNamespace, type YouTubeRelatedOptions, type YouTubeSearchOptions, type YouTubeShortsOptions, type YouTubeStreamsOptions, type YouTubeSuggestionsOptions, type YouTubeTranscriptOptions, type YouTubeVideoOptions, type ZillowAgentReviewsOptions, ZillowNamespace, type ZillowPropertyOptions, type ZillowSearchOptions, verifyWebhook };
6066
+ export { AI_PROMPT_TIMEOUT, 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, ChatgptNamespace, type ChatgptPromptOptions, 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 Extract, type ExtractBatchOptions, type ExtractCrawlOptions, type ExtractFormat, type ExtractJobCreatedResponse, type ExtractJobRequestOptions, type ExtractJobResult, type ExtractJobState, type ExtractJobStatusQuery, type ExtractJobStatusResponse, type ExtractJobSummary, type ExtractJobSummaryResponse, type ExtractJobWaitResponse, type ExtractMapLink, type ExtractMapOptions, type ExtractMapResponse, type ExtractMode, ExtractNamespace, type ExtractOptions, type ExtractSitemapMode, G2Namespace, type G2ProductOptions, type G2ReviewsOptions, type G2SearchOptions, GeminiNamespace, type GeminiPromptOptions, type GlassdoorCompaniesOptions, type GlassdoorCompanyOptions, GlassdoorNamespace, type GlassdoorReviewsOptions, type GlassdoorSalariesOptions, type GoogleAdsAdvertisersOptions, type GoogleAdsCreativeOptions, GoogleAdsNamespace, type GoogleAdsSearchOptions, type GoogleAiModeOptions, type GoogleCustomSearchItem, type GoogleCustomSearchOptions, type GoogleCustomSearchQuery, type GoogleCustomSearchResponse, 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, type InstagramHighlightStoriesOptions, type InstagramKeywordOptions, type InstagramMusicPostsOptions, InstagramNamespace, type InstagramPostCommentsOptions, type InstagramPostLikersOptions, type InstagramPostOptions, type InstagramProfileOptions, type InstagramSearchOptions, type InstagramStoriesOptions, type InstagramUserFeedOptions, type InstagramUserRefOptions, 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 MercadoLibreBestSellersCountry, type MercadoLibreBestSellersOptions, type MercadoLibreCondition, type MercadoLibreCountry, type MercadoLibreDiscount, MercadoLibreNamespace, type MercadoLibreProductOptions, type MercadoLibreQuestionsOptions, type MercadoLibreReviewsOptions, type MercadoLibreSearchOptions, type MercadoLibreSort, type MetaAdsAdOptions, type MetaAdsAdvertiserOptions, MetaAdsNamespace, type MetaAdsSearchOptions, MissingAPIKeyError, NotFoundError, RateLimitError, type RealtorAgentOptions, type RealtorAgentsOptions, type RealtorListingStatus, type RealtorLocationsOptions, type RealtorMarketOptions, RealtorNamespace, type RealtorPropertyOptions, type RealtorPropertyType, type RealtorSearchOptions, type RealtorSort, type RedditCommentRepliesOptions, type RedditCommentSearchSort, type RedditFeedSort, RedditNamespace, type RedditPopularOptions, type RedditPostCommentsOptions, type RedditPostOptions, type RedditSearchCommentsOptions, type RedditSearchOptions, type RedditSearchSubredditsOptions, type RedditSearchSuggestionsOptions, type RedditSort, type RedditSubredditOptions, type RedditSubredditPostsOptions, type RedditUserFeedOptions, type RedditUserOptions, type RedfinMarketOptions, RedfinNamespace, type RedfinPropertyOptions, type RedfinSearchOptions, type RightmoveAgentOptions, type RightmoveAgentsOptions, type RightmoveExclude, type RightmoveFurnishing, type RightmoveLetType, type RightmoveListingStatus, type RightmoveLocationsOptions, type RightmoveMustHave, RightmoveNamespace, type RightmovePropertyOptions, type RightmovePropertyType, type RightmoveRadius, type RightmoveSearchOptions, type RightmoveSoldOptions, type RightmoveSoldPropertyOptions, type RightmoveSoldPropertyType, type RightmoveSoldSort, type RightmoveSort, type RightmoveTenure, type SECCompanyOptions, type SECConceptOptions, type SECFactsOptions, type SECFilingsOptions, type SECLookupOptions, SECNamespace, type SECSearchOptions, Scavio, ScavioAPIError, type ScavioConfig, ScavioConnectionError, ScavioError, ScavioJobTimeoutError, 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, type TikTokMusicChartOptions, type TikTokMusicOptions, type TikTokMusicVideosOptions, TikTokNamespace, type TikTokPlaylistVideosOptions, type TikTokProfileOptions, type TikTokSearchMusicOptions, type TikTokSearchSuggestionsOptions, 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 TikTokTrendingVideosOptions, type TikTokUserFollowersOptions, type TikTokUserFollowingsOptions, type TikTokUserPlaylistsOptions, type TikTokUserPostsOptions, type TikTokUserSimilarOptions, type TikTokUsernameOptions, type TikTokVideoCommentsOptions, type TikTokVideoOptions, type TikTokVideoTranscriptOptions, 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, type XCommunityOptions, type XCommunityTweetsOptions, XNamespace, type XSearchCommunitiesOptions, 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 YouTubeCommunityPostCommentsOptions, type YouTubeCommunityPostOptions, type YouTubeMetadataOptions, YouTubeNamespace, type YouTubeRelatedOptions, type YouTubeSearchOptions, type YouTubeShortsOptions, type YouTubeStreamsOptions, type YouTubeSuggestionsOptions, type YouTubeTranscriptOptions, type YouTubeVideoOptions, type ZillowAgentReviewsOptions, ZillowNamespace, type ZillowPropertyOptions, type ZillowSearchOptions, verifyWebhook };
package/dist/index.js CHANGED
@@ -145,7 +145,7 @@ function parseRetryAfter(header) {
145
145
  var BASE_URL = "https://api.scavio.dev";
146
146
  var DEFAULT_TIMEOUT = 3e4;
147
147
  var DEFAULT_MAX_RETRIES = 2;
148
- var SDK_VERSION = true ? "0.24.1" : "0.0.0";
148
+ var SDK_VERSION = true ? "0.26.0" : "0.0.0";
149
149
  var USER_AGENT = `scavio-js/${SDK_VERSION}`;
150
150
  function isServerRuntime() {
151
151
  const g = globalThis;
@@ -334,6 +334,15 @@ var AmazonNamespace = class {
334
334
  };
335
335
 
336
336
  // src/namespaces/google.ts
337
+ var CUSTOM_SEARCH_WIRE = {
338
+ date_restrict: "dateRestrict",
339
+ site_search: "siteSearch",
340
+ site_search_filter: "siteSearchFilter",
341
+ exact_terms: "exactTerms",
342
+ exclude_terms: "excludeTerms",
343
+ or_terms: "orTerms",
344
+ file_type: "fileType"
345
+ };
337
346
  var GoogleNamespace = class {
338
347
  constructor(client) {
339
348
  this.client = client;
@@ -343,6 +352,21 @@ var GoogleNamespace = class {
343
352
  async search(options) {
344
353
  return this.client._post("/api/v2/google", options);
345
354
  }
355
+ /**
356
+ * Google search in the Custom Search JSON API format: a drop-in for cse.list.
357
+ * Returns customsearch#search (items[], searchInformation, queries.nextPage)
358
+ * plus a scavio billing object, so CSE parsing code keeps working. For the
359
+ * full SERP (knowledge graph, AI overview, People Also Ask) use search().
360
+ * Unsupported CSE params (image search, sort, rights) throw BadRequestError.
361
+ * 1 credit.
362
+ */
363
+ async customSearch(options) {
364
+ const body = {};
365
+ for (const [key, value] of Object.entries(options)) {
366
+ body[CUSTOM_SEARCH_WIRE[key] ?? key] = value;
367
+ }
368
+ return await this.client._post("/api/v1/google/customsearch", body);
369
+ }
346
370
  /** Google AI Mode answer. */
347
371
  async aiMode(options) {
348
372
  return this.client._post("/api/v2/google/ai-mode", options);
@@ -2705,6 +2729,43 @@ var TrustpilotNamespace = class {
2705
2729
  }
2706
2730
  };
2707
2731
 
2732
+ // src/namespaces/chatgpt.ts
2733
+ var AI_PROMPT_TIMEOUT = 12e4;
2734
+ var ChatgptNamespace = class {
2735
+ constructor(client) {
2736
+ this.client = client;
2737
+ }
2738
+ client;
2739
+ /**
2740
+ * Send a prompt to ChatGPT and get the answer it gives: the full Markdown
2741
+ * answer, every page it cites (title, publisher, date), the web searches it
2742
+ * ran and the products it recommended. Built for AI visibility monitoring.
2743
+ *
2744
+ * Costs 5 credits per answered prompt; failed prompts are not charged.
2745
+ */
2746
+ async prompt(options) {
2747
+ return this.client._post("/api/v1/chatgpt/prompt", options, void 0, AI_PROMPT_TIMEOUT);
2748
+ }
2749
+ };
2750
+
2751
+ // src/namespaces/gemini.ts
2752
+ var GeminiNamespace = class {
2753
+ constructor(client) {
2754
+ this.client = client;
2755
+ }
2756
+ client;
2757
+ /**
2758
+ * Send a prompt to Google Gemini and get the answer it gives as Markdown,
2759
+ * with the URLs it cites and the products it recommended. Same response
2760
+ * shape as chatgpt.prompt().
2761
+ *
2762
+ * Costs 5 credits per answered prompt; failed prompts are not charged.
2763
+ */
2764
+ async prompt(options) {
2765
+ return this.client._post("/api/v1/gemini/prompt", options, void 0, AI_PROMPT_TIMEOUT);
2766
+ }
2767
+ };
2768
+
2708
2769
  // src/namespaces/realtor.ts
2709
2770
  var RealtorNamespace = class {
2710
2771
  constructor(client) {
@@ -3107,6 +3168,8 @@ var Scavio = class extends ScavioCore {
3107
3168
  metaAds;
3108
3169
  costco;
3109
3170
  trustpilot;
3171
+ chatgpt;
3172
+ gemini;
3110
3173
  realtor;
3111
3174
  rightmove;
3112
3175
  mercadolibre;
@@ -3164,6 +3227,8 @@ var Scavio = class extends ScavioCore {
3164
3227
  this.metaAds = new MetaAdsNamespace(this);
3165
3228
  this.costco = new CostcoNamespace(this);
3166
3229
  this.trustpilot = new TrustpilotNamespace(this);
3230
+ this.chatgpt = new ChatgptNamespace(this);
3231
+ this.gemini = new GeminiNamespace(this);
3167
3232
  this.realtor = new RealtorNamespace(this);
3168
3233
  this.rightmove = new RightmoveNamespace(this);
3169
3234
  this.mercadolibre = new MercadoLibreNamespace(this);
@@ -3179,13 +3244,13 @@ var Scavio = class extends ScavioCore {
3179
3244
  });
3180
3245
  }
3181
3246
  /** @internal */
3182
- async _post(path, body, headers) {
3247
+ async _post(path, body, headers, minTimeout) {
3183
3248
  return request({
3184
3249
  method: "POST",
3185
3250
  path,
3186
3251
  apiKey: this.apiKey,
3187
3252
  baseUrl: this.baseUrl,
3188
- timeout: this.timeout,
3253
+ timeout: Math.max(this.timeout, minTimeout ?? 0),
3189
3254
  maxRetries: this.maxRetries,
3190
3255
  rateLimiter: this.rateLimiter,
3191
3256
  body,
@@ -3269,18 +3334,21 @@ async function getSubtle() {
3269
3334
  return nodeCrypto.webcrypto.subtle;
3270
3335
  }
3271
3336
  export {
3337
+ AI_PROMPT_TIMEOUT,
3272
3338
  AirbnbNamespace,
3273
3339
  AmazonNamespace,
3274
3340
  AppStoreNamespace,
3275
3341
  BadRequestError,
3276
3342
  BookingNamespace,
3277
3343
  CapterraNamespace,
3344
+ ChatgptNamespace,
3278
3345
  CompaniesHouseNamespace,
3279
3346
  CostcoNamespace,
3280
3347
  DEFAULT_MAX_REQUESTS_PER_SECOND,
3281
3348
  EbayNamespace,
3282
3349
  ExtractNamespace,
3283
3350
  G2Namespace,
3351
+ GeminiNamespace,
3284
3352
  GlassdoorNamespace,
3285
3353
  GoogleAdsNamespace,
3286
3354
  GoogleNamespace,