PHPackages                             khaledalam/bard-sdk-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. khaledalam/bard-sdk-php

ActiveLibrary[API Development](/categories/api)

khaledalam/bard-sdk-php
=======================

Google Bard SDK for PHP (unofficial).

v1.0.0(2y ago)72683[2 issues](https://github.com/khaledalam/bard-sdk-php/issues)MITPHPPHP &gt;=7.4

Since May 21Pushed 2y ago3 watchersCompare

[ Source](https://github.com/khaledalam/bard-sdk-php)[ Packagist](https://packagist.org/packages/khaledalam/bard-sdk-php)[ RSS](/packages/khaledalam-bard-sdk-php/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

[![](https://camo.githubusercontent.com/a9db264b88fdc37967af9cf2f17951c543d792e63b8ac858b79c2e519fba5cf9/68747470733a2f2f313030306c6f676f732e6e65742f77702d636f6e74656e742f75706c6f6164732f323032332f30352f426172642d41492d4c6f676f2e706e67)](https://camo.githubusercontent.com/a9db264b88fdc37967af9cf2f17951c543d792e63b8ac858b79c2e519fba5cf9/68747470733a2f2f313030306c6f676f732e6e65742f77702d636f6e74656e742f75706c6f6164732f323032332f30352f426172642d41492d4c6f676f2e706e67) PHP SDK/API for Google Bard (experiment version) (unofficial)
===================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#-php-sdkapi-for-google-bard-experiment-version-unofficial)

[![Downloads](https://camo.githubusercontent.com/2a5c6303ba63d486369801ad6e9c8b1dcbac558c3bf96dff5ab762676cd60e27/68747470733a2f2f706f7365722e707567782e6f72672f6b68616c6564616c616d2f626172642d73646b2d7068702f642f746f74616c2e737667)](https://packagist.org/packages/khaledalam/bard-sdk-php)[![Latest Stable Version](https://camo.githubusercontent.com/f0572478234864f60b58b25703b1ae69386cf4f3c4628a525514a6e90973caea/68747470733a2f2f706f7365722e707567782e6f72672f6b68616c6564616c616d2f626172642d73646b2d7068702f76657273696f6e2e737667)](https://packagist.org/packages/khaledalam/bard-sdk-php)[![PHP Version Require](https://camo.githubusercontent.com/b20c791a83964075465ffd79d5cada7214fcc76d16847f643f09b3fa9a3456aa/687474703a2f2f706f7365722e707567782e6f72672f6b68616c6564616c616d2f626172642d73646b2d7068702f726571756972652f706870)](https://packagist.org/packages/khaledalam/bard-sdk-php)[![License](https://camo.githubusercontent.com/76f76621466275d55bc043e3b495813ae6f7a956b25912bc3693a7b59f149b50/68747470733a2f2f706f7365722e707567782e6f72672f6b68616c6564616c616d2f626172642d73646b2d7068702f6c6963656e73652e737667)](https://packagist.org/packages/khaledalam/bard-sdk-php)[![composer.lock available](https://camo.githubusercontent.com/8cc768a1dfb35e37bc7d4c0f4b0a628201c71298c9b660e71b019706b90391ea/68747470733a2f2f706f7365722e707567782e6f72672f6b68616c6564616c616d2f626172642d73646b2d7068702f636f6d706f7365726c6f636b)](https://packagist.org/packages/khaledalam/bard-sdk-php)[![workflows CI](https://github.com/khaledalam/bard-sdk-php/actions/workflows/ci.yml/badge.svg)](https://github.com/khaledalam/bard-sdk-php/actions/workflows/ci.yml/badge.svg)

Reverse engineering of Google's Bard chatbot.

Disclamer
---------

[](#disclamer)

- ApiKeyCookie.php implemented only for easing the access to Google Bard, any legal responsibilities lie with the user.
- Don't expose your `__Secure-1PSID` cookie value on the internet.

Install
-------

[](#install)

> $ composer require khaledalam/bard-sdk-php

Test
----

[](#test)

> $ composer run test

Auth
----

[](#auth)

1. Navigate to
2. Open "Developer Tools" from browser settings or click \[F12\] shortcut for console.
3. Go to Application tab =&gt; open "Cookies" from left tab =&gt; click "" =&gt; Copy the value of `__Secure-1PSID` cookie.
    [![](./get_cookie_value.png)](./get_cookie_value.png)

Simple Usage
------------

[](#simple-usage)

Change `_YOUR_COOKIE_VALUE_`

```
