Py-WhatsApp: Unofficial python module for chat api
Py-WhatsApp is the un-official python module for chat-api.com and provides a pure pythonic way to communicate with WhatsApp programmatically without the official business API.
What is chat-api.com
It is a multifunctional rest api for WhatsApp accounts working on top of WhatsApp web. They offer a 3-day free trial to allow you to use the service before buying and this python package allows you to interface with most of its services directly.
Pitfalls of official WhatsApp API
For more information head over to https://www.whatsapp.com/business/api/.
How to use
from whatsapp import WhatsApp token = "xxxxxxx" instance_id = "instancexxx" object = WhatsApp(token, instance_id) phone_number = "911234512345" message = "This is a sample text message. *This will be bold*" response = object.send_message(phone_number, message)
Keep in mind the phone number has to be in the international format, here the sample number is from India(country code +91).
I am in no way associated to WhatsApp to Chat-API. This post and the corresponding module is only for educational purpose.