--- id: glocaltokens version: "0.7.6" license: MIT license_treatment: permissive maintenance: active --- # glocaltokens — Tool to extract Google device local authentication tokens in Python License: permissive · Maintenance: active · Downloads: 173.9K/mo ## What it is and what it does glocaltokens is a Python library that retrieves short-lived local authentication tokens for Google Home devices by exchanging Google account credentials with Google's servers. These tokens enable direct local-network communication with Google Home devices via their undocumented local API, bypassing the cloud. The package handles the OAuth-like flow to obtain master tokens (valid for extended periods) and access tokens (valid 1 hour), then uses those to fetch device-specific local tokens (valid about 1 day). It includes device discovery via zeroconf and supports filtering by device model. The documentation emphasizes storing master tokens rather than credentials, and warns against frequent re-authentication to avoid account lockouts. Use it for: - Build local-network home automation that controls Google Home devices without cloud dependency - Extract and cache device tokens for periodic refresh in a long-running home assistant daemon - Discover Google Home devices on the network and retrieve their local API endpoints - Integrate Google Home control into a custom smart-home system using the local API - Monitor or control timers and alarms on Google Home devices via direct local calls ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Extracts local authentication tokens from Google Home devices by authenticating with Google servers, enabling direct local control of Google Home devices via their local API. Yes, if you need local control of Google Home devices and are comfortable with the token refresh lifecycle. The package is actively maintained, has no known vulnerabilities, and uses a permissive MIT license. Install friction is low. Main gotchas: tokens expire daily, re-authentication is rate-limited by Google, and the local API is undocumented. Suitable for home automation and local-network integrations. ## Install pip install glocaltokens uv add glocaltokens poetry add glocaltokens ## Installing glocaltokens Before you install: Low install friction with a pure-Python wheel distribution. Actively maintained as of 2026-08-03 with 60 repository stars. Depends on six runtime packages including grpcio and zeroconf for device discovery and authentication. License in practice: MIT license permits commercial and private use with minimal restrictions; you may use, modify, and distribute the package freely provided you include the license notice. Quickstart: pip install glocaltokens from glocaltokens.client import GLocalAuthenticationTokens client = GLocalAuthenticationTokens( username="your_google_email", password="your_google_password" ) master_token = client.get_master_token() google_devices = client.get_google_devices_json() Requires Python 3.9 or later. Google credentials must be provided; calling the authentication method too frequently may cause Google to disconnect associated Android devices. Verify before relying: - Whether the package handles two-factor authentication or app passwords for Google accounts - How token refresh is managed when the 1-day expiration window approaches - Whether device discovery works reliably across different network configurations ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 173.9K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags google home local authentication, extract google device tokens, google home api tokens, local google home control, google device authentication, google home device discovery, google home token management, home-automation, google-home, local-api [View on SkillFed](https://skillfed.io/packages/glocaltokens) · [View on PyPI](https://pypi.org/project/glocaltokens/)