WasenderApi - Low Cost WhatsApp API for Developers How to Build a WhatsApp AI Chatbot in 5 Minutes Using Python (No Coding Skills Needed) - WasenderApi - Low Cost WhatsApp API for Developers
Back to all posts

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

WasenderAPI
6/25/2025
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:

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:

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 Account

Need 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:

We’ll guide you personally and make sure your bot is working smoothly.

Related Posts

WhatsApp API Unofficial: Best Alternatives for Developers and Startups
WhatsApp for Developers

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.

WasenderAPI
6/24/2025
WhatsApp API for Developers: Simplify Messaging Automation with WasenderAPI
WhatsApp for Developers

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.

WasenderAPI
6/9/2025
WaAPI for Developers: Simplify WhatsApp Automation with WaSenderAPI
WhatsApp for Developers

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.

WasenderAPI
6/9/2025

Subscribe to Our Newsletter

Stay updated with the latest news and insights about WhatsApp integration.

Subscribe Now