RETURN TO SELECT

SHOPIFY INVENTORY MONITOR

A simple, configurable Python script to monitor Shopify and other websites for knife restocks (or any other products) and send notifications via ntfy.sh.

PythonDigital Ocean

ABOUT

Background

A close friend of mine was very interested in the world of high-end pocket knives. He constantly remarked about how email updates from companies never accurately reflected the current stock because the in-demand products were often taken within minutes or even seconds of the email being sent out.

I noticed that a good number of high-end knife manufacturers use Shopify to sell their products, and I thought it would be a fun project to build a simple, configurable script to monitor Shopify and other websites for knife restocks and send notifications to my phone.

Overview

This project is a Python-based automation tool designed to monitor e-commerce websites for product restocks. It was originally built to track knife inventory but can be configured for any product. It supports both Shopify's JSON API for reliable tracking and generic regex-based scraping for other platforms.

Key Features

  • Shopify Integration: Leverages the Shopify JSON API to monitor collections efficiently without parsing HTML.
  • Universal Support: Includes a regex-based monitor to track products on non-Shopify websites.
  • Smart Notifications: Integrates with ntfy.sh to deliver push notifications to iOS, Android, and Desktop devices.
  • State Management: Maintains a local state of known inventory to prevent duplicate notifications for existing items.
  • Availability Filtering: Can be configured to alert only when items are actually in stock.

How It Works

The script runs as a scheduled task or cron job. It fetches product data from configured sources, compares it against the locally stored state, and triggers a notification if a new or restocked item is detected. The configuration is handled via a JSON file, making it easy to add or remove sites without touching the code.

Tech Stack

Built with Python using the requests library for network operations. I needed simplicity in the stack to ensure it can run on minimal hardware like a Raspberry Pi or a small VPS. I am hosting a version on a Digital Ocean Droplet.