truthbrush
Truthbrush is an API client for Truth Social.
Currently, this tool can:
- Search for users, statuses, groups, or hashtags
- Pull a user's statuses
- Pull the list of "People to Follow" or suggested users
- Pull "trending" hashtags
- Pull "trending" Truth posts
- Pull ads
- Pull a user's metadata
- Pull the list of users who liked a post
- Pull the list of comments on a post
- Pull "trending" groups
- Pull list of suggested groups
- Pull "trending" group hashtags
- Pull posts from group timeline
Truthbrush is designed for academic research, open source intelligence gathering, and data archival. It pulls all data from the publicly accessible API.
Installation
From PyPi:
pip install truthbrush
From git:
- To install it, run
pip install git+https://github.com/stanfordio/truthbrush.git
From source:
- Clone the repository and run
pip3 install .. Provided yourpipis setup correctly, this will maketruthbrushavailable both as a command and as a Python package.
After installation, you will need to set your Truth Social username and password as environmental variables.
export TRUTHSOCIAL_USERNAME=foo
export TRUTHSOCIAL_PASSWORD=bar
If you encounter login issues, you can instead extract your login token from the truth:auth Local Storage store and export it in TRUTHSOCIAL_TOKEN.
You may also set these variables in a .env file in the directory from which you are running Truthbrush.
Public mode (no credentials)
Some Truth Social endpoints are readable without authentication. To run Truthbrush against only those endpoints, pass --no-auth on the CLI or construct the client with require_auth=False:
truthbrush --no-auth trends
truthbrush --no-auth user realDonaldTrump
from truthbrush import Api
api = Api(require_auth=False)
print(api.trending())
Endpoints that require authentication will return an API error (typically HTTP 401) when called in public mode. Which endpoints are publicly accessible is determined by Truth Social and may change without notice.
CLI Usage
Usage: truthbrush [OPTIONS] COMMAND [ARGS]...
Options:
--no-auth Run without authentication. Only public endpoints will succeed.
--help Show this message and exit.
Commands:
search Search for users, statuses or hashtags.
statuses Pull a user's statuses.
suggestions Pull the list of suggested users.
tags Pull trendy tags.
trends Pull trendy Truths.
ads Pull ads.
user Pull a user's metadata.
likes Pull the list of users who liked a post
comments Pull the list of oldest comments on a post
groupposts Pull posts from a groups's timeline
grouptags Pull trending group tags.
grouptrends Pull trending groups.
groupsuggestions Pull list of suggested groups.
Search for users, statuses, groups, or hashtags
truthbrush search --searchtype [accounts|statuses|hashtags|groups] QUERY
Restrict status results to a date window:
truthbrush search --searchtype statuses --start-date 2024-11-01 --end-date 2024-11-07 QUERY
Pull all statuses (posts) from a user
truthbrush statuses HANDLE
Restrict to a date window (UTC assumed when no timezone is given):
truthbrush statuses --created-after 2024-11-01 --created-before 2024-11-07 HANDLE
Pull "People to Follow" (suggested) users
truthbrush suggestions
Pull trendy tags
truthbrush tags
Pull ads
truthbrush ads
Pull all of a user's metadata
truthbrush user HANDLE
Pull the list of users who liked a post
truthbrush likes POST --includeall TOP_NUM
Pull the list of oldest comments on a post
truthbrush comments POST --includeall --onlyfirst TOP_NUM
Pull trending group tags
truthbrush grouptags
Pull trending groups
truthbrush grouptrends
Pull list of suggested groups
truthbrush groupsuggestions
Pull posts from a group's timeline
truthbrush groupposts GROUP_ID
Contributing
Contributions are encouraged! For small bug fixes and minor improvements, feel free to just open a PR. For larger changes, please open an issue first so that other contributors can discuss your plan, avoid duplicated work, and ensure it aligns with the goals of the project. Be sure to also follow the code of conduct. Thanks!
Development setup (ensure you have Poetry installed):
poetry install
poetry shell
truthbrush --help # will use your local copy of truthbrush
To run the tests:
pytest
# optionally run tests with verbose logging outputs:
pytest --log-cli-level=DEBUG -s
Please format and lint your code with ruff, and run ty to check types:
ruff format .
ruff check .
ty check truthbrush/
Metadata
Release files for truthbrush 0.4.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| truthbrush-0.4.1.tar.gz | 15.7 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| truthbrush-0.4.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 31.5 kB
Release files / truthbrush-0.4.1.tar.gz
| Download URL | truthbrush-0.4.1.tar.gz |
|---|---|
| Size | 15.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bc44811db4db1af974d51e0f18196056926e72926dc4117f0838016b26d064d1
|
|
BLAKE2b-256 checksum How to use checksums |
e961d79a47c4e5532f58419ea4fff9248ce4457285c13d188d36b57c7081885a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 25, 2026.
Transparency logRelease files / truthbrush-0.4.1-py3-none-any.whl
| Download URL | truthbrush-0.4.1-py3-none-any.whl |
|---|---|
| Size | 15.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d8d74d4d3093996297b91247151296a08901d5770b643d9722059afe63fd0901
|
|
BLAKE2b-256 checksum How to use checksums |
ee12c81b7a89f3dd2a76fbd3d4077fccf1a55cac120e8e87643f539df4053046
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 25, 2026.
Transparency logSecurity for truthbrush 0.4.1
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.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for truthbrush-0.4.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 25, 2026.
Transparency logA 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.