Build a Price Monitoring Bot with Python

Tutorial · Python · PricePulse API

In this tutorial, you'll build a Python bot that monitors product prices across Carousell Singapore and Amazon Singapore.

Prerequisites

pip install pricepulse

Get your free API key at pricepulse.dev/pricing.

1. Basic Price Checker

from pricepulse import PricePulse

client = PricePulse(api_key="your-key")

# Search for products
results = client.search("PS5", source="carousell")
for p in results[:5]:
    print(f"{p['title']} - ${p['price']}")

2. Monitor Price Changes

import time
from pricepulse import PricePulse

client = PricePulse(api_key="your-key")
seen = {}

while True:
    results = client.search("iPhone 15 Pro", source="carousell")
    for p in results:
        if p['id'] not in seen:
            seen[p['id']] = p['price']
            print(f"NEW: {p['title']} - ${p['price']}")
        elif seen[p['id']] != p['price']:
            print(f"PRICE CHANGE: {p['title']} ${seen[p['id']]} -> ${p['price']}")
            seen[p['id']] = p['price']
    time.sleep(300)  # Check every 5 minutes

3. Find Arbitrage Opportunities

from pricepulse import PricePulse
client = PricePulse(api_key="your-key")
deals = client.arbitrage(min_profit=20)
for d in deals:
    print(f"PROFIT: {d.get('profit', 0)}% - {d.get('title', 'N/A')}")

4. Price Alert System

from pricepulse import PricePulse
client = PricePulse(api_key="your-key")

TARGET_PRICE = 500  # SGD

results = client.search("Nintendo Switch OLED")
for p in results:
    price = p.get('price', 0)
    if price > 0 and price <= TARGET_PRICE:
        print(f"ALERT: {p['title']} at ${price}!")

5. Full Script

#!/usr/bin/env python3
"""Price monitoring bot"""
import json, time
from pricepulse import PricePulse

client = PricePulse(api_key="***")
QUERIES = ["iPhone 15", "PS5", "Nintendo Switch", "MacBook Pro", "AirPods"]

for q in QUERIES:
    results = client.search(q, source="carousell", limit=5)
    print(f"\n=== {q} ===")
    for p in results:
        print(f"  ${p.get('price', 'N/A'):>8} | {p['title'][:60]}")
    time.sleep(1)
Get Your Free API Key →

GitHub · API Docs · Live Demo