skillfed

fbmessenger

A python library to communicate with the Facebook Messenger API's

fbmessenger v6.0.0 280.4K downloads/30d#8,111 on PyPI113
Permissive license Apache Abandoned released

What it is and what it does

fbmessenger is a wrapper around the Facebook Messenger Send API that lets you build chatbots and message handlers in Python. You extend a BaseMessenger class to handle incoming webhook events (messages, deliveries, reads, postbacks, etc.) and use a MessengerClient to send text, buttons, templates, and media attachments back to users. It includes support for message tags, notification types, and timeouts on network calls.

The package is designed to integrate with Flask or similar web frameworks to receive and process webhook callbacks from Facebook. It abstracts away the HTTP plumbing and JSON serialization, letting you focus on the logic of responding to user messages. However, the project has not been maintained since 2019, so it may not reflect current Facebook API requirements or Python ecosystem best practices.

Use it for:

  • Build a simple chatbot that responds to user messages on Facebook Messenger with text or templated replies.
  • Integrate Messenger into a Flask web app to handle incoming webhook events and send structured messages back.
  • Send rich message templates (generic, button, receipt) with images, links, and interactive buttons to Messenger users.
  • Upload and manage media attachments (images, audio, video, files) for use in Messenger conversations.
  • Implement message tags to send notifications outside the standard 24-hour message window for specific use cases.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

A Python library for sending and receiving messages through the Facebook Messenger API, with support for templates, attachments, buttons, and webhook handling.

No. The package is abandoned (last release April 2019, last commit December 2022) and has not been updated to reflect changes in the Facebook Messenger API or modern Python versions. Unless you are maintaining legacy code that already depends on it, you should use an actively maintained alternative or build directly against the current Facebook Graph API.

Install

fbmessenger on PyPI

pip

pip install fbmessenger

uv

uv add fbmessenger

poetry

poetry add fbmessenger

Installing fbmessenger

Before you install

Installation is straightforward with low friction—a single wheel dependency on requests. However, the package is abandoned; the last commit was in 2022 and no releases have occurred since April 2019, raising concerns about compatibility with current Facebook API changes and Python versions.

License in practice

Licensed under Apache (permissive), so you may use, modify, and distribute the package freely in commercial and private projects without restriction.

Quickstart

pip install fbmessenger

from fbmessenger import BaseMessenger, MessengerClient

class Messenger(BaseMessenger):
    def __init__(self, page_access_token):
        self.client = MessengerClient(page_access_token)
    def message(self, message):
        self.send({'text': 'Received'}, 'RESPONSE')
    def delivery(self, message): pass
    def read(self, message): pass
    def optin(self, message): pass
    def postback(self, message): pass
    def account_linking(self, message): pass

messenger = Messenger('your_page_token')
messenger.handle(webhook_payload)

Requires a Facebook app with Messenger product enabled, a page access token, and a publicly accessible webhook URL to receive callbacks from Facebook.

Verify before relying

  • Whether the package remains compatible with current Facebook Messenger API endpoints and authentication requirements.
  • Whether Python 3.3–3.5 support claims (in classifiers) reflect actual tested compatibility or are outdated.
  • Whether the package handles recent Facebook API breaking changes introduced after April 2019.

Package facts

License Apache (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies 1 — requests
Maintenance abandoned — 2,669 days since the last release
Last repo commit
First released
Downloads 280,412/month — #8,111 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: fbmessenger-6.0.0-py2.py3-none-any.whl

Keywords: Facebook, Messenger, Bot, Chatbot

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseNatural Language :: EnglishProgramming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.3Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5Topic :: Software Development :: Build Tools

Tags

facebook messenger api pythonsend messages facebook messengerfacebook chatbot librarymessenger webhook handlerfacebook bot pythonmessenger api clientfacebook message templates
facebook-integrationchatbotwebhook-handler

More Build Tools packages