Current URL To Download KML Data From Google Location History?
Asked Answered
A

5

20

I need to download google location history data in kml for a period of time.

Up until August 26, 2015, a URL in this format worked:

https://maps.google.com/locationhistory/b/0/kml?startTime=$start_seconds&endTime=$end_seconds  

Now a link in that format fails.

I suspect the problem is related to google changing the way its website displays location history, though that change happened nearly a month earlier on July 22.

A commenter on the google products forum suggested this:

[T]he KML generation can do multiple days, so just edit the URL

Eg https://www.google.com/maps/timeline/kml?authuser=0&pb=!1m8!1m3!1i2015!2i7!3i1!2m3!1i2015!2i7!3i8 gives 7 days.

Highlighting the parts of the date: pb=!1m8!1m3!1i2015!2i7!3i8!2m3!1i2015!2i7!3i8

Note the month is zero based, so one off normal, 0=Jan, 11=Dec

The commenter is wrong that the above link gives seven days. It appears to only give about three, but perhaps the commenter is on the right track.

I have tried different values for the fields in the commenter's URL that are not obvious date-related but have not been able to find a URL that returns a kml file with data for more that a few days.

I have several maps that use location history data, they are now all broken.

Edit: There's a similar question here: Extfiltrating Google Location History from Timeline

Apodal answered 1/9, 2015 at 13:26 Comment(1)
I'm trying to work out how to get a single day - the most recent - but I can only seem to get the last day in August. Very confusing!Pilkington
B
15

Go to https://takeout.google.com/settings/takeout and select only "Location History" with "KML format". Click "Next" and, then, "Create archive". After a while it will let you download a zip file with your (presumably entire) location history in KML format.

I tried and was able to download more than one year of my locations: I probably opted in the Location History service a little more than one year ago...

Bine answered 18/2, 2016 at 15:3 Comment(3)
Thanks, based on the timestamp and when I've enabled Google Location History, the data seem complete.Tertias
Update OCT 2016: On the page above I could only get JSON data for location history, but I could still access KML data here: takeout.google.com/settings/takeout/custom/…Tude
I am still given the option to download in KML format from the full Takeout link, although I have not verified that it works.Errhine
E
1

Undocumented changes to stable Google geo products are why I've been moving my personal and work projects from Google to open source products like Leaflet.

I've also been trying to figure how to get old-school location history kmls, but I'm not having any luck. The kml header information reflects that you have asked it to download a longer period of time, but it only actually includes placemarks for a few days.

A short term workaround is to download this app: https://play.google.com/store/apps/details?id=com.homedev.locationhistory

It's able to download 1-7 days of history, which you can then export as a kml. I'm not sure if the devs have cracked the url formatting or if they just loop through the short timespan data several times to make it look like it is downloading a week at a time.

Eleemosynary answered 1/9, 2015 at 18:57 Comment(0)
S
1

You could use the Timeline exporter Google Chrome plugin. It enables you to view, filter and export your Google timeline data for a selected time span.

Spectrohelioscope answered 6/1, 2021 at 18:50 Comment(0)
O
0

Looks like that the maximum date range is 5 days. If I request the bigger period it returns me kml without any coordinates. Is there any way to get the entire location history?

Obsess answered 3/9, 2015 at 13:17 Comment(2)
I believe you can download your entire history to google drive using google takeout -- not the same as a direct download url, but maybe it will work for you. Could you post the url you used that returned 5 days? The best I have done is to download parts of 3 days. Thanks.Apodal
I have checked and lookes like you're right: the most accurate data can be retrieved by downloding parts of 2-3 days. I hope this will not trigger Google to show us a captcha after retrieving whole location history this way :).Obsess
G
-1

If you need to process across a longer time span (several months or even years), check out Google Takeout Mileage & Timeline Exporter.

You'll need to go to Google's takeout and download your location data first. Once it's ready, Google will send you an email with a download link.

Select the date range and timezone and upload that zip file to the extension.

You can further filter by modes of transportation, starting point, and destination.

Gentry answered 22/12, 2021 at 0:47 Comment(2)
Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.Dobsonfly
While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From ReviewNigro

© 2022 - 2024 — McMap. All rights reserved.