{"cells": [{"cell_type": "markdown", "metadata": {"id": "header"}, "source": ["# PricePulse API Demo\n", "Real-time price monitoring for Carousell SG and Amazon SG\n", "\n", "[Get your free API key](https://incl-coupons-question-pair.trycloudflare.com/pricing) | ", "[GitHub](https://github.com/rock2089/pricepulse-api) | ", "[API Docs](https://incl-coupons-question-pair.trycloudflare.com/docs)\n"]}, {"cell_type": "markdown", "metadata": {"id": "setup"}, "source": ["## Setup\n", "Install the PricePulse client or just use requests:"]}, {"cell_type": "code", "metadata": {"id": "install", "colab": {"base_uri": "https://localhost:8080/"}}, "source": ["!pip install git+https://github.com/rock2089/pricepulse-api.git -q"], "execution_count": null, "outputs": []}, {"cell_type": "markdown", "metadata": {"id": "demo"}, "source": ["## Try it out\n", "Replace `YOUR_API_KEY` with your key from [pricepulse.dev](https://incl-coupons-question-pair.trycloudflare.com/pricing)"]}, {"cell_type": "code", "metadata": {"id": "search"}, "source": ["from pricepulse import PricePulse\n", "\n", "# Get your free key at https://incl-coupons-question-pair.trycloudflare.com/pricing\n", "client = PricePulse(api_key=\"YOUR_API_KEY\")\n", "\n", "# Search products\n", "results = client.search(\"iPhone 15\", source=\"carousell\")\n", "for p in results[:5]:\n", "    print(f\"{p['title']} - ${p.get('price', 'N/A')}\")\n", "\n", "# Or use requests directly (no SDK needed)\n", "import requests\n", "resp = requests.get(\n", "    \"https://incl-coupons-question-pair.trycloudflare.com/search\",\n", "    params={\"q\": \"PS5\", \"source\": \"carousell\"},\n", "    headers={\"X-API-Key\": \"YOUR_API_KEY\"}\n", ")\n", "print(f\"Found {len(resp.json())} results\")"], "execution_count": null, "outputs": []}, {"cell_type": "markdown", "metadata": {"id": "trending"}, "source": ["## Trending Products & Arbitrage"]}, {"cell_type": "code", "metadata": {"id": "trending_code"}, "source": ["# Trending\n", "trending = client.trending()\n", "print(f\"Top trending products: {len(trending)}\")\n", "\n", "# Arbitrage opportunities\n", "deals = client.arbitrage(min_profit=15)\n", "print(f\"Arbitrage deals found: {len(deals)}\")\n", "for d in deals[:3]:\n", "    print(f\"  {d.get('title', 'N/A')} - profit: {d.get('profit', 'N/A')}%\")"], "execution_count": null, "outputs": []}, {"cell_type": "markdown", "metadata": {"id": "pricing"}, "source": ["---\n", "**Pricing**: Free 100 req/day | Pro $10/mo (1,000/day) | Enterprise $50/mo (10,000/day)\n", "\n", "[Get your API key](https://incl-coupons-question-pair.trycloudflare.com/pricing) | ", "[GitHub](https://github.com/rock2089/pricepulse-api) | ", "[Docs](https://incl-coupons-question-pair.trycloudflare.com/docs)"]}], "metadata": {"colab": {"provenance": [], "name": "PricePulse API Demo"}, "kernelspec": {"name": "python3", "display_name": "Python 3"}, "language_info": {"name": "python"}}, "nbformat": 4, "nbformat_minor": 0}