Bard 
Reverse engineering of Google's Bard chatbot API
Installation
$ pip3 install --upgrade GoogleBard
Authentication
Go to https://bard.google.com/
- F12 for console
- Copy the values
- Session: Go to Application → Cookies →
__Secure-1PSID. Copy the value of that cookie.
- Session: Go to Application → Cookies →
Usage
$ python3 -m Bard -h
usage: Bard.py [-h] --session SESSION
options:
-h, --help show this help message and exit
--session SESSION __Secure-1PSID cookie.
Quick mode
$ export BARD_QUICK="true"
$ export BARD_SESSION="<__Secure-1PSID>"
$ python3 -m Bard
Environment variables can be placed in .zshrc.
Example bash shortcut:
# USAGE1: bard QUESTION
# USAGE2: echo "QUESTION" | bard
bard () {
export BARD_QUICK=true
export BARD_SESSION=<REDACTED>.
python3 -m Bard "${@:-$(</dev/stdin)}" | tail -n+7
}
Developer Documentation
from os import environ
from Bard import Chatbot
token = environ.get("BARD_TOKEN")
chatbot = Chatbot(token)
chatbot.ask("Hello, how are you?")
Credits:
- discordtehe - Derivative of his original reverse engineering
Release files for GoogleBard 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| GoogleBard-1.1.0.tar.gz | 5.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| GoogleBard-1.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.3 kB
Release files / GoogleBard-1.1.0.tar.gz
| Download URL | GoogleBard-1.1.0.tar.gz |
|---|---|
| Size | 5.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b90d7a97d38e6f67180b219b380ecf59f607b2e30fa611332e56000183778b6a
|
|
BLAKE2b-256 checksum How to use checksums |
bdd1ab9ab863882923e2fd47d78250607e17b520f914a5e070a28bbba73bc82f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.16
|
Release files / GoogleBard-1.1.0-py3-none-any.whl
| Download URL | GoogleBard-1.1.0-py3-none-any.whl |
|---|---|
| Size | 5.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6fb2e221998fbc292051c3e3a358c5a3d4544f1bb702797d7da43b909aa32463
|
|
BLAKE2b-256 checksum How to use checksums |
7f5127bfd03ac31d26b7c618f49221e36d6b287bc9cfdf67e0534c9b17acc113
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.16
|