How to Build a WhatsApp Fact-Checking Bot with Twilio and OpenAI

Misinformation travels fast on WhatsApp. It travels even faster when it looks polished. For many people, especially older users less familiar with how fake news spreads, there is no easy way to verify what lands in their inbox. Developer Charles Oduk set out to fix that, at least for his dad, and the result is a practical, deployable WhatsApp fact-checking bot built with Twilio, Node.js, and OpenAI.
The bot works across message types. Forward it a chain message, a screenshot, a voice note, or a short video clip, and it analyses the claim before sending back a structured verdict. That multiformat capability matters, because misinformation rarely arrives in just one form.
Under the hood, the stack is straightforward. Twilio’s WhatsApp Business API receives incoming messages via webhook and routes them to an Express server. From there, the app checks whether the content is text, image, audio, or video. Audio and video go through OpenAI’s speech-to-text transcription first. Images go straight to a multimodal model. Then OpenAI’s Responses API analyses the claim and, when the content looks factual or time-sensitive, runs a lightweight web verification pass before returning a result.
The response format is deliberately structured. Every reply includes a verdict (Likely legitimate, Unclear, or Likely misleading), a short reason in plain language, a practical next step for the user, and a confidence level. When the bot finds a strong official source online, it includes the matched URL. That structure is intentional, it keeps the bot from sounding overconfident, because “Unclear” is always a valid and honest answer.
Setting up the project requires a Twilio account, an OpenAI API key, Node.js 20 or later, and a tunnelling tool like ngrok for local development. The bot splits cleanly into three files: an Express webhook handler, a media service for downloading and classifying Twilio media, and an OpenAI service handling transcription and verification.
One technical detail is worth noting. Twilio stores inbound media at authenticated URLs. That means the bot must download files using account credentials before passing them to OpenAI, a small but necessary step that the tutorial handles in the media service layer.
The Twilio WhatsApp Sandbox makes testing straightforward. Once the sandbox join code is sent from a phone, real forwarded messages can go directly to the bot. The developer notes several natural extensions from here: webhook request validation, async handling for longer audio files, a database of known fake messages, and verdict analytics over time.
Misinformation is a real problem. Tools like this one, small, focused, and deployable in an afternoon, are one practical response.






