scavio 0.16.0 → 0.18.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -912,11 +912,90 @@ interface WalmartSearchOptions {
912
912
  fulfillment_speed?: "today" | "tomorrow";
913
913
  /** Fulfillment type filter. */
914
914
  fulfillment_type?: "in_store";
915
+ /**
916
+ * Shopper's postal code for store targeting: a 5-digit US ZIP, or a Canadian
917
+ * postal code ("M5V 2T6") with domain "ca". Must be sent together with
918
+ * `store_id`. Store-targeted calls cost 2 credits.
919
+ */
920
+ delivery_zip?: string;
921
+ /**
922
+ * Walmart store to target, from `stores()` on the same domain. Must be sent
923
+ * together with `delivery_zip`. Supported on domain "com" and "ca".
924
+ */
925
+ store_id?: string | number;
915
926
  [key: string]: unknown;
916
927
  }
917
928
  interface WalmartProductOptions {
918
929
  /** Walmart item id (usItemId), e.g. "13544111159". */
919
930
  product_id: string;
931
+ /**
932
+ * Walmart storefront, "com" (default) or "ca". "ca" is only available
933
+ * together with `delivery_zip` + `store_id`.
934
+ */
935
+ domain?: "com" | "ca";
936
+ /**
937
+ * Shopper's postal code for store targeting: a 5-digit US ZIP, or a Canadian
938
+ * postal code with domain "ca". Must be sent together with `store_id`.
939
+ */
940
+ delivery_zip?: string;
941
+ /**
942
+ * Walmart store to target, from `stores()` on the same domain. Must be sent
943
+ * together with `delivery_zip`.
944
+ */
945
+ store_id?: string | number;
946
+ [key: string]: unknown;
947
+ }
948
+ interface WalmartStoresOptions {
949
+ /**
950
+ * A 5-digit US ZIP, or a Canadian postal code ("M5V 2T6" or "M5V2T6") with
951
+ * domain "ca".
952
+ */
953
+ zipcode: string;
954
+ /** "com" (walmart.com, default) or "ca" (walmart.ca). */
955
+ domain?: "com" | "ca";
956
+ [key: string]: unknown;
957
+ }
958
+ /** One store returned by `stores()`. */
959
+ interface WalmartStore {
960
+ store_id: string | null;
961
+ name: string | null;
962
+ type: string | null;
963
+ node_type: string | null;
964
+ distance_miles: number | null;
965
+ address: {
966
+ line1: string | null;
967
+ line2: string | null;
968
+ city: string | null;
969
+ state: string | null;
970
+ zipcode: string | null;
971
+ country: string | null;
972
+ };
973
+ latitude: number | null;
974
+ longitude: number | null;
975
+ open_24_hours: boolean | null;
976
+ hours: {
977
+ day: string | null;
978
+ start: string | null;
979
+ end: string | null;
980
+ closed: boolean | null;
981
+ }[];
982
+ pickup_types: string[];
983
+ }
984
+ /** The `data` object of a `stores()` response. */
985
+ interface WalmartStoresData {
986
+ /** The ZIP or postal code searched, normalized ("M5V 2T6"). */
987
+ zipcode: string;
988
+ domain: "com" | "ca";
989
+ count: number;
990
+ /** Nearest first. */
991
+ stores: WalmartStore[];
992
+ }
993
+ interface WalmartStoresResponse {
994
+ data: WalmartStoresData;
995
+ response_time: number;
996
+ credits_used: number;
997
+ credits_remaining: number;
998
+ warnings?: string[];
920
999
  [key: string]: unknown;
921
1000
  }
922
1001
  interface WalmartReviewsOptions {
@@ -983,15 +1062,22 @@ declare class WalmartNamespace {
983
1062
  * Structured Walmart search results: `products[]`, `products_count` and the
984
1063
  * resolved `location`. Page through with `page` (1-indexed).
985
1064
  *
986
- * Costs 1 credit for `domain` "com" or "ca", 2 credits for "com.mx".
1065
+ * Pass `delivery_zip` + `store_id` to get one store's results (walmart.com
1066
+ * and walmart.ca); `data.location` confirms the store.
1067
+ *
1068
+ * Costs 1 credit for `domain` "com" or "ca", 2 credits for "com.mx", and 2
1069
+ * credits when store-targeted.
987
1070
  */
988
1071
  search(options: WalmartSearchOptions): Promise<Record<string, unknown>>;
989
1072
  /**
990
1073
  * Full product detail: price, rating, images, specifications, availability
991
1074
  * and seller.
992
1075
  *
993
- * Costs 1 credit. Walmart.ca product pages are not fetchable, so this is
994
- * walmart.com only.
1076
+ * Pass `delivery_zip` + `store_id` for one store's price and availability.
1077
+ * `domain: "ca"` is available only together with a store target.
1078
+ *
1079
+ * Costs 1 credit, or 2 when store-targeted. A store that does not carry the
1080
+ * item returns 404.
995
1081
  */
996
1082
  product(options: WalmartProductOptions): Promise<Record<string, unknown>>;
997
1083
  /**
@@ -1030,6 +1116,15 @@ declare class WalmartNamespace {
1030
1116
  * Costs 1 credit. `seller_id` must be the numeric catalog seller id.
1031
1117
  */
1032
1118
  sellerProducts(options: WalmartSellerProductsOptions): Promise<Record<string, unknown>>;
1119
+ /**
1120
+ * Walmart stores near a US ZIP (or a Canadian postal code with `domain: "ca"`),
1121
+ * nearest first, with `store_id`, address, distance, coordinates and hours.
1122
+ * Use a `store_id` with `delivery_zip` on `search()` or `product()`, on the
1123
+ * same domain, to target that store.
1124
+ *
1125
+ * Costs 1 credit.
1126
+ */
1127
+ stores(options: WalmartStoresOptions): Promise<WalmartStoresResponse>;
1033
1128
  }
1034
1129
 
1035
1130
  interface YouTubeSearchOptions {
@@ -4055,6 +4150,270 @@ declare class MetaAdsNamespace {
4055
4150
  ad(options: MetaAdsAdOptions): Promise<Record<string, unknown>>;
4056
4151
  }
4057
4152
 
4153
+ /** costco.com ("us", default) or costco.ca ("ca"). */
4154
+ type CostcoNaCountry = "us" | "ca";
4155
+ /**
4156
+ * Costco site. "us" (default) and "ca" support every filter; the other six
4157
+ * support keyword, sort and paging only.
4158
+ */
4159
+ type CostcoCountry = CostcoNaCountry | "uk" | "au" | "mx" | "jp" | "kr" | "tw";
4160
+ type CostcoSortBy = "best_match" | "price_low" | "price_high" | "top_rated" | "newest";
4161
+ type CostcoDealType = "new" | "while_supplies_last" | "treasure_hunt" | "member_favorites" | "online_only" | "on_sale";
4162
+ type CostcoPriceCode = "clearance" | "manager_markdown" | "special_buy";
4163
+ /** Filters shared by search, category and deals (us and ca). */
4164
+ interface CostcoListingFilters {
4165
+ /**
4166
+ * Costco warehouse number (e.g. "1062"). Adds that warehouse's in-store
4167
+ * price, stock status and price code to every result; omit for online
4168
+ * prices only.
4169
+ */
4170
+ warehouse_id?: string;
4171
+ /** Result order (default "best_match"). Costco broadens matching under any other sort. */
4172
+ sort_by?: CostcoSortBy;
4173
+ /** Brand names to keep, up to 20 (e.g. ["Kirkland Signature"]). */
4174
+ brands?: string[];
4175
+ /** Minimum online price, inclusive. */
4176
+ min_price?: number;
4177
+ /** Maximum online price, inclusive. */
4178
+ max_price?: number;
4179
+ /** Minimum average star rating (1-5). */
4180
+ min_rating?: number;
4181
+ /** Only items with an active discount. */
4182
+ on_sale?: boolean;
4183
+ /** Hide out-of-stock items. */
4184
+ in_stock?: boolean;
4185
+ /** Only items sold and in stock at warehouse_id (requires warehouse_id). */
4186
+ in_warehouse?: boolean;
4187
+ /** Results page, 1-based (1-500). */
4188
+ page?: number;
4189
+ /** Results per page (1-120, default 24). */
4190
+ page_size?: number;
4191
+ }
4192
+ interface CostcoSearchOptions extends CostcoListingFilters {
4193
+ /** Keywords, or a Costco item number (1-200 characters). */
4194
+ query: string;
4195
+ country?: CostcoCountry;
4196
+ [key: string]: unknown;
4197
+ }
4198
+ interface CostcoCategoryOptions extends CostcoListingFilters {
4199
+ /** Category slug from categories() (e.g. "televisions"), or a costco.com category URL. */
4200
+ category: string;
4201
+ country?: CostcoNaCountry;
4202
+ [key: string]: unknown;
4203
+ }
4204
+ interface CostcoCategoriesOptions {
4205
+ /**
4206
+ * Numeric Costco category id (e.g. "30001"). Omit for the top-level
4207
+ * departments; pass one for its full subcategory tree.
4208
+ */
4209
+ category_id?: string;
4210
+ country?: CostcoNaCountry;
4211
+ [key: string]: unknown;
4212
+ }
4213
+ interface CostcoProductOptions {
4214
+ /** Costco item number or product id, or a costco.com product URL. Pass this or item_ids. */
4215
+ item_id?: string;
4216
+ /** Up to 20 ids in one call (us and ca only). */
4217
+ item_ids?: string[];
4218
+ country?: CostcoCountry;
4219
+ [key: string]: unknown;
4220
+ }
4221
+ interface CostcoPricesOptions {
4222
+ /** Costco item number or product id. Pass this or item_ids. */
4223
+ item_id?: string;
4224
+ /** Up to 20 ids in one call. */
4225
+ item_ids?: string[];
4226
+ /**
4227
+ * Warehouses to price (1-10, e.g. ["1062", "1107"]). The online price is
4228
+ * always included.
4229
+ */
4230
+ warehouse_ids: string[];
4231
+ country?: CostcoNaCountry;
4232
+ [key: string]: unknown;
4233
+ }
4234
+ interface CostcoAvailabilityOptions {
4235
+ /** Costco item number or product id, or a costco.com product URL. */
4236
+ item_number: string;
4237
+ /** Warehouses to check (1-10). 1 credit per 5 warehouses. */
4238
+ warehouse_ids: string[];
4239
+ country?: CostcoNaCountry;
4240
+ [key: string]: unknown;
4241
+ }
4242
+ interface CostcoReviewsOptions {
4243
+ /** Costco product id (the product_id field from search or product). */
4244
+ product_id: string;
4245
+ /** Review order (default "newest"). */
4246
+ sort_by?: "newest" | "oldest" | "highest_rating" | "lowest_rating" | "most_helpful";
4247
+ /** Only reviews with this star rating (1-5). */
4248
+ rating?: number;
4249
+ /** Results page, 1-based (1-500). */
4250
+ page?: number;
4251
+ /** Reviews per page (1-100, default 25). */
4252
+ limit?: number;
4253
+ [key: string]: unknown;
4254
+ }
4255
+ interface CostcoWarehousesOptions {
4256
+ /** US zip code. Pass zip, or latitude and longitude. */
4257
+ zip?: string;
4258
+ latitude?: number;
4259
+ longitude?: number;
4260
+ country?: CostcoCountry;
4261
+ /** Nearest warehouses to return (1-50, default 10). */
4262
+ limit?: number;
4263
+ [key: string]: unknown;
4264
+ }
4265
+ interface CostcoGasOptions {
4266
+ /** US zip code. Pass zip, latitude and longitude, or warehouse_ids. */
4267
+ zip?: string;
4268
+ latitude?: number;
4269
+ longitude?: number;
4270
+ /** Specific warehouses instead of a location (1-10). */
4271
+ warehouse_ids?: string[];
4272
+ country?: CostcoNaCountry;
4273
+ /** Nearest stations to return (1-50). */
4274
+ limit?: number;
4275
+ [key: string]: unknown;
4276
+ }
4277
+ /** coupons takes no parameters. */
4278
+ interface CostcoCouponsOptions {
4279
+ [key: string]: unknown;
4280
+ }
4281
+ interface CostcoDealsOptions extends CostcoListingFilters {
4282
+ /** Deal feed. */
4283
+ type: CostcoDealType;
4284
+ country?: CostcoNaCountry;
4285
+ [key: string]: unknown;
4286
+ }
4287
+ interface CostcoClearanceOptions {
4288
+ /** Costco warehouse number to scan, from warehouses() (e.g. "1062"). */
4289
+ warehouse_id: string;
4290
+ /** Keywords to scan. Pass query or category. */
4291
+ query?: string;
4292
+ /** Category slug to scan instead of a query. */
4293
+ category?: string;
4294
+ /** Result pages of 120 to scan (1-5, default 3). */
4295
+ pages?: number;
4296
+ /**
4297
+ * Markdown codes to keep. Default clearance (.97) and manager_markdown
4298
+ * (.00/.88); add special_buy for .49/.79/.89 endings, which are common on
4299
+ * regular grocery prices.
4300
+ */
4301
+ price_codes?: CostcoPriceCode[];
4302
+ country?: CostcoNaCountry;
4303
+ [key: string]: unknown;
4304
+ }
4305
+ interface CostcoAutocompleteOptions {
4306
+ /** Partial search text (1-100 characters). */
4307
+ query: string;
4308
+ country?: CostcoNaCountry;
4309
+ [key: string]: unknown;
4310
+ }
4311
+ declare class CostcoNamespace {
4312
+ private client;
4313
+ constructor(client: Scavio);
4314
+ /**
4315
+ * Search Costco by keyword or item number: online price and original price,
4316
+ * ratings, member-only and stock flags, promotions and facets. Pass
4317
+ * `warehouse_id` to add that warehouse's in-store price and stock to every
4318
+ * result.
4319
+ *
4320
+ * Costs 1 credit.
4321
+ */
4322
+ search(options: CostcoSearchOptions): Promise<Record<string, unknown>>;
4323
+ /**
4324
+ * Products in a Costco category, with the same sort, filters and
4325
+ * per-warehouse pricing as search().
4326
+ *
4327
+ * Costs 1 credit.
4328
+ */
4329
+ category(options: CostcoCategoryOptions): Promise<Record<string, unknown>>;
4330
+ /**
4331
+ * The Costco department list, or the full subcategory tree under one
4332
+ * department when `category_id` is set.
4333
+ *
4334
+ * Costs 1 credit.
4335
+ */
4336
+ categories(options?: CostcoCategoriesOptions): Promise<Record<string, unknown>>;
4337
+ /**
4338
+ * Full details for up to 20 items: description, features, specifications,
4339
+ * variants, member-only and purchase limits, delivery fee, and promotions
4340
+ * with start and end dates. Pass `item_id` or `item_ids`.
4341
+ *
4342
+ * Costs 1 credit.
4343
+ */
4344
+ product(options: CostcoProductOptions): Promise<Record<string, unknown>>;
4345
+ /**
4346
+ * Online price versus in-warehouse price for up to 20 items across up to 10
4347
+ * warehouses, with each location's discount, final price, promotion dates
4348
+ * and price code.
4349
+ *
4350
+ * Costs 1 credit for up to 9 warehouses and 2 credits for 10.
4351
+ */
4352
+ prices(options: CostcoPricesOptions): Promise<Record<string, unknown>>;
4353
+ /**
4354
+ * In-warehouse stock status for one item at up to 10 warehouses, plus
4355
+ * pickup and same-day delivery availability. A status, never a quantity.
4356
+ *
4357
+ * Costs 1 credit per 5 warehouses.
4358
+ */
4359
+ availability(options: CostcoAvailabilityOptions): Promise<Record<string, unknown>>;
4360
+ /**
4361
+ * Customer reviews for a Costco product with the rating distribution and
4362
+ * recommend count; sort, star filter and up to 100 reviews per page.
4363
+ *
4364
+ * Costs 1 credit.
4365
+ */
4366
+ reviews(options: CostcoReviewsOptions): Promise<Record<string, unknown>>;
4367
+ /**
4368
+ * Costco warehouses near a US zip code or coordinates, nearest first:
4369
+ * warehouse_id, address, hours, departments, services, and gas station hours
4370
+ * and prices.
4371
+ *
4372
+ * Costs 1 credit, or 2 with country "ca".
4373
+ */
4374
+ warehouses(options: CostcoWarehousesOptions): Promise<Record<string, unknown>>;
4375
+ /**
4376
+ * Current regular, premium and diesel prices at Costco gas stations near a
4377
+ * location, or at specific warehouses.
4378
+ *
4379
+ * Costs 1 credit by location (2 with country "ca"); by `warehouse_ids`,
4380
+ * 1 credit per 5 warehouses on us and 2 credits per warehouse on ca.
4381
+ */
4382
+ gas(options: CostcoGasOptions): Promise<Record<string, unknown>>;
4383
+ /**
4384
+ * The current Costco member coupon book (US): every offer with its item
4385
+ * number, discount, final price, warehouse/online scope, limits and the
4386
+ * book's valid dates. Takes no parameters.
4387
+ *
4388
+ * Costs 1 credit.
4389
+ */
4390
+ coupons(options?: CostcoCouponsOptions): Promise<Record<string, unknown>>;
4391
+ /**
4392
+ * Costco deal feeds: new items, while supplies last, treasure hunt, member
4393
+ * favorites, online-only and everything on sale, with the same filters and
4394
+ * optional per-warehouse pricing as search().
4395
+ *
4396
+ * Costs 1 credit.
4397
+ */
4398
+ deals(options: CostcoDealsOptions): Promise<Record<string, unknown>>;
4399
+ /**
4400
+ * Markdown finder for one warehouse: scans a query or category and keeps
4401
+ * the items whose in-warehouse price ends in a markdown code - .97
4402
+ * clearance and .00/.88 manager markdown by default, .49/.79/.89 special
4403
+ * buys on request. The codes are the member-community decode; Costco does
4404
+ * not publish them. Only items Costco lists online are covered.
4405
+ *
4406
+ * Costs 1 credit.
4407
+ */
4408
+ clearance(options: CostcoClearanceOptions): Promise<Record<string, unknown>>;
4409
+ /**
4410
+ * Costco search-box suggestions for a partial query.
4411
+ *
4412
+ * Costs 1 credit.
4413
+ */
4414
+ autocomplete(options: CostcoAutocompleteOptions): Promise<Record<string, unknown>>;
4415
+ }
4416
+
4058
4417
  /**
4059
4418
  * Default client-side rate limit, safe on every plan including free.
4060
4419
  */
@@ -4138,6 +4497,7 @@ declare class Scavio {
4138
4497
  readonly companiesHouse: CompaniesHouseNamespace;
4139
4498
  readonly googleAds: GoogleAdsNamespace;
4140
4499
  readonly metaAds: MetaAdsNamespace;
4500
+ readonly costco: CostcoNamespace;
4141
4501
  private readonly apiKey;
4142
4502
  private readonly baseUrl;
4143
4503
  private readonly timeout;
@@ -4224,4 +4584,4 @@ declare class ScavioAPIError extends ScavioError {
4224
4584
  constructor(statusCode: number, message: string, responseBody?: Record<string, unknown>);
4225
4585
  }
4226
4586
 
4227
- 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, 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, 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 };
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 };
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.18.1" : "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 = {};
@@ -611,7 +624,11 @@ var WalmartNamespace = class {
611
624
  * Structured Walmart search results: `products[]`, `products_count` and the
612
625
  * resolved `location`. Page through with `page` (1-indexed).
613
626
  *
614
- * Costs 1 credit for `domain` "com" or "ca", 2 credits for "com.mx".
627
+ * Pass `delivery_zip` + `store_id` to get one store's results (walmart.com
628
+ * and walmart.ca); `data.location` confirms the store.
629
+ *
630
+ * Costs 1 credit for `domain` "com" or "ca", 2 credits for "com.mx", and 2
631
+ * credits when store-targeted.
615
632
  */
616
633
  async search(options) {
617
634
  return this.client._post("/api/v1/walmart/search", options);
@@ -620,8 +637,11 @@ var WalmartNamespace = class {
620
637
  * Full product detail: price, rating, images, specifications, availability
621
638
  * and seller.
622
639
  *
623
- * Costs 1 credit. Walmart.ca product pages are not fetchable, so this is
624
- * walmart.com only.
640
+ * Pass `delivery_zip` + `store_id` for one store's price and availability.
641
+ * `domain: "ca"` is available only together with a store target.
642
+ *
643
+ * Costs 1 credit, or 2 when store-targeted. A store that does not carry the
644
+ * item returns 404.
625
645
  */
626
646
  async product(options) {
627
647
  return this.client._post("/api/v1/walmart/product", options);
@@ -672,6 +692,20 @@ var WalmartNamespace = class {
672
692
  async sellerProducts(options) {
673
693
  return this.client._post("/api/v1/walmart/seller-products", options);
674
694
  }
695
+ /**
696
+ * Walmart stores near a US ZIP (or a Canadian postal code with `domain: "ca"`),
697
+ * nearest first, with `store_id`, address, distance, coordinates and hours.
698
+ * Use a `store_id` with `delivery_zip` on `search()` or `product()`, on the
699
+ * same domain, to target that store.
700
+ *
701
+ * Costs 1 credit.
702
+ */
703
+ async stores(options) {
704
+ return await this.client._post(
705
+ "/api/v1/walmart/stores",
706
+ options
707
+ );
708
+ }
675
709
  };
676
710
 
677
711
  // src/namespaces/youtube.ts
@@ -2236,6 +2270,141 @@ var MetaAdsNamespace = class {
2236
2270
  }
2237
2271
  };
2238
2272
 
2273
+ // src/namespaces/costco.ts
2274
+ var CostcoNamespace = class {
2275
+ constructor(client) {
2276
+ this.client = client;
2277
+ }
2278
+ client;
2279
+ /**
2280
+ * Search Costco by keyword or item number: online price and original price,
2281
+ * ratings, member-only and stock flags, promotions and facets. Pass
2282
+ * `warehouse_id` to add that warehouse's in-store price and stock to every
2283
+ * result.
2284
+ *
2285
+ * Costs 1 credit.
2286
+ */
2287
+ async search(options) {
2288
+ return this.client._post("/api/v1/costco/search", options);
2289
+ }
2290
+ /**
2291
+ * Products in a Costco category, with the same sort, filters and
2292
+ * per-warehouse pricing as search().
2293
+ *
2294
+ * Costs 1 credit.
2295
+ */
2296
+ async category(options) {
2297
+ return this.client._post("/api/v1/costco/category", options);
2298
+ }
2299
+ /**
2300
+ * The Costco department list, or the full subcategory tree under one
2301
+ * department when `category_id` is set.
2302
+ *
2303
+ * Costs 1 credit.
2304
+ */
2305
+ async categories(options = {}) {
2306
+ return this.client._post("/api/v1/costco/categories", options);
2307
+ }
2308
+ /**
2309
+ * Full details for up to 20 items: description, features, specifications,
2310
+ * variants, member-only and purchase limits, delivery fee, and promotions
2311
+ * with start and end dates. Pass `item_id` or `item_ids`.
2312
+ *
2313
+ * Costs 1 credit.
2314
+ */
2315
+ async product(options) {
2316
+ return this.client._post("/api/v1/costco/product", options);
2317
+ }
2318
+ /**
2319
+ * Online price versus in-warehouse price for up to 20 items across up to 10
2320
+ * warehouses, with each location's discount, final price, promotion dates
2321
+ * and price code.
2322
+ *
2323
+ * Costs 1 credit for up to 9 warehouses and 2 credits for 10.
2324
+ */
2325
+ async prices(options) {
2326
+ return this.client._post("/api/v1/costco/prices", options);
2327
+ }
2328
+ /**
2329
+ * In-warehouse stock status for one item at up to 10 warehouses, plus
2330
+ * pickup and same-day delivery availability. A status, never a quantity.
2331
+ *
2332
+ * Costs 1 credit per 5 warehouses.
2333
+ */
2334
+ async availability(options) {
2335
+ return this.client._post("/api/v1/costco/availability", options);
2336
+ }
2337
+ /**
2338
+ * Customer reviews for a Costco product with the rating distribution and
2339
+ * recommend count; sort, star filter and up to 100 reviews per page.
2340
+ *
2341
+ * Costs 1 credit.
2342
+ */
2343
+ async reviews(options) {
2344
+ return this.client._post("/api/v1/costco/reviews", options);
2345
+ }
2346
+ /**
2347
+ * Costco warehouses near a US zip code or coordinates, nearest first:
2348
+ * warehouse_id, address, hours, departments, services, and gas station hours
2349
+ * and prices.
2350
+ *
2351
+ * Costs 1 credit, or 2 with country "ca".
2352
+ */
2353
+ async warehouses(options) {
2354
+ return this.client._post("/api/v1/costco/warehouses", options);
2355
+ }
2356
+ /**
2357
+ * Current regular, premium and diesel prices at Costco gas stations near a
2358
+ * location, or at specific warehouses.
2359
+ *
2360
+ * Costs 1 credit by location (2 with country "ca"); by `warehouse_ids`,
2361
+ * 1 credit per 5 warehouses on us and 2 credits per warehouse on ca.
2362
+ */
2363
+ async gas(options) {
2364
+ return this.client._post("/api/v1/costco/gas", options);
2365
+ }
2366
+ /**
2367
+ * The current Costco member coupon book (US): every offer with its item
2368
+ * number, discount, final price, warehouse/online scope, limits and the
2369
+ * book's valid dates. Takes no parameters.
2370
+ *
2371
+ * Costs 1 credit.
2372
+ */
2373
+ async coupons(options = {}) {
2374
+ return this.client._post("/api/v1/costco/coupons", options);
2375
+ }
2376
+ /**
2377
+ * Costco deal feeds: new items, while supplies last, treasure hunt, member
2378
+ * favorites, online-only and everything on sale, with the same filters and
2379
+ * optional per-warehouse pricing as search().
2380
+ *
2381
+ * Costs 1 credit.
2382
+ */
2383
+ async deals(options) {
2384
+ return this.client._post("/api/v1/costco/deals", options);
2385
+ }
2386
+ /**
2387
+ * Markdown finder for one warehouse: scans a query or category and keeps
2388
+ * the items whose in-warehouse price ends in a markdown code - .97
2389
+ * clearance and .00/.88 manager markdown by default, .49/.79/.89 special
2390
+ * buys on request. The codes are the member-community decode; Costco does
2391
+ * not publish them. Only items Costco lists online are covered.
2392
+ *
2393
+ * Costs 1 credit.
2394
+ */
2395
+ async clearance(options) {
2396
+ return this.client._post("/api/v1/costco/clearance", options);
2397
+ }
2398
+ /**
2399
+ * Costco search-box suggestions for a partial query.
2400
+ *
2401
+ * Costs 1 credit.
2402
+ */
2403
+ async autocomplete(options) {
2404
+ return this.client._post("/api/v1/costco/autocomplete", options);
2405
+ }
2406
+ };
2407
+
2239
2408
  // src/client.ts
2240
2409
  var DEFAULT_MAX_REQUESTS_PER_SECOND = 1;
2241
2410
  var MAX_REQUESTS_PER_SECOND = 50;
@@ -2271,6 +2440,7 @@ var Scavio = class {
2271
2440
  companiesHouse;
2272
2441
  googleAds;
2273
2442
  metaAds;
2443
+ costco;
2274
2444
  apiKey;
2275
2445
  baseUrl;
2276
2446
  timeout;
@@ -2322,6 +2492,7 @@ var Scavio = class {
2322
2492
  this.companiesHouse = new CompaniesHouseNamespace(this);
2323
2493
  this.googleAds = new GoogleAdsNamespace(this);
2324
2494
  this.metaAds = new MetaAdsNamespace(this);
2495
+ this.costco = new CostcoNamespace(this);
2325
2496
  }
2326
2497
  /** @internal */
2327
2498
  async _post(path, body) {
@@ -2386,6 +2557,7 @@ export {
2386
2557
  BookingNamespace,
2387
2558
  CapterraNamespace,
2388
2559
  CompaniesHouseNamespace,
2560
+ CostcoNamespace,
2389
2561
  DEFAULT_MAX_REQUESTS_PER_SECOND,
2390
2562
  EbayNamespace,
2391
2563
  G2Namespace,