{"id":24393041,"url":"https://github.com/bernsteining/instaloctrack","last_synced_at":"2025-09-30T00:30:43.419Z","repository":{"id":37729220,"uuid":"233404321","full_name":"bernsteining/instaloctrack","owner":"bernsteining","description":"An Instagram OSINT tool to collect all the geotagged locations available on an Instagram profile in order to plot them on a map, and dump them in a JSON.","archived":false,"fork":false,"pushed_at":"2020-08-03T02:01:58.000Z","size":13,"stargazers_count":257,"open_issues_count":5,"forks_count":60,"subscribers_count":10,"default_branch":"master","last_synced_at":"2023-11-07T18:16:01.172Z","etag":null,"topics":["geolocation","instagram","map","osint","scraper","selenium","socmint"],"latest_commit_sha":null,"homepage":"","language":"Python","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/bernsteining.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}},"created_at":"2020-01-12T14:22:14.000Z","updated_at":"2023-10-25T16:58:14.000Z","dependencies_parsed_at":"2022-09-01T07:51:35.253Z","dependency_job_id":null,"html_url":"https://github.com/bernsteining/instaloctrack","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bernsteining%2Finstaloctrack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bernsteining%2Finstaloctrack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bernsteining%2Finstaloctrack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bernsteining%2Finstaloctrack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bernsteining","download_url":"https://codeload.github.com/bernsteining/instaloctrack/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234677950,"owners_count":18870355,"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":["geolocation","instagram","map","osint","scraper","selenium","socmint"],"created_at":"2025-01-19T18:01:35.840Z","updated_at":"2025-09-30T00:30:42.754Z","avatar_url":"https://github.com/bernsteining.png","language":"Python","funding_links":[],"categories":["1. [↑](#-content) OSINT"],"sub_categories":[],"readme":"# instaloctrack\n\n\nTL;DR : [ascineema](https://asciinema.org/a/IeWgAH6UuxPokyGxp8uUl1Xw3), [video of the project](https://www.youtube.com/watch?v=XVouSOwRDGE)\n\nA tool to scrape geotagged locations on Instagram profiles. Output in JSON \u0026 interactive map.\n\n\n## requirements\n\n```\nsudo apt install chromium-chromedriver \u0026\u0026 chmod a+x /usr/bin/chromedriver\n```\n## 🛠️ installation\n\n```\ngit clone https://github.com/bernsteining/instaloctrack\ncd instaloctrack\npip3 install .\n```\n\nOr use Docker:\n\n```\nsudo docker build -t instaloctrack -f Dockerfile .\n```\n\n## Usage\n\n    instaloctrack -h\n    usage: instaloctrack [-h] [-t TARGET_ACCOUNT] [-l LOGIN] [-p PASSWORD] [-v]\n\n    Instagram location data gathering tool. Usage: python3 instaloctrack.py -t \u003ctarget_account\u003e\n\n    optional arguments:\n      -h, --help            show this help message and exit\n      -t TARGET_ACCOUNT, --target TARGET_ACCOUNT\n                            Instagram profile to investigate\n      -l LOGIN, --login LOGIN\n                            Instagram profile to connect to, in order to access\n                            the instagram posts of the target account\n      -p PASSWORD, --password PASSWORD\n                            Password of the Instagram profile to connect to\n      -v, --visual          Spawns Chromium GUI, otherwise Chromium is headless\n\ne.g.\n\n```\ninstaloctrack -t \u003ctarget_account\u003e\n```\n\nIf the target profile is private and you have an account following the target profile you can scrape the data with a connected session:\n\n\n```\ninstaloctrack -t \u003ctarget_account\u003e -l \u003cyour_account\u003e -p \u003cyour_password\u003e\n```\n\nor with Docker:\n\n```\nsudo docker run -v /tmp/output:/tmp/output instaloctrack -t \u003ctarget_account\u003e -o /tmp/output\n```\n\n## ⚙️ How it works\n\nFirst, we retrieve all the pictures links of the account by scrolling the whole Instagram profile, thanks to selenium's webdriver.\n\nThen, we retrieve asynchronously (asyncio) each picture link, we check if it contains a location in the picture description, and retrieve the location's data if there's one, and the timestamp.\n\n* **NB:** Since 2018 Instagram deprecated its location API and it's not possible anymore to get the GPS coordinates of a picture, all we can retrieve is the name of the location. (If you can prove me that I'm wrong about this, please tell me!)\n\nBecause Instagram doesn't provide GPS coordinates, and we're only given names of places, we have to geocode these (.ie. get the GPS coords from the name's place).\n\nFor this, I used Nominatim's awesome API, which uses OpenStreetMap. For our usage, no API key is required, and we respect [Nominatim's usage Policy](https://operations.osmfoundation.org/policies/nominatim/) by requesting GPS coordinatess once every second.\n\nEventually, once we have all the GPS coordinatess, we generate a HTML (thanks to jinja2 templating) with Javascript embedded that plots an Open Street Map (thanks to [Leaflet](https://github.com/Leaflet/Leaflet) library) with all our locations pinned. Once again, no API key is required for this step.\n\nAlso, the data collected by the script (location names, timestamps, GPS coordinates, errors) are dumped to a JSON file in order to be re-used.\n\n## Example\n\nAs an example, here's the output on the former French President's Instagram profile, [@fhollande](https://www.instagram.com/fhollande/?hl=fr):\n\n![Map of @fhollande's locations on Instagram](https://i.imgur.com/LPulybM.png)\n\nThe Heatmap:\n\n![Heatmap of @fhollande's locations on Instagram](https://i.imgur.com/OBrTTdp.png)\n\nInformation available when clicking on a marker:\n\n![available data when clicking on a marker](https://imgur.com/QBIofFs.png)\n\nStats about the location data:\n\n![stats about the location data](https://imgur.com/rraBZ1n.png)\n\nThe JSON data dump (just a part of it to show the format for a given location):\n\n    {\n        \"link\": \"https://www.instagram.com/p/-Q_9EvR9eu\",\n        \"place\": {\n          \"id\": \"290297\",\n          \"name\": \"Musée du quai Branly - Jacques Chirac\",\n          \"slug\": \"musee-du-quai-branly-jacques-chirac\",\n          \"street_address\": \" 37 quai Branly\",\n          \" zip_code\": \" 75007\",\n          \" city_name\": \" Paris\",\n          \" region_name\": \" \",\n          \" country_code\": \" FR\"\n        },\n        \"timestamp\": \"2015-11-19\",\n        \"gps\": {\n          \"lat\": \"48.8566969\",\n          \"lon\": \"2.3514616\"\n        }\n      }\n\n\n\n\n## Possible Improvements\n\n* Cleaner code :D\n* Factorize the geocoding function which is waaay too long and cryptic\n* Use beautifulsoup instead of regex parsing\n* Remove weird blank space caused by progress bar\n* Use other geocoding tools (e.g. https://geo.api.gouv.fr/adresse) than Nominatim when it fails? (specify arg?)\n\t* Use [geopy](https://pypi.org/project/geopy/) ?\n\t* Use Overpass instead of Nominatim ?\n* Add an argument to select only a set of pictures (selected by date, or rank)\n* Time information about the duration of the script\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbernsteining%2Finstaloctrack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbernsteining%2Finstaloctrack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbernsteining%2Finstaloctrack/lists"}