{"id":15133031,"url":"https://github.com/acheong08/bard","last_synced_at":"2025-09-29T02:32:33.005Z","repository":{"id":145084798,"uuid":"617489512","full_name":"acheong08/Bard","owner":"acheong08","description":"Python SDK/API for reverse engineered Google Bard","archived":true,"fork":false,"pushed_at":"2023-07-26T02:52:48.000Z","size":55,"stargazers_count":1421,"open_issues_count":16,"forks_count":177,"subscribers_count":25,"default_branch":"main","last_synced_at":"2024-12-19T05:21:00.707Z","etag":null,"topics":["chatbot","google","google-bard","gpt","reverse-engineering"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/acheong08.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-03-22T13:56:44.000Z","updated_at":"2024-12-18T10:49:37.000Z","dependencies_parsed_at":"2024-01-06T15:04:33.820Z","dependency_job_id":"a4e22370-766c-4a23-9c90-96ed4698de95","html_url":"https://github.com/acheong08/Bard","commit_stats":null,"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acheong08%2FBard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acheong08%2FBard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acheong08%2FBard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acheong08%2FBard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/acheong08","download_url":"https://codeload.github.com/acheong08/Bard/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234583683,"owners_count":18856280,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chatbot","google","google-bard","gpt","reverse-engineering"],"created_at":"2024-09-26T04:43:25.874Z","updated_at":"2025-09-29T02:32:32.689Z","avatar_url":"https://github.com/acheong08.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bard \u003cimg src=\"https://www.gstatic.com/lamda/images/favicon_v1_150160cddff7f294ce30.svg\" width=\"35px\" /\u003e\nReverse engineering of Google's Bard chatbot API\n\n## Installation\n```bash\n $ pip3 install --upgrade GoogleBard\n```\n\n## Authentication\nGo to https://bard.google.com/\n\n- F12 for console\n- Copy the values\n  - Session: Go to Application → Cookies → `__Secure-1PSID` and `__Secure-1PSIDTS`. Copy the value of those cookie.\n\n## Usage\n\n```bash\n$ python3 -m Bard -h\nusage: Bard.py [-h] --session \u003c__Secure-1PSID\u003e --session_ts \u003c__Secure-1PSIDTS\u003e\n\noptions:\n  -h, --help         show this help message and exit\n  --session --session_ts       pass two cookies\n```\n\n### Quick mode\n```\n$ export BARD_QUICK=\"true\"\n$ export BARD__Secure_1PSID=\"\u003c__Secure-1PSID\u003e\"\n$ export BARD__Secure_1PSIDTS=\"\u003c__Secure-1PSIDTS\u003e\"\n$ python3 -m Bard\n```\nEnvironment variables can be placed in .zshrc.\n\nExample bash shortcut:\n```bash\n# USAGE1: bard QUESTION\n# USAGE2: echo \"QUESTION\" | bard\nbard () {\n\texport BARD_QUICK=true\n\texport BARD__Secure_1PSID=\u003c__Secure-1PSID\u003e\n\texport BARD__Secure_1PSIDTS=\u003c__Secure-1PSIDTS\u003e\n\tpython3 -m Bard \"${@:-$(\u003c/dev/stdin)}\" | tail -n+7\n}\n```\n\n### Implementation:\n```python\nfrom os import environ\nfrom Bard import Chatbot\n\nSecure_1PSID = environ.get(\"BARD__Secure_1PSID\")\nSecure_1PSIDTS = environ.get(\"BARD__Secure_1PSIDTS\")\nchatbot = Chatbot(Secure_1PSID, Secure_1PSIDTS)\n\nanswer = chatbot.ask(\"Hello, how are you?\")\n\nprint(answer['content']\n```\n\n### Async Implementation:\n```python\nimport asyncio\nfrom os import environ\nfrom Bard import AsyncChatbot\n\nSecure_1PSID = environ.get(\"BARD__Secure_1PSID\")\nSecure_1PSIDTS = environ.get(\"BARD__Secure_1PSIDTS\")\n\nasync def main():\n    chatbot = await AsyncChatbot.create(Secure_1PSID, Secure_1PSIDTS)\n    response = await chatbot.ask(\"Hello, how are you?\")\n    print(response['content'])\n\nasyncio.run(main())\n```\n\n## [Developer Documentation](https://github.com/acheong08/Bard/blob/main/DOCUMENTATION.md)\n\nCredits:\n- [discordtehe](https://github.com/discordtehe) - Derivative of his original reverse engineering\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facheong08%2Fbard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Facheong08%2Fbard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facheong08%2Fbard/lists"}