An AWS Lambda function template with SAM for product search, price comparison, and scheduled price monitoring using the ShopSavvy Data API.
- Install dependencies:
npm install- Set your API key in the SAM template or as an environment variable:
# For local testing
export SHOPSAVVY_API_KEY=ss_live_your_key_here
# Get a key at shopsavvy.com/data- Build and deploy:
sam build
sam deploy --guidedHTTP API Gateway endpoints for product search and price lookup.
GET /search?q=airpods- Search for productsGET /price/{id}- Get current offers for a productGET /deals- Browse current shopping deals
Scheduled function that runs on a cron schedule to check prices for monitored products. Configure the product identifiers in the MONITOR_PRODUCTS environment variable (comma-separated).
Default schedule: every 6 hours.
sam build
sam local start-apiThen visit http://localhost:3000/search?q=iphone.
Edit template.yaml to customize:
- API Gateway routes
- Lambda memory/timeout
- Cron schedule for price monitoring
- Environment variables
MIT