InstaLocTrack: Instagram OSINT tool that allows you to collect all the location data
Insta LocTrack
The goal of the project
The goal of this project is to collect all the locations linked to the photos of an Instagram profile in order to place them on a map.
I don’t use Instagram’s API since Instagram deprecated its location functionality in 2018, and also because I wanted to play with Selenium and Chromedriver to make my own scraper.
How it works
First, we retrieve all the pictures links of the account by scrolling the whole Instagram profile, thanks to selenium’s webdriver.
Then, 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.
- 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 to me that I’m wrong about this, please tell me!)
Because 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).
For 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 by requesting GPS coordinates once every second.
Eventually, once we have all the GPS coordinates, we generate an HTML (thanks to jinja2 templating) with Javascript embedded that plots an Open Street Map (thanks to Leaflet library) with all our locations pinned. Once again, no API key is required for this step.
Also, the data collected by the script (location names, timestamps, GPS coordinates, errors) are dumped to a JSON file in order to be re-used.
Install
Requirements
sudo apt install chromium-chromedriver && sudo pip install -r requirements
Download
git clone https://github.com/bernsteining/InstaLocTrack.git
Use
Example
As an example, here’s the output on the former French President’s Instagram profile, @fhollande :
The information available when clicking on a marker:
The JSON data dump (just a part of it to show the format for a given location):
Source: https://github.com/bernsteining/
Suggested Sentence: Quantum Marketer reviews lots of services that help you grow followers