Location Script for instagram_private_api Python Library
Budget: $10 – $30 USD
The budget for this script is $25. The purpose is to do a test showing the ability of getting latitude and longitude data from an instagram location id.
Write a python script that can interact with the instagram_private_api to retrieve location latitude and longitude GPS coordinates from location_id
Folder will contain location.py and input.txt
Input.txt will contain a location_id of a post (see attached files)
After script is run, script will write output.txt containing latitude and longitude of the location from input.txt (see attached files)
The instagram_private_api library needs to be accessed in the python script by cookies NOT username/pass login
for example:
cookies = {
'mid': 'ZvKx8QALAAfghPrY41e6maV7k',
'ig_did': '43F1B750-fgh-A43B-7C6C07376CDC',
'ig_nrcb': '1',
'csrftoken': 'K5AfghdffjpLIDfgJMYbDBYb9s',
'ds_user_id': '694701179603',
'sessionid': 'sdfsdfSmecUJOxqpcq2eQpPXuJWz23-MGMSInBxFrw',
'datr': '8bHyZgyyAGfdg4VaflKBkxw',
'rur': '"EAG\05469470dgfh643822948bbfe8698c8195f6c52a14"',
}
headers = {
'authority': 'www.instagram.com',
'accept': '*/*',
'accept-language': 'en-US,en;q=0.9',
'referer': 'https://www.instagram.com/p/CclgUyHp2qC/',
'sec-ch-prefers-color-scheme': 'light',
'sec-ch-ua': '" Not A;Brand";v="99", "Chromium";v="102", "Google Chrome";v="102"',
'sec-ch-ua-mobile': '?0',
'sec-ch-ua-platform': '"Windows"',
'sec-fetch-dest': 'empty',
'sec-fetch-mode': 'cors',
'sec-fetch-site': 'same-origin',
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36',
'viewport-width': '1493',
'x-asbd-id': '198387',
'x-csrftoken': 'ITKkZ8NysJdEPRUN5fpyIyL8i5RnaZMQ',
'x-ig-app-id': '936619743392459',
'x-ig-www-claim': 'hmac.AR2km4sJ_ZmvFK-xMKISTbcO225xSnHc3tc8yR1b6gYX9fsG',
'x-requested-with': 'XMLHttpRequest',
}
First step is to login to instagram and get cookie data using this extension:
https://chromewebstore.google.com/detail/cookie-editor/hlkenndednhfkekhgcdicdfddnkalmdm
Write a python script that can interact with the instagram_private_api to retrieve location latitude and longitude GPS coordinates from location_id
Folder will contain location.py and input.txt
Input.txt will contain a location_id of a post (see attached files)
After script is run, script will write output.txt containing latitude and longitude of the location from input.txt (see attached files)
The instagram_private_api library needs to be accessed in the python script by cookies NOT username/pass login
for example:
cookies = {
'mid': 'ZvKx8QALAAfghPrY41e6maV7k',
'ig_did': '43F1B750-fgh-A43B-7C6C07376CDC',
'ig_nrcb': '1',
'csrftoken': 'K5AfghdffjpLIDfgJMYbDBYb9s',
'ds_user_id': '694701179603',
'sessionid': 'sdfsdfSmecUJOxqpcq2eQpPXuJWz23-MGMSInBxFrw',
'datr': '8bHyZgyyAGfdg4VaflKBkxw',
'rur': '"EAG\05469470dgfh643822948bbfe8698c8195f6c52a14"',
}
headers = {
'authority': 'www.instagram.com',
'accept': '*/*',
'accept-language': 'en-US,en;q=0.9',
'referer': 'https://www.instagram.com/p/CclgUyHp2qC/',
'sec-ch-prefers-color-scheme': 'light',
'sec-ch-ua': '" Not A;Brand";v="99", "Chromium";v="102", "Google Chrome";v="102"',
'sec-ch-ua-mobile': '?0',
'sec-ch-ua-platform': '"Windows"',
'sec-fetch-dest': 'empty',
'sec-fetch-mode': 'cors',
'sec-fetch-site': 'same-origin',
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36',
'viewport-width': '1493',
'x-asbd-id': '198387',
'x-csrftoken': 'ITKkZ8NysJdEPRUN5fpyIyL8i5RnaZMQ',
'x-ig-app-id': '936619743392459',
'x-ig-www-claim': 'hmac.AR2km4sJ_ZmvFK-xMKISTbcO225xSnHc3tc8yR1b6gYX9fsG',
'x-requested-with': 'XMLHttpRequest',
}
First step is to login to instagram and get cookie data using this extension:
https://chromewebstore.google.com/detail/cookie-editor/hlkenndednhfkekhgcdicdfddnkalmdm