← Back to directory
E-commerce Quick to set up AI workflow Personalize/Recommend

AliExpress Affiliate Product Finder

Source reviewed Updated 2026-07-07

Users send natural language product requests via Telegram and receive two AI-selected recommendations with images, prices.

What it does

This Telegram bot allows users to find AliExpress products using natural language commands. It validates user membership, optimizes search queries via OpenAI, scrapes product data using Decodo, and selects the best options based on ratings and price. Finally, it generates affiliate tracking links and sends formatted recommendations with images and prices directly in the chat.

Step by step

  1. Set up a Telegram BotFather token and configure webhook endpoints for incoming updates.
  2. Implement user validation logic to check if the user ID exists in your allowed members database before processing any commands.
  3. Construct the final message payload with product images, prices, and affiliate links using standard JSON formatting for Telegram's MarkdownV2 or HTML parse modes.

Where the LLM does the work

  • Generate optimized search queries from vague natural language inputs by prompting OpenAI to extract key product attributes like brand, size, and color.
  • Analyze scraped product data to rank items based on a weighted score of rating, price, and shipping speed using custom AI reasoning.

Watch out for

Decodo scraping can fail if AliExpress changes its DOM structure so add robust error handling and fallback selectors for common layout shifts.
OpenAI API costs can spiral with high traffic so implement input caching to avoid re-processing identical user queries within a short time window.
Affiliate link generation may return expired or invalid URLs if the product goes out of stock so verify link validity before sending them to users.
Telegram message length limits can truncate long product descriptions so ensure your formatting logic caps text content and uses collapsible details where possible.

Tools that fit

Telegram Service User interaction and bot interface
OpenAI LLM Search query optimization and product analysis
Decodo Service Scraping AliExpress product listings
AliExpress Affiliate API API Generating affiliate tracking links

The agent brief

Everything your agent needs, including the gotchas. Copy it and go.
agent-brief.md
You are helping me build the following AI agent workflow.

## Goal
AliExpress Affiliate Product Finder: Users send natural language product requests via Telegram and receive two AI-selected recommendations with images, prices.

## Specification
- What it does: This Telegram bot allows users to find AliExpress products using natural language commands. It validates user membership, optimizes search queries via OpenAI, scrapes product data using Decodo, and selects the best options based on ratings and price. Finally, it generates affiliate tracking links and sends formatted recommendations with images and prices directly in the chat.
- Trigger: Triggered by an event (Manual · on user message)
- Autonomy: Fully hands-off
- Expected setup effort: under an hour
- Tools/services involved:
  - Telegram: User interaction and bot interface
  - OpenAI: Search query optimization and product analysis
  - Decodo: Scraping AliExpress product listings
  - AliExpress Affiliate API: Generating affiliate tracking links

## Known pitfalls, handle each one explicitly in your implementation
1. Decodo scraping can fail if AliExpress changes its DOM structure so add robust error handling and fallback selectors for common layout shifts.
2. OpenAI API costs can spiral with high traffic so implement input caching to avoid re-processing identical user queries within a short time window.
3. Affiliate link generation may return expired or invalid URLs if the product goes out of stock so verify link validity before sending them to users.
4. Telegram message length limits can truncate long product descriptions so ensure your formatting logic caps text content and uses collapsible details where possible.

## Reference implementation
https://n8n.io/workflows/12437 (workflow template)
Fetch and inspect this before building. If it matches my stack, adapt it;
if not, rebuild the pattern with my tools.

## Process requirements
1. Before building: ask me which of the listed tools I actually use and
   what my platform is (n8n / Make / code / other). Do not assume.
2. Adapt the pattern to my answers; do not force the reference stack.
3. Address every pitfall above; tell me how you handled each.
4. Provide a test plan I can run before letting this touch real data.
5. Ask before any step that sends messages, modifies data, or spends money.

Source: https://usecasesforagents.com/use-case/aliexpress-affiliate-product-finder-bot/ via usecasesforagents.com

Frequently asked questions

Can I use a different Messaging than Telegram?

Yes. Telegram is only the example messaging in this recipe. The same flow works with ClickSend API, Discord, Google Chat and LINE Messaging API. Swap the messaging connection and keep the rest of the setup as written.

Want this running in your business?

This is what I do. I design and build AI agents like this one, and keep them running. If you want it set up for your team instead of doing it yourself, get in touch.
Get in touch →

Who it's for

Also fits E-commerce Operator.

Seen in the wild

← Back to directory