WEIR

Twitter to Telegram Bot: Forward Tweets with Python (2026)

Build a Twitter to Telegram bot that works in 2026: a BotFather token, a 5-minute poll or a signed webhook, real costs, and what IFTTT now charges.


Published · Updated · 7 min read

Cover image: New tweets, straight to Telegram

A Twitter to Telegram bot watches an X account for new posts and sends each one to your chat with Telegram's sendMessage.

The GitHub bots we checked need X (Twitter) API keys, and X now bills $0.005 per post read. This guide is for you if you want new tweets in a Telegram chat or channel without those keys.

You get two routes, both in short Python. We run Weir, the API they use. Once your bot exists, this sends a test message:

curl -s "https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/sendMessage" \
  -d chat_id="$TELEGRAM_CHAT_ID" -d text="Hello from my Twitter bot"

You need Python 3, a Telegram account and a free Weir key. The build in four steps:

  1. Create the botSend /newbot to @BotFather and copy the token.
  2. Find your chat idUse @channelname, or read chat.id from getUpdates.
  3. Fetch new postsPoll search with sinceId, or let a monitor push them.
  4. Send each postOne sendMessage call per post, a second apart.

Which Twitter to Telegram bot still works in 2026?

Pick by how fast you need alerts and whether you'll run code. Here's what each option needs:

Option You need Price, as listed The catch
IFTTT A Pro plan $2.99 a month, billed yearly Untested by us
GitHub scripts X API keys $0.005 per post read One we checked is archived
Activepieces An account Free to start No X triggers listed
Weir poll (Step 4) A Weir key and cron 1 credit a poll, 1 per post Minutes, not seconds
Weir monitor (Step 5) A Weir key and a server 1 credit a run, 1 per post Hourly at best

Each figure comes from the vendor's own page, checked on 22 October 2026.

Our pick: the poll if you want tweets within minutes, the monitor if hourly is fine and you'd rather not run a loop.

If you rebroadcast other people's tweets to a public channel, check X's terms first. This isn't legal advice.

Step 1: Create a Telegram bot with BotFather

You make a Telegram bot by messaging @BotFather, Telegram's own bot for making bots.

Send it /newbot, then pick a name and a username that ends in "bot". It replies with a token, and Telegram warns that anyone with it can control your bot. Keep it in an environment variable:

export TELEGRAM_BOT_TOKEN="123456789:AA..."
export WEIR_API_KEY="weir_live_..."

To post in a channel, add the bot as an admin that can post messages. The Bot API calls that right can_post_messages.

Step 2: Find your Telegram chat id

sendMessage needs a chat_id. For a public channel, that's just @channelname.

For a private chat, send your bot any message first. Then call getUpdates and copy message.chat.id from the reply:

curl -s "https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/getUpdates"
export TELEGRAM_CHAT_ID="@yourchannel"  # or the number from getUpdates

Run the test command at the top of this page to check the Telegram side.

Step 3: Forward tweets to Telegram with one function

One function serves both routes. It sends each post as its own message, a second apart, which is the pace Telegram's bot FAQ asks for in one chat.

import os, pathlib, time, requests

SEND = f"https://api.telegram.org/bot{os.environ['TELEGRAM_BOT_TOKEN']}/sendMessage"

def forward(posts):
    for post in posts:
        text = f"@{post['author']['username']}: {post['text'][:2000]}\n\n{post['url']}"
        r = requests.post(SEND, timeout=10,
                          json={"chat_id": os.environ["TELEGRAM_CHAT_ID"], "text": text})
        r.raise_for_status()  # stop if Telegram refuses the message
        time.sleep(1)  # about one message per second per chat

A message holds up to 4,096 characters, so the code trims long posts and keeps the link.

Step 4: Poll X for new tweets with sinceId

Search with sinceId returns only posts newer than the id you pass, so each poll pays only for what's new.

We tested it on 22 October 2026. A search for three @XDevelopers posts cost 4 credits. The same search from the newest id found nothing:

→ search_x {"fromUsers": ["XDevelopers"], "limit": 3}
← 3 posts · 4 credits · newest id 2111172163776708859
→ search_x {"fromUsers": ["XDevelopers"], "sinceId": "2111172163776708859", "limit": 3}
← 0 posts · 1 credit · meta.nextCursor null

An empty poll still costs 1 credit, and that sets your monthly bill. Add this below the function:

STATE = pathlib.Path("since_id.txt")  # the newest post already sent
since_id = STATE.read_text().strip() if STATE.exists() else None
body = {"fromUsers": ["XDevelopers"], "limit": 20}
if since_id:
    body["sinceId"] = since_id
r = requests.post("https://api.weirapp.io/v1/x/search", json=body, timeout=30,
                  headers={"Authorization": f"Bearer {os.environ['WEIR_API_KEY']}"})
r.raise_for_status()  # a 402 means out of credits: top up, don't retry
posts = sorted(r.json()["data"], key=lambda p: int(p["id"]))  # oldest first
if since_id:  # the first run only saves the newest id, so old posts stay out
    forward(posts)
if posts:
    STATE.write_text(posts[-1]["id"])

Save it as tweets_to_telegram.py and let cron run it every 5 minutes:

*/5 * * * * cd /home/you/bot && python3 tweets_to_telegram.py

Cron runs with few environment variables, so set your three keys in the crontab too.

If an account posts over 20 times between polls, page with meta.nextCursor or poll more often.

Step 5: Get Twitter notifications in Telegram with a monitor

A monitor checks on a schedule and sends only new posts to your webhook, signed. You run a small handler, not a polling loop.

Free accounts get one monitor, daily or weekly. Hourly runs need a paid tier, and any $5 pack gets you there.

Create a webhook with POST /v1/webhooks, giving it a name and your handler's url. Save its secret, which is shown once. Then create the monitor:

curl -s https://api.weirapp.io/v1/monitors -H "Authorization: Bearer $WEIR_API_KEY" \
  -H "Content-Type: application/json" -d '{"name": "XDevelopers", "schedule": "daily",
  "target": {"kind": "x_user", "handle": "XDevelopers"}}'

Its first run reports the account's recent posts. Run it once with POST /v1/monitors/{id}/run, wait for /runs to show it finished, then send the webhookId with PATCH /v1/monitors/{id}.

The handler below uses Flask (pip install flask). Save it with the Step 3 function as bot.py:

import hashlib, hmac, json, threading
from flask import Flask, request
app, SECRET = Flask(__name__), os.environ["WEIR_WEBHOOK_SECRET"].encode()

@app.post("/weir")
def weir():
    raw, h = request.get_data(), request.headers  # the exact bytes Weir signed
    ts, event_id = h.get("weir-timestamp", ""), h.get("weir-event-id", "")
    expected = hmac.new(SECRET, f"{ts}.{event_id}.".encode() + raw, hashlib.sha256).hexdigest()
    fresh = ts.isdigit() and abs(time.time() - int(ts)) <= 300
    if not fresh or not hmac.compare_digest(expected, h.get("weir-signature", "")):
        return "", 400
    posts = json.loads(raw).get("data", {}).get("results", [])
    threading.Thread(target=forward, args=(posts,)).start()  # answer first, send after
    return "", 200

Weir signs {timestamp}.{eventId}.{rawBody} with HMAC-SHA256, per its webhook docs, and expects an answer within 10 seconds. Deliveries are at least once, so store weir-event-id if a repeat would bother you.

How much does a Twitter to Telegram bot cost?

On Weir, every poll or monitor run costs 1 credit, plus 1 per new post. Here's one account posting 10 times a day:

Credits a month for one account, 10 posts a day
Monitor, daily~330
Monitor, hourly (paid tier)~1,020
Poll every 10 min~4,620
Poll every 5 min~8,940

Your 5,000 free monthly credits cover the first three. Polling every 5 minutes goes past them, and the extra costs about $0.79 a month at the $5 pack's rate.

X's Activity API is the real-time option. X's docs say each delivered post is billed as a post, and a post read costs $0.005. This account would cost about $1.50 a month there.

If it doesn't work

  • Nothing reaches the channel. Make sure the bot is an admin there and can post messages.
  • sendMessage fails. Check the token, then the chat_id: @channelname or the number.
  • Old posts flood the chat. Keep since_id.txt between runs. For a monitor, run it once before you attach the webhook.
  • The signature never matches. Hash the raw request body. Parsed and re-serialized JSON changes the bytes.

When not to use Weir

  • You need alerts within seconds. Weir checks on a schedule. X's Activity API pushes posts as they happen, and TwitterAPI.io sells sub-second webhooks.
  • You want an account's replies. The x_user monitor reads the timeline, which leaves replies out.
  • You want to tweet from Telegram. Weir only reads. Activepieces lists X actions for that direction.
  • You'd rather not code. n8n has a Telegram node, and our n8n guide covers the webhook side.

FAQ

Is there a free Twitter to Telegram bot?

Not one that's free with no limits, as of October 2026. IFTTT's X applets need Pro, and GitHub bots need paid X API keys. Weir's 5,000 free monthly credits cover a 10-minute poll of an account that posts 10 times a day.

Does IFTTT still send tweets to Telegram?

IFTTT still lists an X trigger, "New tweet by a specific user", and a Telegram "Send message" action. Its plans page puts Twitter Applets on Pro, at $2.99 a month billed yearly. We haven't tested how fast they fire.

Do the GitHub Twitter to Telegram bots still work?

The code may still run, but both bots we checked need X API keys, and X bills $0.005 per post read. One of them, GeBakaev's twitter-telegram-forward, was archived in August 2023.

Can a Twitter tracker bot watch keywords?

Yes. Swap fromUsers for a query in the poller, or give the monitor a search target with sources set to ["x"]. For brand tracking across Reddit and X, see our social listening API.

Sources

All pages checked 22 October 2026.