ShopSavvy for Laravel

PHPBeta

Full Laravel integration for the ShopSavvy Data API. Includes a ShopSavvy facade, publishable config, Blade components for rendering product cards and price comparisons, Artisan commands for CLI access, and optional API routes with caching support.

Set up ShopSavvy for Laravel

  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 from GitHub

    The package in the install command (composer require shopsavvy/laravel-shopsavvy) is not on its public registry yet, so install from the source repository and follow its README:

    git clone https://github.com/shopsavvy/laravel-shopsavvy.git
  3. 3

    Add your API key

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

  4. 4

    Make your first call

    From the shopsavvy/laravel-shopsavvy README (Configuration):

    php artisan vendor:publish --tag=shopsavvy-config

    Copied from the repository README.

  5. 5

    Configuration

    From the shopsavvy/laravel-shopsavvy README (Configuration):

    SHOPSAVVY_API_KEY=ss_live_your_key_here

    Copied from the repository README.

  6. 6

    Configuration Reference

    From the shopsavvy/laravel-shopsavvy README (Configuration Reference):

    // config/shopsavvy.php
    
    return [
        'api_key'  => env('SHOPSAVVY_API_KEY'),
        'base_url' => env('SHOPSAVVY_BASE_URL', 'https://api.shopsavvy.com/v1'),
        'timeout'  => env('SHOPSAVVY_TIMEOUT', 30),
    
        'cache' => [
            'enabled' => env('SHOPSAVVY_CACHE_ENABLED', true),
            'ttl'     => env('SHOPSAVVY_CACHE_TTL', 300),   // seconds
            'store'   => env('SHOPSAVVY_CACHE_STORE', null), // null = default store
            'prefix'  => env('SHOPSAVVY_CACHE_PREFIX', 'shopsavvy'),
        ],
    
        'routes' => [
            'enabled'    => env('SHOPSAVVY_ROUTES_ENABLED', false),
            'prefix'     => env('SHOPSAVVY_ROUTES_PREFIX', 'api/shopsavvy'),
            'middleware' => ['api'],
        ],
    
        'retry' => [
            'times' => env('SHOPSAVVY_RETRY_TIMES', 3),
            'sleep' => env('SHOPSAVVY_RETRY_SLEEP', 500), // milliseconds
        ],
    ];

    Copied from the repository README.

Keys come with a Data API plan. See plans.

Features

ShopSavvy facade with full API access
Blade components for price cards and search results
Artisan commands for product search and pricing
Publishable config with Laravel cache integration
Optional API routes with configurable prefix

Use Cases

1.Show competitor prices on your Laravel e-commerce site
2.Add price comparison Blade components to product pages
3.Run product searches from the command line
4.Build a price monitoring backend with Laravel

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 Laravel. 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 Laravel integration 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.

Can I install it from a package registry?

Not yet. The package named in its install command has not been published to its public registry, so install it from the GitHub repository (https://github.com/shopsavvy/laravel-shopsavvy) for now.

Is it open source?

Yes. The source is on GitHub at https://github.com/shopsavvy/laravel-shopsavvy under the MIT license.

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.