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
- Code
- OpenRouter Chat Model2
- Intent Detection
- OpenRouter Chat Model
- Send Post request and get datset items
- Clean userInput
- Recieve Message
- Product Vs Response
- Response for General
- Send Response
- Send Amazone Products
Similar automations
Chatbots & Messaging BotsSearch Amazon Products in Telegram with a Gemini Assistant15 stepsSocial Media PublishingPost Amazon Affiliate Links to Mastodon with AI Text10 stepsWeb Scraping & ResearchScrape Amazon Keyboard Products into Google Sheets4 stepsWeb Scraping & ResearchTrack Amazon Price Drops with Bright Data and Gemini20 steps