Skip to content
NEWMarketplace and the trig8n Agent: sell what you build, and get plans and changes that are tested before you see them. See what is new

Library / Chatbots & Messaging Bots

Chatbots & Messaging Bots

Search Amazon Products from Telegram with OpenRouter AI

When a Telegram message arrives, AI via OpenRouter detects shopping intent, scrapes Amazon with Apify, and replies with product titles, prices and links.

What it does

## Overview Telegram bot that scrapes Amazon products using n8n automation. Users send product queries via Telegram and receive product details (title, URL, price). ## Workflow Flow Telegram Trigger → Receives messages Clean Input → Normalizes user text (removes "in amazon", punctuation, etc.) Intent Detection → AI determines if message is product search or chat Switch → Routes to appropriate handler Product Route → Calls Apify Amazon scraper API (max 5 items) Chat Route → AI conversational response Send Response → Formatted message back to Telegram ## Key Components:- Input Processing - Removes platform mentions ("in amazon", "on flipkart") - Cleans punctuation and normalizes text - URL-encodes for search queries AI Integration - Uses OpenRouter API with GPT-3.5-turbo model - Intent classification (product vs conversation) - Shopping assistant responses Product Scraping - Apify Amazon scraper integration - Returns: title, URL, price in Indian Rupees - Limited to 5 products per query External Dependencies - Telegram Bot API - OpenRouter API (AI models) - Apify Amazon Scraper API Response Format - Title: [Product Name] - URL: [Amazon Link] - Price: ₹[Amount] Error Handling - Validates empty queries - Fallback responses for unrecognized intents

The steps

  1. Code
  2. OpenRouter Chat Model2
  3. Intent Detection
  4. OpenRouter Chat Model
  5. Send Post request and get datset items
  6. Clean userInput
  7. Recieve Message
  8. Product Vs Response
  9. Response for General
  10. Send Response
  11. Send Amazone Products

Similar automations