Polymarket Telegram Alert Bot in One Prompt (Polymarket US, No Trading)

Polymarket US Alerts only

PASS WITH FIXES Tested on Composer 2.5, , result: PASS WITH FIXES. We built this bot from the prompt and ran it on live public Polymarket US data (2 tests passing). Telegram was mocked to a local log file. It never trades: no keys, orders or money. The prompt below includes the fixes from that run.

Short answer: A Polymarket Telegram alert bot is a small script that polls Polymarket US public prices (GET https://gateway.polymarket.us/v1/markets/{slug}/bbo, no API key) and sends you a Telegram message through the Bot API's sendMessage when a market crosses your level or moves fast. It needs no wallet and no trading access, and the bot token stays in an env var.

What are the key facts?

  • Data: Polymarket US public endpoints, no key: GET https://gateway.polymarket.us/v1/markets/{slug}/bbo (best bid/ask, last trade) and GET /v1/market/slug/{slug}.
  • Telegram: create a bot with @BotFather, then send messages with the Bot API sendMessage method (https://api.telegram.org/bot<token>/sendMessage, params chat_id, text).
  • Keep the bot token in an env var. Anyone with the token controls the bot.
  • Stay far below Polymarket US's 25 req/s retail limit. A 30–60 second poll is plenty for alerts.
DifficultyBeginner
Time45 min
Cost$0
Works withClaude Code, Cursor, ChatGPT / Codex, Grok

What will you build?

A small script on your computer that watches a list of Polymarket US markets and sends you a Telegram message when a price crosses a level you set or moves more than X points in Y minutes.

Who is it for?

Traders who want alerts without handing a wallet or keys to a random Telegram trading bot.

Not for: Telegram bots that trade, hold funds or ask for a private key. Those are a top way people get drained.

What prompt do you paste into your AI coding tool?

Works in Claude Code, Cursor, Codex/ChatGPT, Grok or any agent that can write files. Paste it into an empty folder. Read what it builds before you run anything.

Build a personal Telegram ALERT bot in Python for Polymarket US markets.
It must never trade, never hold funds, and never ask for a wallet or private key.

Data (public, no auth), documented at https://docs.polymarket.us:
- GET https://gateway.polymarket.us/v1/markets/{slug}/bbo
  (marketData.bestBid.value, marketData.bestAsk.value,
   marketData.lastTradePx.value; prices are the YES side, 0-1)
- GET https://gateway.polymarket.us/v1/market/slug/{slug} for the question text.

watchlist.yaml (I edit by hand):
  - slug: "..."
    above: 0.60        # alert when YES mid/last crosses above
    below: 0.40        # alert when it crosses below
    move_pts: 5        # alert on a move of >= 5 points...
    move_minutes: 15   # ...within 15 minutes

alert_bot.py:
- Poll every 60s (configurable, minimum 15s). Keep a rolling price history
  in memory and in data/history.jsonl.
- Send alerts with the Telegram Bot API sendMessage
  (https://api.telegram.org/bot<TOKEN>/sendMessage, params chat_id, text).
  TELEGRAM_BOT_TOKEN and TELEGRAM_CHAT_ID come from env vars.
- Only send to MY chat id. Ignore any incoming messages/commands from others.
- De-duplicate: don't re-send the same alert for 30 minutes.
- Message format: market question, YES bid/ask/last, which rule fired,
  link to the market, and the line "Alert only. Not advice."
- If a slug has no bid/ask (null BBO, e.g. an expired market), log
  "no price" and skip it; don't treat it as 0.
- TELEGRAM_MOCK=1 mode: write each alert to logs/telegram_mock.jsonl instead
  of calling Telegram, so I can test without a bot token.
- Back off on 429/5xx. Never log the bot token.
- .env.example, .gitignore with .env, README with setup.
- tests for the crossing and move logic.

Show the plan, build, then tell me how to get my chat id and run it.

How do you build it, step by step?

  1. Create a Telegram bot. Message @BotFather, send /newbot, pick a name, and copy the token. Treat it like a password.
  2. Get your chat id. Send your new bot any message, then open https://api.telegram.org/bot<token>/getUpdates in your browser and find chat.id. (Your AI tool can write a helper for this.)
  3. Paste the prompt into your AI coding tool in a fresh folder with the Safety Pack .gitignore.
  4. Fill in watchlist.yaml. Find slugs with GET https://gateway.polymarket.us/v1/markets?active=true&closed=false&limit=20 or GET /v1/search?query=.... Check each slug's /bbo shows a live bid and ask before you set above/below levels; closed markets return none.
  5. Put secrets in .env: TELEGRAM_BOT_TOKEN=... and TELEGRAM_CHAT_ID=....
  6. Run it: python alert_bot.py, or TELEGRAM_MOCK=1 python alert_bot.py to test without a token (alerts go to logs/telegram_mock.jsonl). Set a level close to the current price to test that an alert fires.
  7. Keep it running on an always-on computer you control (a spare laptop, a Raspberry Pi, or a small VPS you own). BotCookery never hosts bots for you.

How do you test it in paper or demo mode first?

Alerts don't trade, so there's no money at risk in this recipe. If you later want the alerts to suggest an order, add a paper column: log the price you would have bought at and check it a day later. Do that for a few weeks before wiring alerts to anything that trades. When you're ready, the Polymarket bot recipe shows the paper-ledger setup.

What safety checks does it need before real money?

Tick every box before the bot touches real money. The full rules file, .gitignore and pre-commit hook are in the Safety Pack.

Which official docs did we check?

Endpoints and rules were checked against these pages on Oct 19, 2026. APIs change, so if something here disagrees with the official docs, trust the docs and tell us.

Frequently asked questions

How do I make a Polymarket Telegram bot?

Create a bot with @BotFather, poll Polymarket US public market data (for example the /v1/markets/{slug}/bbo endpoint), and send yourself messages with the Telegram Bot API's sendMessage method when your conditions hit. No Polymarket API key is needed for alerts.

Are Polymarket Telegram trading bots safe?

Third-party Telegram bots that trade for you usually need custody of funds or a private key, which is a major risk. An alert-only bot you run yourself, with no keys or wallet, avoids that whole category of risk.

Do I need a Polymarket API key for price alerts?

No. Polymarket US market data, including best bid/ask and order books, is available from the public gateway without authentication.

Can I share my alert bot in a public Telegram group?

For Polymarket US, check its terms before redistributing data. For anything using Kalshi data, Kalshi's Developer Agreement prohibits sharing API data with third parties without written permission. The safe default is alerts to your own chat only.

Related recipes