scavio 0.34.2 → 0.36.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/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Scavio
2
2
 
3
3
  TypeScript SDK for the [Scavio API](https://scavio.dev?utm_source=npm-scavio-js&utm_medium=package&utm_campaign=readme) — real-time structured web
4
- data across 59 platforms on one API key, plus `extract()` to read
4
+ data across 60 platforms on one API key, plus `extract()` to read
5
5
  any URL as clean Markdown, and `extract.map()` / `extract.crawl()` /
6
6
  `extract.batch()` to map, crawl and batch-extract whole websites.
7
7
 
@@ -9,7 +9,7 @@ Structured JSON in, structured JSON out. No per-site parsers to maintain.
9
9
 
10
10
  - **Search and SERP** — Google (organic, news, maps, shopping, flights, hotels, trends, AI Mode)
11
11
  - **AI assistants** — ChatGPT and Gemini answers with the sources they cite and the products they recommend
12
- - **E-commerce** — Amazon, Walmart, Costco, Lowe's, Sam's Club, Canadian Tire, Dollar General, Sephora, Ulta Beauty, ALDI, Micro Center, Walgreens, CVS, Whole Foods, Harbor Freight, PetSmart, Petco, iHerb, Chewy, Menards, Mercado Libre, eBay, Target, Home Depot, TikTok Shop
12
+ - **E-commerce** — Amazon, Walmart, Costco, Lowe's, Sam's Club, Canadian Tire, Dollar General, Sephora, Ulta Beauty, ALDI, Micro Center, Walgreens, CVS, Whole Foods, Harbor Freight, PetSmart, Petco, iHerb, Chewy, Menards, Nordstrom, Mercado Libre, eBay, Target, Home Depot, TikTok Shop
13
13
  - **Real estate and travel** — Zillow, Redfin, Realtor.com, Rightmove, Booking, Airbnb, Tripadvisor
14
14
  - **Reviews and local** — Trustpilot, Yelp, G2, Capterra, Glassdoor, App Store, Google Play
15
15
  - **Jobs and companies** — Indeed, Glassdoor, SEC EDGAR, Companies House
@@ -683,6 +683,67 @@ and `product` can take 10-25 seconds, so they raise it to `IHERB_SLOW_TIMEOUT`
683
683
  (120s); Menards `product` with a store can take 10-40 seconds, so it raises it
684
684
  to `MENARDS_PRODUCT_TIMEOUT` (120s). None ever lowers a longer client timeout.
685
685
 
686
+ ### [Nordstrom](https://scavio.dev/docs/nordstrom-search?utm_source=npm-scavio-js&utm_medium=package&utm_campaign=readme)
687
+
688
+ Seven endpoints, nordstrom.com (US site only). `search` and `product` are new in
689
+ 0.35.0; `category`, `brand`, `stores`, `availability` and `suggestions` are new
690
+ in 0.36.0. `availability` costs 10 credits (the product page plus the store
691
+ lookup); every other call costs 5.
692
+
693
+ - `search`, `category` and `brand` return 24 products a page with current and
694
+ original price ranges, percent off, on-sale flag, rating, review count,
695
+ badges and colors; `sort` is `relevance` (default), `rating`, `price_high`,
696
+ `price_low`, `newest` or `percent_off`. `category` takes a `/browse` path or
697
+ URL (departments, `sale/women`, `/browse/new`); `brand` takes a
698
+ `/brands/<slug>--<id>` path or URL (a product's `brand_url` works). Both also
699
+ return the category or brand (name, title, path, URL, breadcrumbs,
700
+ subcategories) and the filter sidebar with option counts (top 100 options per
701
+ group); filters inside a category URL are ignored.
702
+ - `product` takes a result's `url` or `style_id` and lists every color and size
703
+ as a sku with UPC, price, price type, `in_stock` and the `quantity` available
704
+ to ship. `in_stock` is true when the sku can be shipped or picked up in a
705
+ store, so a sku can be in stock with `quantity` 0 (store-only).
706
+ - `availability` takes `url` or `style_id` (optionally `sku_id`) and returns per
707
+ sku `ship_quantity`, `pickup_available`, `pick_quantity` and the stores that
708
+ can do in-store pickup. Quantities are chain-wide; per store Nordstrom only
709
+ says whether pickup is available, not how many.
710
+ - `stores` takes exactly one of `zip`, `latitude` + `longitude`, or
711
+ `store_numbers` (array or comma-separated string), with `distance_miles`
712
+ 1-100 (default 100). Each store has address, phone, hours, daily hours,
713
+ coordinates, pickup and curbside flags and amenities. A ZIP with no store in
714
+ range is an empty list (still billed).
715
+ - `suggestions` returns the site's autocomplete strings for a partial `query`
716
+ (`limit` 1-20, default 8).
717
+
718
+ ```ts
719
+ const found = await client.nordstrom.search({ query: "dress", sort: "percent_off" });
720
+ const top = (found as any).data.products[0];
721
+ console.log(top.style_id, top.brand, top.name, top.price, top.percent_off);
722
+
723
+ const item = await client.nordstrom.product({ style_id: top.style_id });
724
+ for (const color of (item as any).data.colors) {
725
+ for (const sku of color.skus) console.log(color.name, sku.size, sku.upc, sku.price, sku.price_type, sku.quantity);
726
+ }
727
+
728
+ const dresses = await client.nordstrom.category({ category: "/browse/women/clothing/dresses", sort: "price_low" });
729
+ const label = await client.nordstrom.brand({ brand: "/brands/astr-the-label--53360" });
730
+ const near = await client.nordstrom.stores({ zip: "10001" });
731
+
732
+ const stock = await client.nordstrom.availability({ style_id: "7737947" });
733
+ for (const sku of (stock as any).data.skus) {
734
+ console.log(sku.sku_id, sku.size, sku.color, sku.ship_quantity, sku.pick_quantity, sku.pickup_store_count);
735
+ }
736
+
737
+ const ideas = await client.nordstrom.suggestions({ query: "nike air" });
738
+ console.log((ideas as any).data.suggestions);
739
+ ```
740
+
741
+ `product` returns the reviews shown on the product page (up to about 13) plus
742
+ the total review count and star histogram; the full review history is not
743
+ available. An unknown style id, sku id, category or brand is a 404. Every call
744
+ raises the request timeout to `NORDSTROM_TIMEOUT` (120s), never lowering a
745
+ longer client timeout.
746
+
686
747
  ### [Mercado Libre](https://scavio.dev/docs/mercadolibre-search?utm_source=npm-scavio-js&utm_medium=package&utm_campaign=readme)
687
748
 
688
749
  Five endpoints, new in 0.21.0: `reviews` costs 1 credit, the other four 2. The
package/dist/index.cjs CHANGED
@@ -76,6 +76,8 @@ __export(index_exports, {
76
76
  MetaAdsNamespace: () => MetaAdsNamespace,
77
77
  MicroCenterNamespace: () => MicroCenterNamespace,
78
78
  MissingAPIKeyError: () => MissingAPIKeyError,
79
+ NORDSTROM_TIMEOUT: () => NORDSTROM_TIMEOUT,
80
+ NordstromNamespace: () => NordstromNamespace,
79
81
  NotFoundError: () => NotFoundError,
80
82
  PETCO_SLOW_TIMEOUT: () => PETCO_SLOW_TIMEOUT,
81
83
  PetcoNamespace: () => PetcoNamespace,
@@ -259,7 +261,7 @@ function parseRetryAfter(header) {
259
261
  var BASE_URL = "https://api.scavio.dev";
260
262
  var DEFAULT_TIMEOUT = 3e4;
261
263
  var DEFAULT_MAX_RETRIES = 2;
262
- var SDK_VERSION = true ? "0.34.2" : "0.0.0";
264
+ var SDK_VERSION = true ? "0.36.0" : "0.0.0";
263
265
  var USER_AGENT = `scavio-js/${SDK_VERSION}`;
264
266
  function isServerRuntime() {
265
267
  const g = globalThis;
@@ -3902,6 +3904,122 @@ var MenardsNamespace = class {
3902
3904
  }
3903
3905
  };
3904
3906
 
3907
+ // src/namespaces/nordstrom.ts
3908
+ var NORDSTROM_TIMEOUT = 12e4;
3909
+ var NordstromNamespace = class {
3910
+ constructor(client) {
3911
+ this.client = client;
3912
+ }
3913
+ client;
3914
+ /**
3915
+ * Search nordstrom.com (US) products, 24 per page, sorted by relevance,
3916
+ * rating, price, newest or percent off. Each result has style id, URL,
3917
+ * name, brand, image, current price and price range in dollars, original
3918
+ * price range, percent off and on-sale flag, rating, review count, badges
3919
+ * such as new or new_markdown, a low-inventory flag, whether it is sold by a
3920
+ * marketplace seller (and the seller's name), and every color with its color
3921
+ * family and image. Also returns the total result count and page count. Use
3922
+ * a result's url or style_id with product().
3923
+ *
3924
+ * Costs 5 credits.
3925
+ */
3926
+ async search(options) {
3927
+ return this.client._post("/api/v1/nordstrom/search", options, void 0, NORDSTROM_TIMEOUT);
3928
+ }
3929
+ /**
3930
+ * One nordstrom.com (US) product by URL or style id: name, brand,
3931
+ * description, feature bullets, fit notes, final-sale flag, current,
3932
+ * original and clearance price ranges, percent off, rating, review count,
3933
+ * the star histogram, the size-fit distribution (too small to too big), the
3934
+ * AI review summary when the site shows one, the most mentioned praised and
3935
+ * criticized features with a quote each, breadcrumbs and images. Every color
3936
+ * lists its images and every size as a sku with sku id, size, size type,
3937
+ * UPC, price, original price, percent off, price type (regular, clearance,
3938
+ * promotion), in_stock and the quantity available to ship. in_stock is true
3939
+ * when the sku can be shipped or picked up in a store, so a sku held only in
3940
+ * a store reads in stock with quantity 0 (availability() lists its pickup
3941
+ * stores). Includes the reviews shown on the product page (up to about 13),
3942
+ * with the total review count; each review has title, text, rating, size
3943
+ * rating, author, date, helpful votes and verified-purchase flag. Pass url
3944
+ * or style_id. An unknown style id is a 404.
3945
+ *
3946
+ * Costs 5 credits.
3947
+ */
3948
+ async product(options) {
3949
+ return this.client._post("/api/v1/nordstrom/product", options, void 0, NORDSTROM_TIMEOUT);
3950
+ }
3951
+ /**
3952
+ * Browse a nordstrom.com (US) category page, 24 products per page, sorted
3953
+ * by relevance, rating, price, newest or percent off. Works on any /browse
3954
+ * category, including sale (sale/women), new arrivals (/browse/new) and
3955
+ * top-level departments (/browse/women). Returns the category's name, page
3956
+ * title, path, URL, breadcrumbs and subcategories (name and path, for
3957
+ * drilling down). Each product has the same fields as a search result. Also
3958
+ * returns the total result count, page count, and the filter sidebar: each
3959
+ * filter group with its options and product counts (groups with more than
3960
+ * 100 options list the 100 with the most products and give the full
3961
+ * option_count). An unknown category is a 404.
3962
+ *
3963
+ * Costs 5 credits.
3964
+ */
3965
+ async category(options) {
3966
+ return this.client._post("/api/v1/nordstrom/category", options, void 0, NORDSTROM_TIMEOUT);
3967
+ }
3968
+ /**
3969
+ * List a brand's products on nordstrom.com (US) from its brand page, 24 per
3970
+ * page, sorted by relevance, rating, price, newest or percent off. Returns
3971
+ * the brand's name, path, URL, breadcrumbs and sub-pages (Women, Men,
3972
+ * Kids...), products with the same fields as a search result, the total
3973
+ * result count, page count and the filter sidebar with option counts. An
3974
+ * unknown brand is a 404.
3975
+ *
3976
+ * Costs 5 credits.
3977
+ */
3978
+ async brand(options) {
3979
+ return this.client._post("/api/v1/nordstrom/brand", options, void 0, NORDSTROM_TIMEOUT);
3980
+ }
3981
+ /**
3982
+ * Find Nordstrom stores (full-line stores and Nordstrom Local) near a US ZIP
3983
+ * code or latitude/longitude within up to 100 miles, nearest first, or look
3984
+ * stores up by store number. Each store has store number, name, type
3985
+ * (full_line or local), address, phone, weekly hours, holiday hours when
3986
+ * posted, open and close times for the next 8 days, time zone, distance in
3987
+ * miles, coordinates, whether it offers buy-online pickup and curbside
3988
+ * pickup, its amenities and its store page URL. A ZIP with no store in range
3989
+ * returns an empty list.
3990
+ *
3991
+ * Costs 5 credits.
3992
+ */
3993
+ async stores(options) {
3994
+ return this.client._post("/api/v1/nordstrom/stores", options, void 0, NORDSTROM_TIMEOUT);
3995
+ }
3996
+ /**
3997
+ * Online and store-pickup availability for every size and color of one
3998
+ * nordstrom.com (US) product, by URL or style id, optionally one sku. Each
3999
+ * sku has sku id, size, color, UPC, in_stock, whether it ships and the
4000
+ * quantity available to ship, the quantity available for pickup, and the
4001
+ * stores where it can be picked up (store number, name, address, city,
4002
+ * state, ZIP, phone). Quantities are chain-wide: per store Nordstrom only
4003
+ * says whether pickup is available, not how many. An unknown style id or sku
4004
+ * id is a 404.
4005
+ *
4006
+ * Costs 10 credits (the product page plus the store lookup).
4007
+ */
4008
+ async availability(options) {
4009
+ return this.client._post("/api/v1/nordstrom/availability", options, void 0, NORDSTROM_TIMEOUT);
4010
+ }
4011
+ /**
4012
+ * The search-box autocomplete of nordstrom.com: the queries Nordstrom
4013
+ * suggests for a partial search term, most likely first. Useful for keyword
4014
+ * research and for building queries for search().
4015
+ *
4016
+ * Costs 5 credits.
4017
+ */
4018
+ async suggestions(options) {
4019
+ return this.client._post("/api/v1/nordstrom/suggestions", options, void 0, NORDSTROM_TIMEOUT);
4020
+ }
4021
+ };
4022
+
3905
4023
  // src/namespaces/trustpilot.ts
3906
4024
  var TrustpilotNamespace = class {
3907
4025
  constructor(client) {
@@ -4434,6 +4552,7 @@ var Scavio = class extends ScavioCore {
4434
4552
  iherb;
4435
4553
  chewy;
4436
4554
  menards;
4555
+ nordstrom;
4437
4556
  trustpilot;
4438
4557
  chatgpt;
4439
4558
  gemini;
@@ -4514,6 +4633,7 @@ var Scavio = class extends ScavioCore {
4514
4633
  this.iherb = new IherbNamespace(this);
4515
4634
  this.chewy = new ChewyNamespace(this);
4516
4635
  this.menards = new MenardsNamespace(this);
4636
+ this.nordstrom = new NordstromNamespace(this);
4517
4637
  this.trustpilot = new TrustpilotNamespace(this);
4518
4638
  this.chatgpt = new ChatgptNamespace(this);
4519
4639
  this.gemini = new GeminiNamespace(this);
@@ -4669,6 +4789,8 @@ async function getSubtle() {
4669
4789
  MetaAdsNamespace,
4670
4790
  MicroCenterNamespace,
4671
4791
  MissingAPIKeyError,
4792
+ NORDSTROM_TIMEOUT,
4793
+ NordstromNamespace,
4672
4794
  NotFoundError,
4673
4795
  PETCO_SLOW_TIMEOUT,
4674
4796
  PetcoNamespace,