ShopSavvy Kotlin SDK

Kotlin

A Kotlin-first client for the ShopSavvy Data API. Built with coroutines for Android development and JVM server applications.

Set up ShopSavvy Kotlin SDK

  1. 1

    Get a ShopSavvy Data API key

    Create a key at shopsavvy.com/data. Keys look like ss_live_ followed by 32 characters. Keep it out of source control.

  2. 2

    Install

    Add the ShopSavvy SDK to your project:

    implementation("com.shopsavvy:shopsavvy-sdk-kotlin:1.1.0")
  3. 3

    Add your API key

    Set the SHOPSAVVY_API_KEY environment variable to your key (shell, .env file or your secrets manager), or pass it to the client as the README shows.

  4. 4

    Make your first call

    From the shopsavvy/sdk-kotlin README (30-Second Quick Start):

    // Add to build.gradle.kts:
    // implementation("com.shopsavvy:shopsavvy-sdk-kotlin:1.4.0")
    
    // Use in Android/JVM:
    import com.shopsavvy.sdk.*
    import kotlinx.coroutines.*
    
    val client = ShopSavvyClient("ss_live_your_api_key_here")
    
    lifecycleScope.launch {
        val product = client.getProductDetails("012345678901")
        val offers = client.getCurrentOffers("012345678901")
        val bestOffer = offers.data.minByOrNull { it.price ?: Double.MAX_VALUE }
        
        println("${product.data.name} - Best price: $${bestOffer?.price} at ${bestOffer?.retailer}")
    }

    Copied from the repository README.

  5. 5

    Client Configuration

    From the shopsavvy/sdk-kotlin README (Client Configuration):

    import com.shopsavvy.sdk.*
    import kotlinx.coroutines.*
    
    // Basic configuration
    val client = ShopSavvyClient("ss_live_your_api_key_here")
    
    // Advanced configuration
    val client = ShopSavvyClient(
        apiKey = "ss_live_your_api_key_here",
        baseUrl = "https://api.shopsavvy.com/v1",  // Custom base URL
        timeoutSeconds = 60,                       // Request timeout
        retryAttempts = 3,                         // Retry failed requests
        userAgent = "MyApp/1.0.0"                 // Custom user agent
    )
    
    // Environment variable configuration (Android)
    val apiKey = BuildConfig.SHOPSAVVY_API_KEY ?: System.getenv("SHOPSAVVY_API_KEY")
    val client = ShopSavvyClient(apiKey)

    Copied from the repository README.

Keys come with a Data API plan. See plans.

Features

Kotlin coroutines support
Android and JVM compatible
Gradle and Maven support
Serialization with kotlinx.serialization
Automatic retry and rate limiting

Use Cases

1.Build Android price comparison apps
2.Add barcode scanning with price lookup
3.Create price monitoring background workers
4.Build Spring Boot services with pricing data

What data, how often, which direction

Data
Product records, current offers from tens of thousands of retailers and price history back to 2011, dense from 2019, from the ShopSavvy Data API. Prices are in US dollars.
How often
Every offer carries the time it was last checked. With the Data API you can schedule refreshes hourly, daily or weekly for retailers we can re-check through an official retailer API; other retailers update as ShopSavvy sees them.
Direction
ShopSavvy data flows into your code. Requests carry only what you ask about (identifiers, search terms or schedules) and your API key.

FAQ

Do I need an API key?

Yes. The Kotlin SDK calls the ShopSavvy Data API, which needs a Data API key. Create one at shopsavvy.com/data, then add it as the setup steps above show.

What data does it return?

ShopSavvy product records (title, brand, model, barcode, ASIN), current offers from tens of thousands of retailers with price, availability and condition, and price history back to 2011, dense from 2019. Products can be looked up by barcode, ASIN, URL or model number. Prices are in US dollars.

How fresh are the prices?

Every offer carries the time ShopSavvy last checked it, so you can see how current each price is. Through the Data API you can schedule refreshes hourly, daily or weekly for retailers we can re-check through an official retailer API; other retailers update as ShopSavvy sees them.

Is my API key stored securely?

The README has you supply it through the SHOPSAVVY_API_KEY environment variable or your own configuration, so it stays out of source code. The key is sent to the ShopSavvy API (api.shopsavvy.com) over HTTPS in the Authorization header. You can revoke a key and create a new one at shopsavvy.com/data/api-keys.

Powered by the ShopSavvy Data API

This integration connects to the ShopSavvy Data API: product data and current prices from tens of thousands of retailers, across 30M+ products, with price history back to 2011, dense from 2019. Look up products by barcode, ASIN, URL or keyword, compare prices, read history and schedule refreshes.