Skip to content

The moment it happens

Find promo codes for a shop from Telegram

Send a shop name to your bot and get a list of current discount codes found on the web, with what each one claims to offer.

Runs
The moment it happens
Apps
SerpApi, Telegram
AI
Yes, uses the built-in AI allowance
Access
SerpApi key; bot token

Send this to your assistant

Create a ClickRuntime automation: when I send a shop name to my Telegram bot, search Google for current promo codes with SerpApi, pull out the codes and their offers with AI, and reply with the list.

Paste it into your assistant. It tells you what it will send or change before it runs live.

First time? Adding ClickRuntime to your assistant takes about two minutes.

Why use it

Why teams use this automation

Anyone who buys equipment or supplies online regularly, from a small office manager to a home cook, knows a code box at checkout means someone is paying less. Searching for codes means wading through coupon sites stuffed with expired offers and pop-ups, which often takes longer than the saving is worth.

This bot does the wading. You send the shop's name, it searches Google for current promo codes, and AI reads the result snippets to pull out the actual codes and the offer attached to each. You get a short list in Telegram and can try them at checkout.

What you get out of it

  • Save money without the hunt

    A code worth ten percent on a large order is real money. The bot makes checking for one a five-second habit instead of a ten-minute chore.

  • Codes and offers in one list

    Each code comes with what it claims to give, such as free shipping or 15 percent off. You can try the best one first instead of guessing.

  • No coupon-site clutter

    You never have to visit the pages full of ads and pop-ups. The bot reads the search results and sends you only the useful part.

  • Works for any shop

    Send any store name, large or small. If the web knows about a code, the bot has a good chance of finding it.

How it works

What happens, step by step

  1. When you send a shop name to your Telegram bot, ClickRuntime searches Google for current promo codes for that shop.

  2. It gathers the titles and snippets of the top results.

  3. AI picks out the codes and the offer described for each, ignoring anything that is not a real code.

  4. The bot replies in the same chat with a short list of codes and offers, or tells you none were found.

Before it runs live

  • Connect SerpApi
  • Connect Telegram
  • Paste your automation's link into the other app's webhook settings

What you get

RunsThe moment it happens
Find promo codes for a shop from Telegramjust nowSucceeded
Telegram · Promo codesNORTH15 - 15% off orders over $50 SHIPFREE - free standard shipping

Build your own

Need it to work differently?

This template is a starting point. Copy the prompt and change it, or describe a different automation from scratch, with your own conditions, more apps or an AI step. Your assistant writes it, tests it and runs it on ClickRuntime.
  • Your own rules

    Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.

  • Any number of apps

    One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.

  • AI where it helps

    Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.

  • On a schedule or on each event

    Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.

Changes you can ask for

  • Act only on the items that match your own rules, and skip the rest
  • Change what the AI looks for, or how it writes the result
  • Add another app, for example also send it to Slack
  • Combine it with other SerpApi and Telegram steps into one automation

Under the hood

The code that runs this automation

This is the Python script that runs each time the automation starts. Your AI assistant writes it for you when you send the prompt, and you allow each step in your assistant. To change how the automation works, describe the change to your assistant and it updates the script for you. For every function it can use, see the script reference.
promo_code_finder.pyexample
from datetime import date
from clickruntime import on_event, credentials, http, ai

@on_event
def handle(event):
    msg = (event.json or {}).get("message") or {}
    shop = msg.get("text", "").strip()
    if not shop:
        return {"ignored": True}
    q = f"{shop} promo code {date.today():%B %Y}"
    results = http.get("https://serpapi.com/search", params={"engine": "google", "q": q, "num": 10,
                                                             "api_key": credentials.secret("SERPAPI_API_KEY")}).json().get("organic_results", [])
    snippets = "\n".join(f"- {r['title']}: {r.get('snippet', '')}" for r in results)
    schema = {"type": "object", "properties": {"codes": {"type": "array", "items": {"type": "object",
              "properties": {"code": {"type": "string"}, "offer": {"type": "string"}}, "required": ["code", "offer"]}}}, "required": ["codes"]}
    codes = ai.generate(f"Extract promo codes for {shop} from these results. Only real codes.\n{snippets}", json_schema=schema, max_output_tokens=300).json["codes"]
    reply = "\n".join(f"{c['code']} - {c['offer']}" for c in codes) if codes else f"No current codes found for {shop}."
    http.post(f"https://api.telegram.org/bot{credentials.secret('TELEGRAM_BOT_TOKEN')}/sendMessage", json={"chat_id": msg["chat"]["id"], "text": reply})
    return {"shop": shop, "codes": len(codes)}

FAQ

Common questions

Are the codes guaranteed to work?
No. Codes are taken from what is published online, and shops expire them often. The list shows the newest first, but you will need to try them at checkout.
Can I ask for a particular kind of deal?
Yes. Add it to the message, such as "Northwind Supplies free shipping", and the search is focused on that.
What if no codes are found?
The bot tells you it found none rather than sending an empty list. Shops without public codes sometimes offer a discount for signing up to their newsletter.
What permissions does it need?
SerpApi key; bot token. Nothing else in your accounts is used.
Does it need AI?
Yes. It uses ClickRuntime's built-in AI, so you don't need an OpenAI or Anthropic key. Every plan includes a monthly AI allowance.
How many runs does it use?
One run for each event the app sends.
Can I change how it works?
Yes. Describe the change to your AI assistant, for example a different schedule, channel or filter. It updates the automation, tests it and tells you what changed.

Set up “Find promo codes for a shop from Telegram” from your assistant

Copy the prompt above, or connect your assistant first. Free plan, no credit card.