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: [email protected]
We’ll guide you personally and make sure your bot is working smoothly.
Related Posts

Unofficial WhatsApp API: Affordable, Flexible & Reliable Alternative | WasenderAPI
Discover the benefits of using an unofficial WhatsApp API for businesses and developers. Compare costs, features, and stability, and see why WasenderAPI is the best low-cost solution with unlimited messages and easy integration.

Waapi Login Not Working? Best Alternative for WhatsApp API (WasenderAPI)
Searching for Waapi login but the site is down? Waapi is no longer working. Discover WasenderAPI, the best unofficial WhatsApp API alternative with reliable service.

Evolution API Pricing: Why WasenderAPI is a cheaper, | Cheap Alternative to evolution api
Discover how Evolution API pricing works and why WasenderAPI offers a more transparent, cost-effective solution. Save money with unlimited messages, no hidden fees, and easy multi-session WhatsApp integration. Switch today for hassle-free messaging.