Go to file
nguyentrungthat c3ac1a81ab update gitignore 2026-04-28 15:51:41 +07:00
src update gitignore 2026-04-28 15:51:41 +07:00
.gitignore update gitignore 2026-04-28 15:21:45 +07:00
README.md Initial commit 2026-04-28 15:15:19 +07:00
package-lock.json Initial commit 2026-04-28 15:15:19 +07:00
package.json Initial commit 2026-04-28 15:15:19 +07:00

README.md

CheckPrice Server

Node.js Express server that checks eBay prices and notifies via Telegram.

Features

  • Runs a scheduled check every minute
  • Gets eBay access token automatically using refresh token
  • Searches eBay items by keyword
  • Notifies Telegram group when items are found below price threshold ($650 USD)

Setup

  1. Install dependencies:

    npm install
    
  2. Configure .env file:

    EBAY_CLIENT_ID=your_client_id
    EBAY_CLIENT_SECRET=your_client_secret
    EBAY_REFRESH_TOKEN=your_refresh_token
    TELEGRAM_BOT_TOKEN=your_bot_token
    TELEGRAM_CHAT_ID=your_chat_id
    PORT=3000
    
  3. Run the server:

    npm start
    

Configuration

  • PRICE_THRESHOLD: Edit in src/index.js to change the price threshold (default: $650 USD)
  • Keywords: Edit the keywords array in the cron job section to search for different items

API Endpoints

  • GET /health - Health check
  • POST /check - Manual trigger with keyword
    { "keyword": "your-search-term" }
    

How It Works

  1. Every minute, the server runs checkAndNotify() function
  2. Calls getEbayAccessToken() to get a valid access token
  3. Calls searchEbayItems() to search eBay for items
  4. Filters items with price below $650 USD
  5. Sends notification to Telegram if cheap items found