Python SDK for accessing Google Gemini (formerly Bard) via cookie value
Top 9.8% on sourcepulse
This Python package provides an unofficial interface to Google Bard (now Gemini), enabling developers to interact with the conversational AI using cookie values for authentication. It's designed for testing and development purposes, offering a lightweight alternative while Google's official APIs are in development.
How It Works
The package reverse-engineers the inference process of Google Bard/Gemini, utilizing the __Secure-1PSID
cookie obtained from a user's browser session. This approach bypasses the need for official API keys, allowing direct interaction with the service by mimicking a logged-in user.
Quick Start & Requirements
pip install bardapi
or pip install git+https://github.com/dsdanielpark/Bard-API.git
__Secure-1PSID
cookie value from gemini.google.com
.Highlighted Details
browser_cookie3
for simplified authentication.Maintenance & Community
The project is marked as "Inactive" in development status, with a recommendation to use the python-gemini-api
package. Core maintainers include Antonio Cheong and Daniel Park.
Licensing & Compatibility
Limitations & Caveats
This package is unofficial and relies on reverse-engineered methods, making it susceptible to breakage with Google's service updates. Cookie values change frequently, requiring periodic re-authentication. Image query functionality is experimental and may not be universally available. The project is marked as inactive, with a successor project recommended.
1 year ago
1 day