Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

takeout-sync

Export your Google Maps favorites and saved lists ("Want to go", custom lists) programmatically — no Google Takeout web interface, no waiting for export emails. Uses Google's Data Portability API, the API Google built under the EU Digital Markets Act.

With a one-time consent (valid up to 180 days), you can re-export your data every 24 hours. That makes it suitable for keeping a local, always-current copy of your Maps data via cron.

Maps favorites are just this repo's use case. The same API serves 73 resource groups — YouTube (playlists, subscriptions, comments), Search history, Chrome (bookmarks, history), Play, Shopping, reviews, photos, and more. To export something else, add the matching scopes in your Google Cloud consent screen and edit RESOURCES at the top of the script; nothing else changes. What it cannot do: Gmail, Drive, Google Photos, Calendar, and Location History/Timeline are not part of this API — for those, classic Takeout remains the only path.

Who can use this

  • Your Google account must be located in the EU/EEA, Switzerland, or the UK. The API is not available elsewhere. Workspace-managed accounts, accounts of under-18s, and Advanced Protection accounts are excluded.
  • You run this as your own private tool under your own Google Cloud project, in OAuth "testing" mode. No app verification is needed for personal use (verified working, July 2026).

Setup (one time, ~10 minutes)

  1. Go to console.cloud.google.com and create a new project (any name).
  2. Link a billing account to the project. The API requires billing to be enabled; this usage has no cost.
  3. APIs & Services → Library → search "Data Portability API" → Enable.
  4. APIs & Services → OAuth consent screen (or "Google Auth Platform"): choose External, fill in the app name and your email, keep publishing status Testing, and add your own Google address as a test user. Add the scopes dataportability.maps.starred_places and dataportability.saved.collections.
  5. Credentials (or Google Auth Platform → Clients) → Create OAuth client ID → type Desktop app → download the JSON and save it as client_secret.json next to the script.

Then install the two dependencies and run:

python3 -m venv .venv
./.venv/bin/pip install -r requirements.txt
./.venv/bin/python takeout_sync.py

A browser opens for consent. You will see an "unverified app" warning — that is your own testing-mode app; continue via "Advanced". When Google asks for a duration, choose 180 days to unlock repeated exports.

What happens

  1. The script asks Google to prepare an export of your starred places and saved collections.
  2. It polls until the export is ready (typically minutes to a few hours; Google allows up to days).
  3. It downloads the archives to exports/ as zip files. Saved collections arrive as one CSV per list (Title, Note, URL, Tags, Comment — the URL carries the stable Maps place identifier). Starred places arrive as GeoJSON with coordinates, address, the date you starred each place, and the place's Maps URL.

Your login is cached in token.json, so later runs skip the browser. If the script is interrupted while jobs are pending, resume with the job IDs it printed:

./.venv/bin/python takeout_sync.py maps.starred_places=<job_id> saved.collections=<job_id>

Constraints (Google's, not this script's)

  • One export per resource per 24 hours during your consent window; the window is 30 or 180 days, chosen at consent.
  • Download links are valid for 6 hours after the job completes; the archive itself for 14 days. The script downloads immediately, so this rarely matters.
  • Location History / Timeline is not available through this API (that data moved on-device in 2024).
  • Exports are full snapshots, not diffs. If you want change detection, compare snapshots yourself.

The full list of exportable resource groups is in the API reference.

Security

client_secret.json, token.json, and everything under exports/ are your credentials and your personal data. They stay on your machine and are excluded from git via .gitignore. Do not share them.

About

No description, website, or topics provided.

Resources

Stars

6 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages