Set up real-time monitoring for your brand on Twitter. Get instant webhook alerts when someone mentions your brand or products.
Sign up at scrapebadger.com and grab your API key.
Set up real-time monitoring for your brand's Twitter account(s).
curl -X POST 'https://scrapebadger.com/v1/twitter/stream/monitors' \
-H 'x-api-key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"name": "Brand Monitor",
"usernames": ["yourbrand", "your_ceo"],
"webhook_url": "https://your-app.com/webhooks/twitter",
"webhook_secret": "your_webhook_secret"
}'Create Filter Rules to catch indirect mentions that don't @tag your account.
curl -X POST 'https://scrapebadger.com/v1/twitter/stream/filter-rules' \
-H 'x-api-key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"tag": "Brand Keywords",
"query": "\"your brand\" OR \"your product\" OR #yourbrand",
"interval_seconds": 60,
"webhook_url": "https://your-app.com/webhooks/keywords"
}'Process incoming tweet notifications in your application.
from flask import Flask, request
import hmac
import hashlib
app = Flask(__name__)
SECRET = "your_webhook_secret"
@app.route("/webhooks/twitter", methods=["POST"])
def handle_webhook():
# Verify HMAC signature
sig = request.headers.get("X-Webhook-Signature")
expected = hmac.new(SECRET.encode(), request.data, hashlib.sha256).hexdigest()
if sig != expected:
return "Invalid signature", 401
data = request.json
tweet = data["tweet"]
print(f"New mention from @{tweet['author']['username']}: {tweet['text']}")
# Send to Slack, log to DB, trigger alert, etc.
return "OK", 200For real-time streaming without webhooks, connect via WebSocket.
import asyncio
import websockets
import json
async def monitor():
uri = "wss://scrapebadger.com/v1/twitter/stream?api_key=YOUR_API_KEY"
async with websockets.connect(uri) as ws:
async for message in ws:
tweet = json.loads(message)
print(f"@{tweet['author']['username']}: {tweet['text']}")
asyncio.run(monitor())Webhooks are delivered within seconds of the tweet being posted. Typical latency is 1-5 seconds.
Yes. Create additional monitors and filter rules for competitor usernames and brand keywords.
ScrapeBadger retries failed webhook deliveries with exponential backoff. Missed deliveries are logged and can be retrieved from the logs endpoint.
Stream Monitors use volume-based pricing per monitored account per day. Check the pricing page for current rates.
Use advanced search operators to find tweets by keyword, hashtag, author, date range, language, and more.
5 minutesMonitor trending topics globally and by location. Build trend dashboards, detect breaking news, and spot viral content early.
5 minutesLearn how to extract the complete follower list of any Twitter account with profile data, follower counts, and bios.
5 minutes