Skip to main content

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.

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)

Source distribution for GoogleBard 1.1.0
File Size Uploaded
GoogleBard-1.1.0.tar.gz 5.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for GoogleBard 1.1.0
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

2.1.0

2 release files

2.0.0

2 release files

1.4.0

2 release files

1.3.3

2 release files

1.3.2

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

This release

1.1.0 This release

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

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