
Security News
The Nightmare Before Deployment
Season’s greetings from Socket, and here’s to a calm end of year: clean dependencies, boring pipelines, no surprises.
fbapy
Advanced tools
Unofficial Facebook Chat API for Python
fbapy is a Python version of the Node.js package @xaviabot/fca-unofficial. It is based on the forked deprecated version fca-unoffical, which itself is a fork of the deprecated version facebook-chat-api.
fbapy acknowledges the contributions of the original authors of facebook-chat-api, recognizes the efforts put into fca-unoffical, and explains that the Python version is based on the for @xaviabot/fca-unofficial.
fbapy is available on PyPI:
pip install fbapy
If you encounter an error like this:
ImportError: failed to find libmagic. Check your installation
You need to install libmagic.
For Termux:
pkg install sox
For replit.com, open replit.nix and add magic to the list of dependencies, for example:
{ pkgs }: {
deps = [
pkgs.python311Packages.magic
];
}
For Other Platforms, try installing python-magic-bin:
pip install python-magic-bin==0.4.14
Using base64 encoded appstate from c3c-fbstate
from fbapy import *
client = Client()
api = client.login(
appstate="YOUR_BASE64_ENCODED_APP_STATE",
options={
"user_agent": "YOUR_USER_AGENT",
},
)
api.http.send_message(
msg="Hello World!",
thread_id="0000000000000000",
)
You can run test.py to test the package. Install packages from requirements.txt + python-dotenv first.
pip install -r requirements.txt
pip install python-dotenv
Then create a .env file in the root directory of the project and add the following:
APPSTATE="YOUR_BASE64_ENCODED_APP_STATE"
Then run test.py:
python test.py
Open a chat with the appstate account, try sending ?ping1/?ping2, and you should get a reply pong

See DOCS.md for more information.
This project is licensed under the MIT License - see the LICENSE file for details.
FAQs
Unofficial Facebook Chat API for Python
We found that fbapy demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Season’s greetings from Socket, and here’s to a calm end of year: clean dependencies, boring pipelines, no surprises.

Research
/Security News
Impostor NuGet package Tracer.Fody.NLog typosquats Tracer.Fody and its author, using homoglyph tricks, and exfiltrates Stratis wallet JSON/passwords to a Russian IP address.

Security News
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.