{"id":37064909,"url":"https://github.com/rekcah-pavi/geminikit","last_synced_at":"2026-01-14T07:35:34.600Z","repository":{"id":249470707,"uuid":"831619356","full_name":"rekcah-pavi/geminikit","owner":"rekcah-pavi","description":"The unofficial Python package that returns the response from Google Gemini using a cookie value, using reverse engineering. Demo: https://t.me/bard_kpbot/","archived":false,"fork":false,"pushed_at":"2024-10-05T02:58:58.000Z","size":2732,"stargazers_count":30,"open_issues_count":0,"forks_count":7,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-28T14:35:23.159Z","etag":null,"topics":["api","bard","bard-api","gemini","gemini-api","google-bard","google-bard-api","google-gemini","google-gemini-ai"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/geminikit/","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/rekcah-pavi.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-21T05:42:47.000Z","updated_at":"2025-07-13T23:33:05.000Z","dependencies_parsed_at":"2024-07-28T04:32:35.345Z","dependency_job_id":null,"html_url":"https://github.com/rekcah-pavi/geminikit","commit_stats":null,"previous_names":["rekcah-pavi/geminikit"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rekcah-pavi/geminikit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rekcah-pavi%2Fgeminikit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rekcah-pavi%2Fgeminikit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rekcah-pavi%2Fgeminikit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rekcah-pavi%2Fgeminikit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rekcah-pavi","download_url":"https://codeload.github.com/rekcah-pavi/geminikit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rekcah-pavi%2Fgeminikit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28413431,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T05:26:33.345Z","status":"ssl_error","status_checked_at":"2026-01-14T05:21:57.251Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["api","bard","bard-api","gemini","gemini-api","google-bard","google-bard-api","google-gemini","google-gemini-ai"],"created_at":"2026-01-14T07:35:33.980Z","updated_at":"2026-01-14T07:35:34.589Z","avatar_url":"https://github.com/rekcah-pavi.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# \u003cimg src=\"https://www.gstatic.com/lamda/images/gemini_sparkle_v002_d4735304ff6292a690345.svg\" width=\"35px\" alt=\"Gemini Icon\" /\u003e GeminiKit\n\n**GeminiKit** is an unofficial Python wrapper developed through reverse-engineering. This tool utilizes cookie values to interact with Google Gemini for testing purposes.\n\n\u003cbr\u003e\n\n## Installation\n\nTo install GeminiKit, you can use pip:\n\n```bash\npip install -U geminikit\n```\nor\n\n```bash\npip install git+https://github.com/rekcah-pavi/geminikit\n```\n\n***\n ## Get Cookie File (chrome-net-export-log)\n\u003cdetails\u003e\n \n\nFor a detailed video guide, [click here](https://youtu.be/IUCJg2KWcJs).\n\n### 1. Close All Tabs\n\nEnsure all tabs are closed in Google Chrome.\n\n### 2. Access Network Export\n\n- Open a new tab and navigate to `chrome://net-export/`.\n\n### 3. Configure Logging Settings\n\n- Check the box labeled `Include cookies and credentials`.\n- Set the `Maximum log size` to `1 MB`.\n- Click the `Start logging` button.\n\n### 4. Perform Actions\n\n- Open a new tab and go to [gemini.google.com](https://gemini.google.com).\n- Log in to your Gemini account.\n- Send a sample message and wait for Gemini's response.\n\n### 5. Stop Logging\n\n- Return to the logging tab and click the `Stop logging` button.\n\n### 6. Retrieve Cookies\n\n- The cookies will be saved in a JSON file.\n\n### 7. Extract Cookies from File\n\n```python\nfrom geminikit import get_cookies_from_file\n\nwith open(\"chrome-net-export-log.json\", 'r') as f:\n    cookies = get_cookies_from_file(f.read())\n\nprint(cookies)\n```\n\n\u003c/details\u003e\n\n***\n\n## Usage\n\n### Setup Gemini\n\n\u003cdetails open\u003e\n  \u003csummary\u003eSync\u003c/summary\u003e\n\n  ```python\n  from geminikit import get_cookies_from_file\n  from geminikit import Gemini\n\n  with open(\"chrome-net-export-log.json\", 'r') as f:\n      cookies = get_cookies_from_file(f.read())\n\n  gemini = Gemini(cookies)\n```\n\u003c/details\u003e\n\n\n\u003cdetails\u003e\n  \u003csummary\u003eAsync\u003c/summary\u003e\n \n```python\nfrom geminikit import get_cookies_from_file\nfrom geminikit import Asynic_Gemini as Gemini\n\nimport asyncio\nimport aiofiles #pip install aiofiles\n\nasync def main():\n    async with aiofiles.open(\"chrome-net-export-log.json\", mode='r') as f:\n        cookies = get_cookies_from_file(await f.read())\n\n    gemini = await Gemini.create(cookies)\n\nasyncio.run(main())\n```\n\u003c/details\u003e\n\n\n\n### Ask a Message\n\n\n\u003cdetails open\u003e\n  \u003csummary\u003eSync\u003c/summary\u003e\n\n  ```python\nres = gemini.ask(\"hello\")\nprint(res['text'])\n```\n\u003c/details\u003e\n\n\n\u003cdetails\u003e\n  \u003csummary\u003eAsync\u003c/summary\u003e\n \n```python\nres = await gemini.ask(\"hello\")\nprint(res['text'])\n```\n\u003c/details\u003e\n\n\n\n### Ask continuous message\n\u003cdetails open\u003e\n  \u003csummary\u003eSync\u003c/summary\u003e\n\n  ```python\n\n response = gemini.ask(\"tell me a joke\")\n print(res['text'])\n #user value must be a dictionary containing SNlM0e, conversation_id, response_id, choice_id (available inside the response dictionary)\n res = gemini.ask(\"another one\",user=response)\n print(res['text'])\n```\n\u003c/details\u003e\n\n\n\u003cdetails\u003e\n  \u003csummary\u003eAsync\u003c/summary\u003e\n \n```python\n response = await gemini.ask(\"tell me a joke\")\n print(res['text'])\n #user value must be a dictionary containing SNlM0e, conversation_id, response_id, choice_id (available inside the response dictionary)\n res = await gemini.ask(\"another one\",user=response)\n print(res['text'])\n ```\n\u003c/details\u003e\n\n\n\n\n### Text to Voice\n\n\u003cdetails open\u003e\n  \u003csummary\u003eSync\u003c/summary\u003e\n\n  ```python\nres = gemini.speech(\"hello\")\n#res = gemini.speech(\"hello\", lang_code=\"en\")\nwith open(\"a.wav\", \"wb\") as f:\n    f.write(res)\n```\n\u003c/details\u003e\n\n\n\u003cdetails\u003e\n  \u003csummary\u003eAsync\u003c/summary\u003e\n \n```python\nimport aiofiles #pip install aiofiles\nres = await gemini.speech(\"hello\")\n#res = gemini.speech(\"hello\", lang_code=\"en\")\nasync with aiofiles.open(\"a.wav\", mode='wb') as f:\n        await f.write(res)\n```\n\u003c/details\u003e\n\n\n\n### Ask with Photo\n\n\u003cdetails open\u003e\n  \u003csummary\u003eSync\u003c/summary\u003e\n\n  ```python\nwith open(\"cat.jpg\", \"rb\") as f:\n    img_link = gemini.upload_image(f.read())\n\nphoto = ['cat.jpg', img_link]  # photo name (if not available, use 'none.jpg'), link\n\nres = gemini.ask(\"What is in this photo?\", photo=photo)\nprint(res['text'])\n```\n\u003c/details\u003e\n\n\n\u003cdetails\u003e\n  \u003csummary\u003eAsync\u003c/summary\u003e\n \n```python\nimport aiofiles #pip install aiofiles\n\nasync with aiofiles.open(\"cat.jpg\", mode='rb') as f:\n        img_data = await f.read()\n        img_link = await gemini.upload_image(img_data)\n\nphoto = ['cat.jpg', img_link]  # photo name (if not available, use 'none.jpg'), link\n\nres = await gemini.ask(\"What is in this photo?\", photo=photo)\nprint(res['text'])\n\n\n```\n\u003c/details\u003e\n\n\n\n\n\n### Save Response Images\n\n\u003cdetails open\u003e\n  \u003csummary\u003eSync\u003c/summary\u003e\n\n  ```python\nres = gemini.ask(\"send me some wallpapers\")\n\nprint(res['text'])\n\n#Or You can access URLs directly\nfor url in res['image_urls']:\n    img_name  = url.split(\"/\")[-1]\n    img_bytes = gemini.get_img_bytes(url)\n    with open(img_name, 'wb') as f:\n        f.write(img_bytes)\n```\n\u003c/details\u003e\n\n\n\u003cdetails\u003e\n  \u003csummary\u003eAsync\u003c/summary\u003e\n \n```python\nimport aiofiles #pip install aiofiles\n\n\nres = await gemini.ask(\"send me some wallpapers\")\n\nprint(res['text'])\n\n#Or You can access URLs directly\nfor url in res['image_urls']:\n    img_name  = url.split(\"/\")[-1]\n    img_bytes = await gemini.get_img_bytes(url)\n    async with aiofiles.open(img_name, mode='wb') as f:\n        await f.write(img_bytes)\n\n```\n\u003c/details\u003e\n\n\n\n\n\n\n### Save Generated Images\n\n\u003cdetails open\u003e\n  \u003csummary\u003eSync\u003c/summary\u003e\n\n  ```python\nres = gemini.ask(\"Generate an image of a cat holding a rose.\")\n\nprint(res['text'])\n\nfor url in res['generated_image_urls']:\n    img_name  = url.split(\"/\")[-1][:10] + \".png\"\n    img_bytes = gemini.get_img_bytes(url)\n    with open(img_name, 'wb') as f:\n        f.write(img_bytes)\n```\n\u003c/details\u003e\n\n\n\u003cdetails\u003e\n  \u003csummary\u003eAsync\u003c/summary\u003e\n \n```python\nimport aiofiles #pip install aiofiles\n\nres = await gemini.ask(\"Generate an image of a cat holding a rose.\")\n\nprint(res['text'])\n\nfor url in res['generated_image_urls']:\n    img_name  = url.split(\"/\")[-1][:10] + \".png\"\n    img_bytes = await gemini.get_img_bytes(url)\n\n    async with aiofiles.open(img_name, mode='wb') as f:\n        await f.write(img_bytes)\n\n```\n\u003c/details\u003e\n\n\n\n\n### Get Sharable URL\n\n\u003cdetails open\u003e\n  \u003csummary\u003eSync\u003c/summary\u003e\n\n  ```python\nres = gemini.ask(\"Hi\")\nurl = gemini.share(res['conversation_id'], res['response_id'], res['choice_id'], res['req_id'], res['fsid'], title=\"test by me\")\nprint(url)\n```\n\u003c/details\u003e\n\n\n\u003cdetails\u003e\n  \u003csummary\u003eAsync\u003c/summary\u003e\n \n```python\nres = await gemini.ask(\"Hi\")\nurl = await gemini.share(res['conversation_id'], res['response_id'], res['choice_id'], res['req_id'], res['fsid'], title=\"test by me\")\nprint(url)\n```\n\u003c/details\u003e\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frekcah-pavi%2Fgeminikit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frekcah-pavi%2Fgeminikit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frekcah-pavi%2Fgeminikit/lists"}