Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/erucix/Bard-API
Small, lightweight and reliable unofficial Google Bard API built on Node-JS only. No external library implemented and or required to download.
https://github.com/erucix/Bard-API
api bard bard-ai bard-api google-bard nodejs
Last synced: 9 days ago
JSON representation
Small, lightweight and reliable unofficial Google Bard API built on Node-JS only. No external library implemented and or required to download.
- Host: GitHub
- URL: https://github.com/erucix/Bard-API
- Owner: erucix
- License: mit
- Created: 2023-07-22T14:21:30.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-08-27T02:29:04.000Z (about 1 year ago)
- Last Synced: 2024-08-02T15:30:59.929Z (3 months ago)
- Topics: api, bard, bard-ai, bard-api, google-bard, nodejs
- Language: JavaScript
- Homepage:
- Size: 24.4 KB
- Stars: 5
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 💀 GoogleBard API v3.0
Small, lightweight and reliable unofficial Google Bard API built on Node-JS only. No external library implemented and or required to download. Only for educational and testing purpose. And I hold no responsibility of its misuse.
# 🫀 How to run?
Open your terminal and paste this command.
```bash
git clone https://github.com/erucix/bard-api.git
cd Bard-API
node example.js #make sure you have put your tokens in example.js
```Now to implement your own Bot logic you can have a look at ```example.js``` or see this.
Make sure you have `cookie` token with you. You need the full cookie list.
To get your full `cookie` list follow this step:
- Open https://bard.google.com
- Open `Network` tab from `Developer Tools` or press `Ctrl+Shift+I` and go to `Network`
- Now refresh `https://bard.google.com`.
- Under `Name` section click on `bard.gooogle.com` or `/u/1` (You might need to scroll to top first)
- Now under `Request Headers` copy all content from `Cookie`To get your `snlm0e` token follow this step:
- Open https://bard.google.com
- Open `Console` from `Developer Tools` or press `Ctrl+Shift+I`
- Paste this code in your console
```javascript
prompt("Copy me: ", WIZ_global_data.SNlM0e)
```
Now this is the file where you implement the `cookie` and `snlm0e` tokens
```javascriptconst bard = require("./Bard");
bard.prompt({
"message": "Who is chris evans",
"cookie": "YOUR-COOKIE-HERE",
"snlm0e": "YOUR-SNLME0-TOKEN-HERE"
}).then(data => console.log(data.message.answer))
```Response will be in `object` and will be of following model:
```javascript
{
"status": "pass or fail"
"message": "__CONTAINS_RESPONSE_OF_YOUR_PROMPT__",
"c_id": "__SOME_RANDOM_ID___", //optional
"r_id": "__SOME_RANDOM_ID___", //optional
"rc_id": "__SOME_RANDOM_ID___", //optional
}```
You can also get `Conversation history `and` Conversation List` using the built in api and this is left to be solved by the users themselves.**NOTE**: BARD API is still not officially released by google so this is a reverse engineered version. Proceed with caution.
**Thanks for the time 💝**