Last active
September 20, 2018 16:06
-
-
Save clarkio/169251660324d40a8f1cbbdd7c1f23a0 to your computer and use it in GitHub Desktop.
A Script to gather instagram account urls from a search query
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Open the query URL in your browser with the search term you want to use | |
An example URL searching for dogs: https://www.instagram.com/web/search/topsearch/?context=blended&query=dog&rank_token=0.5831184414520498&include_reel=false | |
2. Copy the code in the "script.js" file | |
3. Open up your browser dev tools and go to the console | |
4. Paste in the code and hit Enter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Example query URL: https://www.instagram.com/web/search/topsearch/?context=blended&query=dog&rank_token=0.5831184414520498&include_reel=false | |
// note: query=dog is what you will want to change for your search term | |
const igResults = document.getElementsByTagName('pre'); | |
const accountsJson = JSON.parse(igResults[0].innerText); | |
const accountsUrls = accountsJson.users.map(account => `https://instagram.com/${account.user.username}`); | |
accountsUrls.forEach(url => console.log(url)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment