Skip to content

Instantly share code, notes, and snippets.

@ByteSizedMarius
Last active November 4, 2025 21:33
Show Gist options
  • Select an option

  • Save ByteSizedMarius/8c9df821ebb69b07f2d82de01e68387d to your computer and use it in GitHub Desktop.

Select an option

Save ByteSizedMarius/8c9df821ebb69b07f2d82de01e68387d to your computer and use it in GitHub Desktop.

Revisions

  1. ByteSizedMarius revised this gist Jul 22, 2022. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions ExtractSavedPlacesGMaps.md
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,5 @@
    > Edit: This doesn't work for lists > 20 items, because pagination does not work. Please see [here](https://stackoverflow.com/questions/50964713/obtain-list-of-my-places-from-google-maps/73085314#73085314)
    This script allows extracting name and coordinates for gmaps shared lists. It is incredibly unstable and may break anytime. Good luck figuring out why, because the syntax is extremely confusing and basically makes no sense at all. Thanks to google for not providing an api for this after [LITERALLY 12 YEARS](https://issuetracker.google.com/issues/35820262)

    **How to use this script:**
  2. ByteSizedMarius revised this gist Jul 21, 2022. 1 changed file with 0 additions and 2 deletions.
    2 changes: 0 additions & 2 deletions extract.py
    Original file line number Diff line number Diff line change
    @@ -2,8 +2,6 @@
    import re
    import requests

    s = requests.Session

    x: requests.Response = requests.get(PASTE LINK HERE)
    txt = x.text.split(r")]}'\n")[2].split("]]\"],")[0] + "]]"
    txt = html.unescape(txt)
  3. ByteSizedMarius renamed this gist Jul 21, 2022. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  4. ByteSizedMarius created this gist Jul 21, 2022.
    9 changes: 9 additions & 0 deletions Instructions.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    This script allows extracting name and coordinates for gmaps shared lists. It is incredibly unstable and may break anytime. Good luck figuring out why, because the syntax is extremely confusing and basically makes no sense at all. Thanks to google for not providing an api for this after [LITERALLY 12 YEARS](https://issuetracker.google.com/issues/35820262)

    **How to use this script:**

    1. Share a list and open the link in a browser window. It will redirect. The new link will look like this:
    `google.com/maps/@<your coords>/data=....`
    2. Take the `data`-portion and paste it into the following link:
    `https://google.com/maps/@/data=<data>?ucbcb=1`
    3. Take this link and paste it into the py-script below.
    22 changes: 22 additions & 0 deletions extract.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,22 @@
    import html
    import re
    import requests

    s = requests.Session

    x: requests.Response = requests.get(PASTE LINK HERE)
    txt = x.text.split(r")]}'\n")[2].split("]]\"],")[0] + "]]"
    txt = html.unescape(txt)

    results = re.findall(r"\[null,null,[0-9]{1,2}\.[0-9]{4,15},[0-9]{1,2}\.[0-9]{4,15}]", txt)

    for cord in results:
    curr = txt.split(cord)[1].split("\\\"]]")[0]
    curr = curr[curr.rindex("\\\"") + 2:]

    cords = str(cord).split(",")
    lat = cords[2]
    lon = cords[3][:-1]

    print("Name: " + curr)
    print("Coords: " + lat + ", " + lon + "\n")