glocaltokens
Tool to extract Google device local authentication tokens in Python
Decision gist · record as of 2026-08-14
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.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- 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.
- Low install friction with a pure-Python wheel distribution.
License · maintenance · safety
MIT (permissive) — 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.
last release 2025-07-04 (406 days) · last repo commit 2026-08-03 · 60 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 173,852 downloads/mo, #10,297 on PyPI
Alternatives
Verify before relying
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()- 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
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 on this page. Verify before relying on it.
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
glocaltokens on PyPI
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.
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.
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()
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 the current Python release >=3.9 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 6 packagesghome-foyer-apigpsoauthgrpciorequestssimplejsonzeroconf |
| Maintenance | Actively maintained 406 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 173,852 / month, #10,297 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.9Topic :: Software DevelopmentTyping :: Typed |
Evidence: glocaltokens-0.7.6-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “google home local authentication”
- glocaltokensExtracts local authentication tokens from Google Home devices by…
- ghome-foyer-apiProvides generated Protobuf stubs for the Google Home Foyer API,…
- hass-nabucasahass-nabucasa is a Python library that provides Home Assistant with…
Give your agent the search over MCP, or paste the wish link into any chat.
More Software Development packages
Provides backported and experimental type hints for Python 3.9+, allowing use of newer typing features on older Python versions and enabling early experimentation with type system PEPs before they enter the standard library.
NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.
FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.
Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.
Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.
Install it if you are building CLIs in Python.
Distlib provides low-level packaging utilities for building, distributing, and managing Python software—including metadata handling, version specifiers, wheel support, script installation, and dependency resolution.
See also gpsoauth · broadlink · micloud · gkeepapi · google-nest-sdm · ghome-foyer-api · tinytuya · homeassistant · pyhiveapi · fastapi-cloudauth