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

waapi ya no funciona: Descubre la mejor alternativa con WaSenderAPI
WhatsApp for Developers

waapi ya no funciona: Descubre la mejor alternativa con WaSenderAPI

¿waapi.app está caído? Descubre por qué WaSenderAPI es la mejor alternativa no oficial a la API de WhatsApp. Envío ilimitado, integración fácil y sin complicaciones.

WasenderAPI
7/11/2025
A Melhor API de WhatsApp Não Oficial para Desenvolvedores no Brasil – Conheça o WaSenderAPI
WhatsApp for Developers

A Melhor API de WhatsApp Não Oficial para Desenvolvedores no Brasil – Conheça o WaSenderAPI

Procura uma alternativa acessível à API oficial do WhatsApp? Conheça o WaSenderAPI – API poderosa, fácil de integrar e sem limite de mensagens. Ideal para desenvolvedores e empresas no Brasil.

WasenderAPI
7/11/2025
Unofficial WhatsApp API A Complete 2025 Guide for Developers and Businesses
WhatsApp for Developers

Unofficial WhatsApp API A Complete 2025 Guide for Developers and Businesses

Looking for a flexible, fast, and affordable unofficial WhatsApp API? Discover why WaSenderAPI is the best alternative to Meta’s limited official API in 2025.

WasenderAPI
7/11/2025