Skip to main content
logo

whatsapp-python

Free, open-source Python wrapper for the WhatsApp Cloud API.
Forked from Neurotech-HQ/heyoo.

Made in Italy Downloads Monthly Downloads Weekly Downloads

Installation

To install the library you can either use pip (latest release version):

pip install whatsapp-python

You can also install the development GitHub version (always up to date, with the latest features and bug fixes):

git clone https://github.com/filipporomani/whatsapp.git
cd whatsapp
pip install .

If you want to use a local enviroment you can also use hatch:

git clone https://github.com/filipporomani/whatsapp.git
cd whatsapp
pip install hatch
hatch shell

Documentation is available in the wiki here on GitHub.

Key features:

  • Modern interface using async and await
  • Full support for Graph API error handling
  • Optimized for high-load workflows using asyncronous programming
  • Always up to date
  • All of the WhatsApp Business chat UI features supported

All features

  • Event listening (incoming messages)
  • Asyncronous API calls
  • Error handling
  • Sending messages
  • Sending messages from different numbers individually
  • Marking messages as read (optional typing indicator)
  • Replying to messages
  • Reacting to messages
  • Sending medias (images, audios/voice notes, videos, links and documents)
  • Sending location and location-request prompts
  • Sending interactive buttons, lists, and CTA URL buttons
  • Sending WhatsApp Flows, catalog, product, and product-list messages
  • Sending address-request and call-permission-request messages
  • Sending template messages
  • Parsing messages and media received (including reactions)
  • Sending contacts
  • Uploading media to the Facebook cloud
  • Automatic Graph API version discovery with a safe fallback (v27.0)

Obtaining the WhatsApp API credentials

To use the WhatsApp API you need to create a Facebook Business account and a WhatsApp Business account.

Pricing of the API

Whereas using third-party providers of the WhatsApp API can result in monthly fees, using the WhatsApp API1 offered directly by Facebook is much cheaper, even if the billing documentation is quite difficult to understand.

All the prices are available in the WhatsApp API docs.

Migrating from Neurotech-HQ/heyoo

You can ignore this if it's your first time using the library.

  • Any version >1.1.2 is incompatible with the original heyoo library! Be careful updating! Read the docs first!
  • Any version <=1.1.2 is fully compatible with the original heyoo library and doesn't include breaking changes.

Switching from heyoo to whatsapp-python doesn't require any change for versions up to 1.1.2: just uninstall heyoo, install whatsapp-python==1.1.2 and change the import name from heyoo to whatsapp.

For versions GREATER THAN 1.1.2, messages have became objects, so you need to change your code to use the new methods.

Contributing

If you are facing any issues or have any questions, please open a new issue!

This is an open source project published under the GNU Affero General Public License v3.

  1. https://developers.facebook.com/docs/whatsapp/cloud-api ↩

Metadata

Release files for whatsapp-python 4.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for whatsapp-python 4.5.0
File Size Uploaded Provenance Actions
whatsapp_python-4.5.0.tar.gz 52.4 kB Without provenance Details for whatsapp_python-4.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for whatsapp-python 4.5.0
File Interpreter ABI Platform Actions
whatsapp_python-4.5.0-py3-none-any.whl Python 3 none any Details for whatsapp_python-4.5.0-py3-none-any.whl

Total release size: 100.5 kB

Release files / whatsapp_python-4.5.0.tar.gz

Download URL whatsapp_python-4.5.0.tar.gz
Size 52.4 kB
Tags Source
SHA-256 checksum
How to use checksums
4c2c2657d07118c6b4d129213a2a35ff06654379abe6aa0da9dda21394f7d9a9
BLAKE2b-256 checksum
How to use checksums
259138efc3f674d46fc1457bb0967df3b25db9999eae427cba5c4a347c923693
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / whatsapp_python-4.5.0-py3-none-any.whl

Download URL whatsapp_python-4.5.0-py3-none-any.whl
Size 48.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
047683f0e0c60e22fc008e3e5d1c4e227adb4ed706b909dcfba5d8bcec9a9ece
BLAKE2b-256 checksum
How to use checksums
cfee35e77c5aee092a5b89bc19b65e260214ec99f1a1e8e2e2d05854dfddc357
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for whatsapp-python 4.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

4.5.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page