{"id":13625057,"url":"https://github.com/alexattia/Maps-Location-History","last_synced_at":"2025-04-16T06:31:41.548Z","repository":{"id":119014738,"uuid":"88555430","full_name":"alexattia/Maps-Location-History","owner":"alexattia","description":"Get, Concatenate and Process you location history from Google Maps TimeLine","archived":false,"fork":false,"pushed_at":"2017-10-21T22:02:49.000Z","size":699,"stargazers_count":127,"open_issues_count":4,"forks_count":22,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-08-01T22:03:44.979Z","etag":null,"topics":["google-maps","location-history","pandas","python"],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alexattia.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-04-17T22:14:56.000Z","updated_at":"2024-07-31T16:00:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"ddee4fca-07d0-4a60-84c3-9ccfe0d305a9","html_url":"https://github.com/alexattia/Maps-Location-History","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexattia%2FMaps-Location-History","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexattia%2FMaps-Location-History/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexattia%2FMaps-Location-History/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexattia%2FMaps-Location-History/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexattia","download_url":"https://codeload.github.com/alexattia/Maps-Location-History/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223700208,"owners_count":17188267,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["google-maps","location-history","pandas","python"],"created_at":"2024-08-01T21:01:50.319Z","updated_at":"2024-11-08T14:30:22.420Z","avatar_url":"https://github.com/alexattia.png","language":"Jupyter Notebook","funding_links":[],"categories":["Jupyter Notebook"],"sub_categories":[],"readme":"# Maps-Location-History\nGet, Concatenate and Process you location history from Google Maps TimeLine\n\n## Introduction\nIf you have turned on the Google Maps location history, you probably now that Google save your location data and process it in order to create a timeline that you can find in the user interface : https://www.google.fr/maps/timeline.  \nMaps is using raw data (multiple points saved per minutes) and is projecting it on roads, places, etc.  \nYou can easily export all of the raw data saved by Maps or you can export one day to KML but it's impossible to export all of the processed data from the user interface.  \nIn this project, I export multiple days (months actually) to KML, then process it in order to convert it into a pandas DataFrame. I am still working on data vizualtion and statistics with this data.  \n\n## Get cookie_content to export locatin history\nIn order to export processed data from Google Maps website from a python script, you need to get your actual cookie.\n1. Go to https://www.google.fr/maps/timeline\n2. Inspect the page and go to the Network tab\n3. Enter this link https://www.google.fr/maps/timeline/kml?authuser=0\u0026pb=!1m8!1m3!1i2017!2i3!3i16!2m3!1i2017!2i3!3i16 (or another date)\n4. Save this element as a cURL\n5. Open the cURL in a text editor\n\n![Explanations Image](https://github.com/alexattia/Maps-Location-History/blob/master/saved_as_curl.png)\n\nYou should get something like this:\n```\ncurl 'https://www.google.com/maps/timeline/kml?authuser=0\u0026pb=!1m8!1m3!1i2017!2i3!3i16!2m3!1i2017!2i3!3i16'   \n-H 'accept-encoding: gzip, deflate, sdch, br'   \n-H 'accept-language: en-US,en;q=0.8,fr;q=0.6'   \n-H 'upgrade-insecure-requests: 1'   \n-H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) '   \n-H 'x-chrome-uma-enabled: 1'   \n-H 'accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8' \n-H 'authority: www.google.com'   \n-H '**cookie**: gsScrollPos=; _ga=GA1.1.49937635TxMcGmJ-uXXXXX gsScrollPos='  \n-H 'x-client-data: XXXQ==' --compressed \n```\n6. Save the cookie content\n\n## Code explanations\n\n1. Export and Save KML files\nChoose a folder where you want to save the KML files.  \nPass the folder path, the cookie content and the days you want to save to the function :\n`process_location.create_kml_files(begin_month, begin_day, end_month, end_day, cookie_content, folder)`\n\n2. Create a dataframe\nPass the folder path where your files are saved to `df = process_location.full_df(folder)` to get a well formated dataframe.\n\n3. Data Visualization, Stats\nUse the Jupyter notebook to see my data visualization and stats (time driving, at work, etc.)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexattia%2FMaps-Location-History","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexattia%2FMaps-Location-History","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexattia%2FMaps-Location-History/lists"}