This repository contains the source code for a Chrome extension designed to bridge the gap between traditional spirit retailers and the BAXUS marketplace. This project was developed for the Baxathon Hackathon, where it secured the 11k USD grand prize (with two other tools) in collaboration with Joel.
The extension programmatically identifies whiskey and wine products on third-party websites, queries the BAXUS API, and performs client-side fuzzy matching to highlight price discrepancies and potential savings.
The extension operates through a three-tier logic system to ensure accurate data extraction and matching.
The scrapeBottlesFromPage() function utilizes DOM traversal to identify product entities. It employs a combination of:
- Selector Heuristics: Targets common e-commerce patterns (e.g.,
[data-testid="product-title"],.product-price). - Keyword Filtering: A whitelist of spirits-related terminology (e.g., single malt, bourbon, nikka) to prevent the scraper from attempting to price-match non-beverage items.
- URL Pattern Recognition: Detects product detail pages (PDP) versus listing pages to optimize extraction strategy.
The tool interfaces with the BAXUS API (https://services.baxus.co/api).
- Fetching: It retrieves active listings using the
/search/listingsendpoint. - Normalization: Since external site metadata is often messy, the tool performs client-side normalization of search queries to better interface with the BAXUS catalog.
The core "intelligence" resides in the findMatches logic:
- Term Extraction: Tokenizes product names and strips common stop-words (e.g., with, and, 70cl).
- Jaccard Similarity: Implements a string similarity score between 0 and 1 based on character-set intersection.
- Ranked Savings: Matches are sorted by the delta between the scraped price and the BAXUS listing price.
To load the extension in a development environment:
- Clone this repository to your local directory.
- Navigate to
chrome://extensions/in Google Chrome. - Enable Developer mode via the toggle in the upper right corner.
- Click Load unpacked and select the root directory of this project.
- Ensure the BAXUS API endpoints are accessible from your network environment.
- Async Messaging: The extension utilizes
chrome.runtime.onMessagewithsendResponseto handle asynchronous scraping tasks without blocking the UI thread. - State Management: It maintains a localized state of the BAXUS marketplace hits to reduce redundant API calls during a single browsing session.
- Extensibility: The scraping logic is modular; site-specific scrapers can be injected into
scrapeBottlesFromPageto handle sites with highly obfuscated DOM structures.
- Main Development: Tekdiverse (@Tekdiverse)
- Collaborator: Joel (@HeIsJoel0x)