Blog/
Webhook vs Polling for Twitter/X Account Alerts
Compare polling timelines vs signed HTTP webhooks for X account alerts — latency, cost, failure modes, and when XFlux monitors fit.
The polling trap
The default DIY pattern: cron every N minutes, GET user timeline, diff tweet IDs, notify Slack/Discord. It works until you scale — more accounts means more requests, more rate-limit juggling, and quieter failures when a job silently skips a tick.
Polling also forces a latency floor. A 5-minute cron means up to 5 minutes late on market-moving posts. Shortening the interval multiplies API spend.
What webhooks change
With monitors, the platform watches schedules and POSTs to your HTTPS endpoint when new tweets appear. Paid XFlux plans sign payloads so you can verify authenticity (HMAC). You still need an idempotent handler — duplicate deliveries happen in any webhook system.
You trade cron complexity for endpoint reliability: TLS, fast 2xx responses, and retries. That is usually the right trade for production alerts.
When polling is still fine
One-off research scripts, MCP agent sessions, and low-stakes dashboards can poll search or timelines on demand. Free-tier exploration often starts there.
Hybrid pattern: poll/search to discover accounts, then promote winners to monitors + webhooks so you stop babysitting cron.
Practical checklist
Prefer webhooks when latency or missed posts cost money. Prefer polling when you are still exploring queries. Verify signatures, log delivery IDs, and keep handlers under a few hundred ms.
Setup guide: /docs/monitors and /docs/webhooks. Narrative walkthrough: /blog/twitter-account-monitor-webhook. Discord path: /twitter-discord-alerts.
FAQ
- Does Free include live webhooks?
- Free can create a monitor and send test pings. Live hit delivery on new tweets is on Starter and above. See /pricing.
- How do I verify XFlux webhooks?
- Use the signing secret from the dashboard and verify the HMAC header before trusting the body. Details in /docs/webhooks.
- What if my endpoint is down?
- Design for retries and catch-up. Keep your receiver highly available; do not put long work on the request path — queue and ack quickly.
Build with XFlux
Free tier for reads and one monitor. Starter from $19/mo for signed webhooks and faster polling.