Skip to content

Small, lightweight and reliable unofficial Google Bard API built on Node-JS only. No external library implemented and or required to download.

License

Notifications You must be signed in to change notification settings

erucix/Bard-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

f645117 Β· Aug 27, 2023

History

11 Commits
Aug 26, 2023
Jul 22, 2023
Aug 26, 2023
Aug 27, 2023
Aug 26, 2023

Repository files navigation

πŸ’€ 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.

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
prompt("Copy me: ", WIZ_global_data.SNlM0e)

Now this is the file where you implement the cookie and snlm0e tokens

const 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:

{
    "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 πŸ’

About

Small, lightweight and reliable unofficial Google Bard API built on Node-JS only. No external library implemented and or required to download.

Topics

Resources

License

Stars

Watchers

Forks