scavio 0.10.0 → 0.12.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
@@ -65,23 +65,52 @@ await client.google.trends({ query: "bitcoin" });
65
65
 
66
66
  ### Amazon
67
67
 
68
+ Responses are normalized to a stable shape (see the breaking-change note
69
+ below); each call costs 1 credit. `country` is an ISO 3166-1 alpha-2
70
+ marketplace code (`us`, `gb`, `de`, ...) and defaults to `us`.
71
+
68
72
  ```typescript
69
73
  // Search products
70
74
  await client.amazon.search({
71
75
  query: "laptop",
72
- domain: "amazon.com", // optional
73
- country: "us", // optional
74
- sort_by: "price_asc", // optional
75
- pages: 1, // optional
76
+ country: "de", // optional, marketplace
77
+ page: 2, // optional, 1-based
76
78
  });
77
79
 
78
80
  // Get product by ASIN
79
81
  await client.amazon.product({
80
82
  asin: "B09V3KXJPB",
81
- domain: "amazon.com", // optional
83
+ country: "us", // optional
82
84
  });
85
+
86
+ // Every seller offering that ASIN, with the buy box winner flagged
87
+ const res = await client.amazon.offers({ asin: "B09V3KXJPB" });
88
+ // res.data -> { asin, title, count, total_offers, has_more_pages, page, offers[] }
89
+ // res.data.offers[i] -> { price, currency, condition, seller_name,
90
+ // is_buy_box_winner, is_fulfilled_by_amazon,
91
+ // shipping_price, list_price, delivery, prime_delivery }
92
+
93
+ // Supported marketplaces (no API key required)
94
+ await client.amazon.options();
83
95
  ```
84
96
 
97
+ There is no sort parameter: the marketplace was verified to ignore every sort
98
+ value and return the same unordered set, so exposing one would be a filter that
99
+ silently does nothing.
100
+
101
+ #### Amazon changed in 0.12.0 (breaking)
102
+
103
+ Amazon moved to a new upstream and the API now returns a normalized shape
104
+ instead of the previous raw provider payload.
105
+
106
+ - `search` returns `{query, page, total_results, total_results_text, count, products[], filters[], related_searches[]}`.
107
+ Each product is `{asin, title, url, image, price, currency, rating, reviews_count, is_sponsored, position, badge, sales_volume, delivery{is_free, date, fastest_date}}`.
108
+ - `product` returns flat fields: `price`, `list_price`, `currency`, `rating`, `reviews_count`, `features`, `images`, `videos`, `variants`, `specifications`, `best_sellers_rank`, `shipping`, and more. The old `buybox[]` array no longer exists — use `offers` for per-seller pricing.
109
+ - `offers` is new: every seller for one ASIN. 1 credit, page 1 only.
110
+ - `country` (ISO 3166-1 alpha-2) is the marketplace selector and replaces `domain`; `page` replaces `start_page`. Both old names still work as deprecated aliases.
111
+ - Nine options were removed: `language`, `currency`, `device`, `sort_by`, `pages`, `category_id`, `merchant_id`, `zip_code`, `autoselect_variant`. Sending one anyway still returns 200, with a top-level `warnings` array naming what was ignored.
112
+ - `options()` still returns `domains` and `countries`; `languages` and `currencies` are now always empty, because neither is a request parameter any more.
113
+
85
114
  ### Walmart
86
115
 
87
116
  ```typescript
package/dist/index.cjs CHANGED
@@ -311,7 +311,18 @@ var AmazonNamespace = class {
311
311
  ...rest
312
312
  });
313
313
  }
314
- /** Supported Amazon domains, languages, currencies, and countries. */
314
+ /** Every seller offer for one ASIN: price, seller, condition, shipping, and
315
+ * which offer holds the buy box. Page 1 only. */
316
+ async offers(options) {
317
+ const { asin, ...rest } = options;
318
+ return this.client._post("/api/v1/amazon/offers", {
319
+ query: asin,
320
+ ...rest
321
+ });
322
+ }
323
+ /** Supported Amazon marketplaces, as `domains` and `countries`. `languages`
324
+ * and `currencies` remain in the payload but are always empty: neither is a
325
+ * request parameter any more. */
315
326
  async options() {
316
327
  return this.client._get("/api/v1/amazon/options");
317
328
  }
@@ -764,7 +775,10 @@ var LinkedInNamespace = class {
764
775
  async personAbout(options) {
765
776
  return this.client._post("/api/v1/linkedin/person/about", options);
766
777
  }
767
- /** Recent posts, up to 50. Upstream exposes no further pages. */
778
+ /**
779
+ * A member's posts, or the posts they commented on or reacted to via `type`.
780
+ * 50 per page; pass the previous response's `next_cursor` to advance.
781
+ */
768
782
  async personPosts(options) {
769
783
  return this.client._post("/api/v1/linkedin/person/posts", options);
770
784
  }
@@ -772,11 +786,14 @@ var LinkedInNamespace = class {
772
786
  async company(options) {
773
787
  return this.client._post("/api/v1/linkedin/company", options);
774
788
  }
775
- /** Recent company posts, up to 50. Upstream exposes no further pages. */
789
+ /** Recent company posts, 50 per page; advance with `next_cursor`. */
776
790
  async companyPosts(options) {
777
791
  return this.client._post("/api/v1/linkedin/company/posts", options);
778
792
  }
779
- /** Job search. Upstream rotates its result set, so repeat calls differ. */
793
+ /**
794
+ * Job search, 25 per page; advance with `next_cursor`. Upstream rotates its
795
+ * result set, so pages overlap slightly - dedupe by job id.
796
+ */
780
797
  async searchJobs(options) {
781
798
  return this.client._post("/api/v1/linkedin/search/jobs", options);
782
799
  }
@@ -788,7 +805,7 @@ var LinkedInNamespace = class {
788
805
  async post(options) {
789
806
  return this.client._post("/api/v1/linkedin/post", options);
790
807
  }
791
- /** Comments with their replies, 10 per page. */
808
+ /** Comments with their replies. Page size varies - keep paging until empty. */
792
809
  async postComments(options) {
793
810
  return this.client._post("/api/v1/linkedin/post/comments", options);
794
811
  }