Skip to main content

Gemini-WebCookie

A powerful and flexible library for interacting with Google Gemini Web, supporting both Cookie-based and Anonymous (No-Cookie) modes.

Highlights (From Version 0.1.4)

Starting from version 0.1.4, Gemini-WebCookie is no longer just a replacement for Gemini-WebAPI but has evolved with powerful independent features:

  • Anonymous Mode: Operates completely without cookies (__Secure-1PSID).
  • Context Preservation: Automatically manages chat history (CID, RID, RCID) even in anonymous mode.
  • Background Auto-Refresh: System automatically updates tokens and maintains sessions in the background.
  • Full Feature Support: Chat, Image Generation, Gems Management, and File Uploads.

Installation

pip install gemini-webcookie

Usage

1. Anonymous Mode (No Cookies Required)

This is a major feature that goes beyond standard Gemini wrappers:

import asyncio
from gemini_webcookie import GeminiClient

async def main():
    # Initialize without parameters for anonymous mode
    client = GeminiClient()
    await client.init()
    
    chat = client.start_chat()
    response = await chat.send_message("Hello, who are you?")
    print(f"AI: {response.text}")
    
    # Context is automatically preserved for the next question
    response2 = await chat.send_message("What can you help me with?")
    print(f"AI: {response2.text}")

    await client.close()

asyncio.run(main())

2. Cookie-based Mode (Full Features)

from gemini_webcookie import GeminiClient

client = GeminiClient(
    secure_1psid="YOUR_1PSID",
    secure_1psidts="YOUR_1PSIDTS"
)

License

This project is dual-licensed under the MIT License and the Apache License 2.0. You may choose either license according to your needs.

Metadata

Release files for gemini-webcookie 0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gemini-webcookie 0.1.5
File Size Uploaded
gemini_webcookie-0.1.5.tar.gz 17.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gemini-webcookie 0.1.5
File Interpreter ABI Platform
gemini_webcookie-0.1.5-py3-none-any.whl Python 3 none any Details

Total release size: 34.7 kB

Release files / gemini_webcookie-0.1.5.tar.gz

Download URL gemini_webcookie-0.1.5.tar.gz
Size 17.1 kB
Tags Source
SHA-256 checksum
How to use checksums
c189a20ac86f465187361ecbccc0acc017c9fe48b4f3f2c5385d21d59cca6d63
BLAKE2b-256 checksum
How to use checksums
4c3bd6981a4526f771808e1192f70c21aabcb68c393112886bf54f822052ff80
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.7

Release files / gemini_webcookie-0.1.5-py3-none-any.whl

Download URL gemini_webcookie-0.1.5-py3-none-any.whl
Size 17.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
38f0c891deb88c1e28652f9fc79d7db1281e1b114fdc01fd93bb774e91ede3c0
BLAKE2b-256 checksum
How to use checksums
01aaa6cd44979ea8dec3efd48bd2caebd37ec606474073a7ac01398538f379a5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.7

Release history Release notifications | RSS feed

This release

0.1.5 This release

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page