How to Build a WhatsApp AI Chatbot in 5 Minutes Using Python (No Coding Skills Needed)

5 Easy Steps to Build Your Own AI WhatsApp Chatbot
In this short guide, you'll learn how to build a smart WhatsApp chatbot using WaSenderAPI and Google Gemini AI. No complicated setup — just follow the steps below.
Step 1: What You Need
- 1. WaSenderAPI: Sign up at wasenderapi.com and get your API token (just $6/month).
- 2. Gemini AI: Get your free API key at makersuite.google.com (1500 free requests/month).
- 3. Python: Download and install from python.org.
- 4. Ngrok: Download from ngrok.com to expose your local server to the internet.
Step 2: Download the Chatbot Project
This GitHub repo has over 600 stars and contains everything you need to get started. Just download the complete project and start customizing it.
You can choose one of the following methods:
- 1. Download as ZIP: Click here to download the project , then unzip it anywhere on your computer.
- OR clone with Git:
git clone https://github.com/YonkoSam/whatsapp-python-chatbot.git
2. After downloading or cloning, open your terminal, go to the project folder, and install the required libraries with:
pip install -r requirements.txt
Step 3: Add Your API Keys
In the .env
file, paste your actual keys like this:
GEMINI_API_KEY=your_google_key_here WASENDER_API_TOKEN=your_wasender_token_here
Where to get them:
- Gemini: From your Gemini dashboard.
- WaSenderAPI: From your WaSenderAPI dashboard.
Step 4: Run the Bot
Run the chatbot using:
python script.py
Now open a second terminal window and run:
ngrok http 5001
Copy the ngrok URL (like https://abcd1234.ngrok.io
) and add /webhook
at the end. Then go to your WaSenderAPI dashboard and paste it into the webhook field under your session settings. Select only message_upsert
.
Important: Make sure to only select the message_upsert
event in your webhook settings. This ensures your bot receives new messages correctly.
Step 5: Customize and Chat
Open persona.json
to control how your bot talks. Example:
{ "name": "Chat Assistant", "base_prompt": "You are a friendly and smart assistant. Keep your answers short and helpful." }
Now send a WhatsApp message to the number connected via WaSenderAPI. Your bot will respond automatically!
You’re Done!
You now have a working AI chatbot on WhatsApp using Python, Gemini, and WaSenderAPI — without any complex steps.
Create Your WaSenderAPI AccountNeed Help?
If you face any issues while setting up your chatbot or if you have questions, don’t worry — we’re here to help.
You can reach us directly:
- WhatsApp: Click here to chat with us
- Email: contact@wasenderapi.com
We’ll guide you personally and make sure your bot is working smoothly.
Related Posts

WhatsApp API Unofficial: Best Alternatives for Developers and Startups
Looking for a WhatsApp API unofficial solution? Discover why developers prefer unofficial WhatsApp APIs like WasenderAPI for faster, more flexible, and cheaper integrations. Start sending messages instantly with no Meta approval needed.

WhatsApp API for Developers: Simplify Messaging Automation with WasenderAPI
Discover how developers can use the WhatsApp API to build powerful messaging tools, automate communication, and create chatbots with ease using WasenderAPI no coding headaches, no limits.

WaAPI for Developers: Simplify WhatsApp Automation with WaSenderAPI
Discover how developers can leverage WaAPI through WaSenderAPI to automate WhatsApp messaging, integrate chatbots, and build powerful communication tools without the complexity of Meta’s official API.
Subscribe to Our Newsletter
Stay updated with the latest news and insights about WhatsApp integration.
Subscribe Now