Skip to main content
Project version Supported python versions: 3.6, 3.7 and 3.8 License: BSD 3-Clause

A powerful and efficient library to interact with Facebook’s Messenger, using just your email and password. This is an asyncio fork of the fbchat library.

This is not an official API, Facebook has that over here for chat bots. This library differs by using a normal Facebook account instead.

fbchat currently support:

  • Sending many types of messages, with files, stickers, mentions, etc.

  • Fetching all messages, threads and images in threads.

  • Searching for messages and threads.

  • Creating groups, setting the group emoji, changing nicknames, creating polls, etc.

  • Listening for, an reacting to messages and other events in real-time.

  • Type hints, and it has a modern codebase (e.g. only Python 3.5 and upwards).

  • async/await (COMING).

Essentially, everything you need to make an amazing Facebook bot!

Caveats

fbchat works by imitating what the browser does, and thereby tricking Facebook into thinking it’s accessing the website normally.

However, there’s a catch! Using this library may not comply with Facebook’s Terms Of Service!, so be responsible Facebook citizens! We are not responsible if your account gets banned!

Additionally, the APIs the library is calling is undocumented! In theory, this means that your code could break tomorrow, without the slightest warning! If this happens to you, please report it, so that we can fix it as soon as possible!

With that out of the way, you may go to Read The Docs to see the full documentation!

Installation

$ pip install fbchat-asyncio

If you don’t have pip, this guide can guide you through the process.

You can also install directly from source, provided you have pip>=19.0:

$ pip install git+https://github.com/tulir/fbchat-asyncio.git#egg=fbchat

Example Usage

import getpass
import fbchat
session = fbchat.Session.login("<email/phone number>", getpass.getpass())
user = fbchat.User(session=session, id=session.user_id)
user.send_text("Test message!")

More examples are available here.

Maintainer

Acknowledgements

This project was originally inspired by facebook-chat-api.

Release files for fbchat-asyncio 0.6.21

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

Source distribution (sdist)

Source distribution for fbchat-asyncio 0.6.21
File Size Uploaded
fbchat-asyncio-0.6.21.tar.gz 55.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fbchat-asyncio 0.6.21
File Interpreter ABI Platform
fbchat_asyncio-0.6.21-py3-none-any.whl Python 3 none any Details

Total release size: 121.8 kB

Release files / fbchat-asyncio-0.6.21.tar.gz

Download URL fbchat-asyncio-0.6.21.tar.gz
Size 55.4 kB
Tags Source
SHA-256 checksum
How to use checksums
5d1881a80814ee0ffb51f9e7fddc9826268432c04050c915ae905ed924317304
BLAKE2b-256 checksum
How to use checksums
1009e2ebacd51d9f7bbe0d218520d9d4f6596f38f6f2803a35e1e7139a4135a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.4.2 requests/2.22.0 setuptools/49.3.1 requests-toolbelt/0.8.0 tqdm/4.48.2 CPython/3.8.6

Release files / fbchat_asyncio-0.6.21-py3-none-any.whl

Download URL fbchat_asyncio-0.6.21-py3-none-any.whl
Size 66.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c7b2a3082efcc75887dbba8561c662bbbd3152a4326299ab5b22badcb59535f3
BLAKE2b-256 checksum
How to use checksums
e540ce29c4364115f73b23955bf0d2291b679015095b18217e104412a8fa7330
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.4.2 requests/2.22.0 setuptools/49.3.1 requests-toolbelt/0.8.0 tqdm/4.48.2 CPython/3.8.6

Release history Release notifications | RSS feed

This release

0.6.21 This release

2 release files

0.6.20

2 release files

0.6.19

2 release files

0.6.18

2 release files

0.6.13

2 release files

0.6.12

2 release files

0.6.11

2 release files

0.6.9

2 release files

0.6.8

2 release files

0.6.7

2 release files

0.6.6

2 release files

0.6.5

2 release files

0.6.4

2 release files

0.6.3

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

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