Edit: This doesn't work for lists > 20 items, because pagination does not work. Please see here
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
How to use this script:
- 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=....
- Take the
data
-portion and paste it into the following link:https://google.com/maps/@/data=<data>?ucbcb=1
- Take this link and paste it into the py-script below.
Complementing Ac2zoom and updating for 2025, I implemented this regex solution:
results = re.findall(r'\[null,null,(-?[0-9]+\.[0-9]+),(-?[0-9]+\.[0-9]+)\]', txt)
This matches current Google Maps data format and returns coordinates directly as tuples.Thanks again ByteSizedMarius for writing the StackOverflow answer