Module: ShopsavvyDataApi

Defined in:
lib/shopsavvy_data_api.rb,
lib/shopsavvy_data_api/client.rb,
lib/shopsavvy_data_api/errors.rb,
lib/shopsavvy_data_api/models.rb,
lib/shopsavvy_data_api/version.rb

Overview

Official Ruby SDK for ShopSavvy Data API

This gem provides a convenient interface to interact with the ShopSavvy Data API, allowing you to access product data, pricing information, and price history across thousands of retailers and millions of products.

Examples:

Basic usage

client = ShopsavvyDataApi.new(api_key: "ss_live_your_api_key_here")
product = client.get_product_details("012345678901")
puts product.data.name

See Also:

Defined Under Namespace

Classes: APIError, APIMeta, APIResponse, AuthenticationError, Client, Configuration, ConfigurationError, Deal, Error, NetworkError, NotFoundError, Offer, OfferWithHistory, PaginationInfo, PriceHistoryEntry, ProductDetails, ProductSearchResult, ProductWithOffers, RateLimitError, ScheduledProduct, TLDRReview, TimeoutError, UsageInfo, UsagePeriod, ValidationError

Constant Summary collapse

VERSION =
"1.1.0"

Class Method Summary collapse

Class Method Details

.new(api_key:, **options) ⇒ Client

Create a new ShopSavvy Data API client

Examples:

client = ShopsavvyDataApi.new(api_key: "ss_live_your_api_key_here")
product = client.get_product_details("012345678901")
puts product.data.name

Parameters:

  • api_key (String)

    Your ShopSavvy API key

  • base_url (String)

    Base URL for API (default: api.shopsavvy.com/v1)

  • timeout (Integer)

    Request timeout in seconds (default: 30)

Returns:

  • (Client)

    API client instance



33
34
35
# File 'lib/shopsavvy_data_api.rb', line 33

def new(api_key:, **options)
  Client.new(api_key: api_key, **options)
end

.with_config(config) ⇒ Client

Create a client with configuration object

Examples:

config = ShopsavvyDataApi::Configuration.new(api_key: "ss_live_key", timeout: 60)
client = ShopsavvyDataApi.with_config(config)

Parameters:

Returns:

  • (Client)

    API client instance



45
46
47
# File 'lib/shopsavvy_data_api.rb', line 45

def with_config(config)
  Client.new(config)
end