shopsavvy-sdk 1.0.2 → 1.1.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.
- checksums.yaml +4 -4
- data/README.md +0 -13
- data/lib/shopsavvy_data_api/client.rb +48 -0
- data/lib/shopsavvy_data_api/models.rb +52 -1
- data/lib/shopsavvy_data_api/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d423e461903d6f1c9627b3b055a19e3e4ebc25a7145c6a0f6b117067fdf231a6
|
|
4
|
+
data.tar.gz: 939995fa50338ba615d54e71f87fa75d44023faf4ec2057c5fef93f5a638d403
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 16e15e94cdee0d79b3ee20d2ecdf1a86c61cde8c4e2652b3171008fd415be2246611f0478c2dedcde1ed3d78c0e38a859122bd2667f36cde864f6f549a331cbd
|
|
7
|
+
data.tar.gz: ab8c59540a85e4e412659c4c64dc81f1812f8b339bcfcc6b69211fa39a33cc3dbeded890a72c9717f60fc1d053ae51c12a746722e51fc428bd013ffb63e122c5
|
data/README.md
CHANGED
|
@@ -20,19 +20,6 @@ product = client.get_product_details('012345678901')
|
|
|
20
20
|
puts "#{product.data.name} - Best price: $#{client.get_current_offers('012345678901').data.min_by(&:price).price}"
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
-
## 📊 Feature Comparison
|
|
24
|
-
|
|
25
|
-
| Feature | Free Tier | Pro | Enterprise |
|
|
26
|
-
|---------|-----------|-----|-----------|
|
|
27
|
-
| **API Calls/Month** | 1,000 | 100,000 | Unlimited |
|
|
28
|
-
| **Product Details** | ✅ | ✅ | ✅ |
|
|
29
|
-
| **Real-time Pricing** | ✅ | ✅ | ✅ |
|
|
30
|
-
| **Price History** | 30 days | 1 year | 5+ years |
|
|
31
|
-
| **Bulk Operations** | 10/batch | 100/batch | 1000/batch |
|
|
32
|
-
| **Retailer Coverage** | 50+ | 500+ | 1000+ |
|
|
33
|
-
| **Rate Limiting** | 60/hour | 1000/hour | Custom |
|
|
34
|
-
| **Support** | Community | Email | Phone + Dedicated |
|
|
35
|
-
|
|
36
23
|
## 🚀 Installation & Setup
|
|
37
24
|
|
|
38
25
|
### Installation
|
|
@@ -253,6 +253,54 @@ module ShopsavvyDataApi
|
|
|
253
253
|
APIResponse.new(response, data_class: UsageInfo)
|
|
254
254
|
end
|
|
255
255
|
|
|
256
|
+
# Browse current shopping deals
|
|
257
|
+
# @param sort [String] Sort algorithm: hot, new, top-hour, top-day, top-week
|
|
258
|
+
# @param limit [Integer] Results per page (1-100)
|
|
259
|
+
# @param offset [Integer] Pagination offset
|
|
260
|
+
# @param options [Hash] Additional filters (category, retailer, tag, min_price, max_price, grade)
|
|
261
|
+
# @return [Hash] Deals response with deals array and pagination
|
|
262
|
+
def get_deals(sort: "hot", limit: 25, offset: 0, **options)
|
|
263
|
+
params = { sort: sort, limit: limit, offset: offset }.merge(options).compact
|
|
264
|
+
make_request(:get, "deals", params: params)
|
|
265
|
+
end
|
|
266
|
+
|
|
267
|
+
# Get TLDR review for a product (pros, cons, scores)
|
|
268
|
+
# @param identifier [String] Product identifier (barcode, ASIN, URL, model number)
|
|
269
|
+
# @return [Hash] Review response with review data or null
|
|
270
|
+
def get_product_review(identifier)
|
|
271
|
+
make_request(:get, "products/reviews", params: { id: identifier })
|
|
272
|
+
end
|
|
273
|
+
|
|
274
|
+
# Look up multiple products at once (sync for <=20, async for >20)
|
|
275
|
+
# @param identifiers [Array<String>] Product identifiers (max 100)
|
|
276
|
+
# @param include [Array<String>] Optional extras: ["offers"], ["reviews"]
|
|
277
|
+
def batch_lookup(identifiers, include: nil)
|
|
278
|
+
body = { identifiers: identifiers }
|
|
279
|
+
body[:include] = include if include
|
|
280
|
+
make_request(:post, "products/batch", body: body)
|
|
281
|
+
end
|
|
282
|
+
|
|
283
|
+
# Poll for async batch job results
|
|
284
|
+
def get_batch_status(batch_id)
|
|
285
|
+
make_request(:get, "batch/#{batch_id}")
|
|
286
|
+
end
|
|
287
|
+
|
|
288
|
+
def create_webhook(url, events:)
|
|
289
|
+
make_request(:post, "webhooks", body: { url: url, events: events })
|
|
290
|
+
end
|
|
291
|
+
|
|
292
|
+
def list_webhooks
|
|
293
|
+
make_request(:get, "webhooks")
|
|
294
|
+
end
|
|
295
|
+
|
|
296
|
+
def test_webhook(webhook_id)
|
|
297
|
+
make_request(:post, "webhooks/#{webhook_id}/test")
|
|
298
|
+
end
|
|
299
|
+
|
|
300
|
+
def delete_webhook(webhook_id)
|
|
301
|
+
make_request(:delete, "webhooks/#{webhook_id}")
|
|
302
|
+
end
|
|
303
|
+
|
|
256
304
|
private
|
|
257
305
|
|
|
258
306
|
def build_connection
|
|
@@ -46,7 +46,9 @@ module ShopsavvyDataApi
|
|
|
46
46
|
# Product details from ShopSavvy API
|
|
47
47
|
class ProductDetails
|
|
48
48
|
attr_reader :title, :shopsavvy, :brand, :category, :images, :barcode,
|
|
49
|
-
:amazon, :model, :mpn, :color
|
|
49
|
+
:amazon, :model, :mpn, :color,
|
|
50
|
+
:title_short, :slug, :description, :categories, :attributes,
|
|
51
|
+
:rating, :score, :keywords, :identifiers
|
|
50
52
|
|
|
51
53
|
def initialize(data)
|
|
52
54
|
@title = data["title"]
|
|
@@ -59,6 +61,15 @@ module ShopsavvyDataApi
|
|
|
59
61
|
@model = data["model"]
|
|
60
62
|
@mpn = data["mpn"]
|
|
61
63
|
@color = data["color"]
|
|
64
|
+
@title_short = data["title_short"]
|
|
65
|
+
@slug = data["slug"]
|
|
66
|
+
@description = data["description"]
|
|
67
|
+
@categories = data["categories"]
|
|
68
|
+
@attributes = data["attributes"]
|
|
69
|
+
@rating = data["rating"]
|
|
70
|
+
@score = data["score"]
|
|
71
|
+
@keywords = data["keywords"]
|
|
72
|
+
@identifiers = data["identifiers"]
|
|
62
73
|
end
|
|
63
74
|
|
|
64
75
|
# @deprecated Use `title` instead
|
|
@@ -470,4 +481,44 @@ module ShopsavvyDataApi
|
|
|
470
481
|
}
|
|
471
482
|
end
|
|
472
483
|
end
|
|
484
|
+
|
|
485
|
+
# Deal with expert grading
|
|
486
|
+
class Deal
|
|
487
|
+
attr_reader :path, :title, :subtitle, :description, :emoji, :grade,
|
|
488
|
+
:pricing, :retailer, :product, :url, :image, :votes,
|
|
489
|
+
:comment_count, :tags, :expires_at, :created_at
|
|
490
|
+
|
|
491
|
+
def initialize(data)
|
|
492
|
+
@path = data["path"]
|
|
493
|
+
@title = data["title"]
|
|
494
|
+
@subtitle = data["subtitle"]
|
|
495
|
+
@description = data["description"]
|
|
496
|
+
@emoji = data["emoji"]
|
|
497
|
+
@grade = data["grade"]
|
|
498
|
+
@pricing = data["pricing"]
|
|
499
|
+
@retailer = data["retailer"]
|
|
500
|
+
@product = data["product"]
|
|
501
|
+
@url = data["url"]
|
|
502
|
+
@image = data["image"]
|
|
503
|
+
@votes = data["votes"]
|
|
504
|
+
@comment_count = data["comment_count"].to_i
|
|
505
|
+
@tags = data["tags"]
|
|
506
|
+
@expires_at = data["expires_at"]
|
|
507
|
+
@created_at = data["created_at"]
|
|
508
|
+
end
|
|
509
|
+
end
|
|
510
|
+
|
|
511
|
+
# TLDR product review
|
|
512
|
+
class TLDRReview
|
|
513
|
+
attr_reader :slug, :headline, :pros, :cons, :bottom_line, :scores
|
|
514
|
+
|
|
515
|
+
def initialize(data)
|
|
516
|
+
@slug = data["slug"]
|
|
517
|
+
@headline = data["headline"]
|
|
518
|
+
@pros = data["pros"] || []
|
|
519
|
+
@cons = data["cons"] || []
|
|
520
|
+
@bottom_line = data["bottom_line"]
|
|
521
|
+
@scores = data["scores"]
|
|
522
|
+
end
|
|
523
|
+
end
|
|
473
524
|
end
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: shopsavvy-sdk
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0
|
|
4
|
+
version: 1.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- ShopSavvy by Monolith Technologies, Inc.
|
|
8
8
|
bindir: exe
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date:
|
|
10
|
+
date: 2026-05-09 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: faraday
|