Skip to main content

Google Maps location share API

A fully asynchronous API client for Google Map's location share functionality.

Install

You must install the following libraries:

  • aiohttp (asynchronous HTTP)
  • playwright (asynchronous webdriver)
  • undetected-playwright-patch (Bypass Google's bot detection)
  • pickle (session persistence)

It is recommended to install the following libraries:

  • asyncio (Running asynchronous code)

Run pip install gmaps-locationshare-api to install.

How it works

Playwright obtains a session via a manual log-in attempt by the user. The client also has the ability to persist a session between different instances by locally caching session cookies, and session refresh capabilities.

The client then uses said session to call Google's internal location share API to obtain relevant data.

Documentation

Sample usages are in main.py

class Client(persist: bool = False, persist_directory: str = None, timeout: int = 30000)

  • persist: Whether or not the session is locally cached to be used by subsequent invocation of Client in the same or a different program instance.
  • persist_directory: Cache location. Note that the cache location must be consistent for all clients that wishes to use the cached session.
  • timeout: Max allowed time to login before browser timeouts (in milliseconds)

Client.refresh_session(): Refresh session cookies to prevent stale sessions.

Client.get_data() -> [Person]: Get current location share data. Each call represent one reading at the current time, it doesn't not contain historical readings.

Relevant type definitions are in gmaps_locationshare_api/types.py

Release files for gmaps-locationshare-api 1.0.2

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

Source distribution (sdist)

Source distribution for gmaps-locationshare-api 1.0.2
File Size Uploaded
gmaps_locationshare_api-1.0.2.tar.gz 4.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gmaps-locationshare-api 1.0.2
File Interpreter ABI Platform
gmaps_locationshare_api-1.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 9.1 kB

Release files / gmaps_locationshare_api-1.0.2.tar.gz

Download URL gmaps_locationshare_api-1.0.2.tar.gz
Size 4.2 kB
Tags Source
SHA-256 checksum
How to use checksums
f164cb8b514547f842e6033390f9889b05a4ca1caca9c93c3428be9fe4dd4564
BLAKE2b-256 checksum
How to use checksums
cd29a0ac14eb03207996d0a1dba532005acd77b8440509936ea63d42dd8fb72b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.6

Release files / gmaps_locationshare_api-1.0.2-py3-none-any.whl

Download URL gmaps_locationshare_api-1.0.2-py3-none-any.whl
Size 4.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
769d834c0e391c8711c72de6a4ae9fa980460444b619173c4a7dc52112ae3718
BLAKE2b-256 checksum
How to use checksums
4f5d8ee3af80abd4765aa67434c112c898dfc2c2dec8a8f294ac381ff78d3bf8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.6

Release history Release notifications | RSS feed

This release

1.0.2 This release

2 release files

1.0.1

2 release files

1.0.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