Skip to content

Repository files navigation

ShopSavvyShortcuts

Swift Package Manager Platform Swift License: MIT

Siri-powered price comparison for iOS and macOS via Apple Shortcuts. A Swift Package that exposes ShopSavvy price lookups, deal discovery, and price alerts as native App Intents — automatically available in Siri, the Shortcuts app, and Spotlight the moment your app is installed.

Note: A full standalone ShopSavvy Shortcuts iOS app is planned separately. This package is designed to be embedded in your existing iOS or macOS app.


Features

Intent What it does Example Siri phrase
Check Price Best current price for any product (URL, ASIN, barcode, or name) "Check price on AirPods Pro with ShopSavvy"
Scan Barcode Price comparison from a UPC, EAN, or ISBN "Look up barcode 012345678901 with ShopSavvy"
What's the Best Price Voice-friendly product name search, returns top 3 matches "What's the best price on AirPods Pro with ShopSavvy"
Am I Overpaying Checks a product URL against all retailers, reports savings "Am I overpaying for this product with ShopSavvy"
Set Price Alert Saves a target price; notifies when the product drops "Alert me when this drops to $150 in ShopSavvy"
Today's Deals Trending community deals, optionally filtered by category "Show today's deals in ShopSavvy"
Price History 90-day price summary with low/high/current "Show price history for AirPods Pro in ShopSavvy"
Compare Prices Side-by-side retailer price list for a product URL "Compare prices for this product with ShopSavvy"

All intents return rich snippet views rendered in Siri and the Shortcuts app.


Installation

Swift Package Manager

Xcode: File → Add Package Dependencies → https://github.com/shopsavvy/shortcuts-shopsavvy.git

Package.swift:

dependencies: [
    .package(url: "https://github.com/shopsavvy/shortcuts-shopsavvy.git", from: "1.0.0"),
]

Integration (iOS App Developers)

1. Add the package dependency

Add ShopSavvyShortcuts to your app target's dependencies in Xcode or Package.swift.

2. Configure the API key

Call this once at app launch, before any intents run:

import ShopSavvyShortcuts

@main
struct MyApp: App {
    init() {
        ShopSavvyClient.configure(apiKey: "ss_live_your_key_here")
        // Registers phrase list with the system on every launch
        ShopSavvyShortcutsProvider.updateAppShortcutParameters()
    }
}

For app extensions and widgets that share a container group:

ShopSavvyClient.configure(
    apiKey: "ss_live_your_key_here",
    suiteName: "group.com.yourcompany.yourapp"
)

3. Intents are automatically exposed

No further setup needed. The 8 App Intents are immediately available in:

  • Siri (spoken or typed)
  • The Shortcuts app (users can build automations)
  • Spotlight search
  • Focus filters
  • Lock Screen widgets (via Shortcuts)

4. Respond to price alert triggers (optional)

SetPriceAlertIntent stores alerts in UserDefaults. Read them in your background task to send local notifications:

import ShopSavvyShortcuts

let alerts = PriceAlert.all()

for alert in alerts {
    let response = try await ShopSavvyClient.shared.getOffers(identifier: alert.productID)
    if let best = response.data.first?.offers.min(by: { $0.price < $1.price }),
       best.price <= alert.targetPrice {
        // Send a local UNUserNotificationCenter notification
    }
}

Usage Examples

"Hey Siri, what's the best price on AirPods Pro"

Siri invokes WhatsTheBestPriceIntent with productName = "AirPods Pro", then speaks:

"Here are the top results for AirPods Pro. The best match is Apple AirPods Pro (2nd Generation) starting at $189."

A rich snippet card appears showing up to 3 product matches with prices.

"Hey Siri, check price on this" (Share Sheet)

When your app registers a Share Sheet extension backed by CheckPriceIntent, users can tap Share from any browser or shopping app, choose "Check Price with ShopSavvy", and Siri returns the best price without leaving the page.

Automations

Chain ShopSavvy intents with native Shortcuts actions:

[Get Contents of URL] → [Compare Prices with ShopSavvy] → [If price < 50] → [Send Notification]

Siri Phrases Reference

Intent Registered phrases
CheckPriceIntent "Check price on ___ with [App]", "What does ___ cost in [App]", "Find the price of ___ with [App]"
ScanBarcodeIntent "Scan barcode ___ with [App]", "Look up barcode ___ in [App]"
WhatsTheBestPriceIntent "What's the best price on ___ with [App]", "Find ___ deals in [App]", "Search [App] for ___"
AmIOverpayingIntent "Am I overpaying for ___ with [App]", "Is there a better price for ___ in [App]"
SetPriceAlertIntent "Alert me when ___ hits ___ in [App]", "Set a price alert for ___ in [App]"
TodaysDealsIntent "Show today's deals in [App]", "What deals are trending on [App]", "Find deals in [App]"
PriceHistoryIntent "Show price history for ___ in [App]", "Has ___ been cheaper with [App]"
ComparePricesIntent "Compare prices for ___ with [App]", "Where's cheapest for ___ in [App]"

[App] is your app's display name as set in your Info.plist.


Distribution Strategy

Embedded in your iOS app (recommended)

The primary distribution path. Intents are live immediately after install with zero configuration for users.

Standalone .shortcut files on RoutineHub

Pre-built shortcut workflows that users can import. Useful for power users building automations. See shortcuts/ for downloadable shortcut documentation.

Share Sheet extension

Register a Share Sheet extension in your app target backed by CheckPriceIntent or ComparePricesIntent. Users can invoke ShopSavvy from any in-browser product page.


Lock Screen Widgets & Share Sheet Notes

Lock Screen widgets: iOS 16+ supports Lock Screen complications backed by App Intents. Add a WidgetConfiguration in your app that exposes TodaysDealsIntent or CheckPriceIntent as a widget timeline provider.

Share Sheet: To appear in the iOS Share Sheet, your app target needs a UIActivityViewController handler or an App Intent that declares .systemUI as its supported context.


API Key

Get your ShopSavvy API key at shopsavvy.com/data.

The API key is stored in UserDefaults under the key ShopSavvyAPIKey. Optionally use an App Group suite name to share it across your app, extensions, and widgets.


Requirements

  • iOS 16.0+ / macOS 13.0+
  • Swift 5.9+
  • Xcode 15+

More

About

Apple Shortcuts Swift Package for ShopSavvy — 8 App Intents for Siri voice + Share Sheet price comparison

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages