2026-11-22 · Guide
Build a crypto news Telegram bot with sentiment in 40 lines of Python
A news bot is the classic first crypto project — but stitching together a dozen RSS feeds, removing duplicates and figuring out which coin a headline is about takes most of the time. The Crypto News API does that part: 18 publishers merged into one feed, every article tagged with the coins it mentions and a bullish / bearish / neutral sentiment.
What you need
- A RapidAPI key (free plan)
- A Telegram bot token from @BotFather and a channel where the bot is admin
The bot
import time, requests
HOST = "crypto-news-api-18-sources-sentiment-trends.p.rapidapi.com"
API = {"x-rapidapi-host": HOST, "x-rapidapi-key": "YOUR_RAPIDAPI_KEY"}
TG = "https://api.telegram.org/botYOUR_BOT_TOKEN/sendMessage"
CHANNEL = "@your_channel"
EMOJI = {"bullish": "🟢", "bearish": "🔴", "neutral": "⚪"}
seen = set()
def latest():
r = requests.get(f"https://{HOST}/coin", headers=API, params={"symbol": "BTC", "limit": 10}, timeout=30)
return r.json()["articles"]
while True:
for a in reversed(latest()):
if a["url"] in seen:
continue
seen.add(a["url"])
text = f"{EMOJI[a['sentiment']['label']]} <b>{a['title']}</b>\n{a['source']} · {', '.join(a['coins'])}\n{a['url']}"
requests.post(TG, data={"chat_id": CHANNEL, "text": text, "parse_mode": "HTML"})
time.sleep(300)
Make it smarter
- All coins: use
/latestinstead of/coin. - Only big moves: add
sentiment=bearishto get alerts on negative news only. - Daily summary:
/trending?hours=24returns the most-mentioned coins with mention counts and average sentiment, plus the overall market mood:
t = requests.get(f"https://{HOST}/trending", headers=API, params={"hours": 24}).json()
print(t["market_sentiment"]) # {'bullish': 10, 'bearish': 49, 'neutral': 88}
for c in t["coins"][:5]:
print(c["symbol"], c["mentions"], c["avg_sentiment"])
Each article includes title, summary, image, author, publish time and a link to the original story. Sources include CoinDesk, Cointelegraph, Decrypt, The Block, Bitcoin Magazine and The Defiant — see [/sources](/crypto-news-api-18-sources-sentiment-trends).
Try it free. Crypto News API - 18 Sources, Sentiment & Trends has a free plan on RapidAPI — every endpoint included.
Get your free key