{"id":16294462,"url":"https://github.com/scriptsmith/insta-scrape","last_synced_at":"2026-02-27T23:16:00.693Z","repository":{"id":97265896,"uuid":"70022038","full_name":"ScriptSmith/insta-scrape","owner":"ScriptSmith","description":"Scrape Instagram","archived":false,"fork":false,"pushed_at":"2019-01-12T05:59:24.000Z","size":9,"stargazers_count":29,"open_issues_count":0,"forks_count":13,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-09T12:47:16.271Z","etag":null,"topics":["hashtag","instagram","instagram-api","instagram-hashtag","scrape","scraping"],"latest_commit_sha":null,"homepage":null,"language":null,"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/ScriptSmith.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-10-05T01:51:18.000Z","updated_at":"2024-05-31T10:41:17.000Z","dependencies_parsed_at":"2023-05-06T17:01:16.468Z","dependency_job_id":null,"html_url":"https://github.com/ScriptSmith/insta-scrape","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ScriptSmith/insta-scrape","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ScriptSmith%2Finsta-scrape","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ScriptSmith%2Finsta-scrape/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ScriptSmith%2Finsta-scrape/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ScriptSmith%2Finsta-scrape/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ScriptSmith","download_url":"https://codeload.github.com/ScriptSmith/insta-scrape/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ScriptSmith%2Finsta-scrape/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29918976,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-27T19:37:42.220Z","status":"ssl_error","status_checked_at":"2026-02-27T19:37:41.463Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["hashtag","instagram","instagram-api","instagram-hashtag","scrape","scraping"],"created_at":"2024-10-10T20:15:26.278Z","updated_at":"2026-02-27T23:16:00.664Z","avatar_url":"https://github.com/ScriptSmith.png","language":null,"readme":"# This project has been replaced\n\nPlease visit [https://github.com/ScriptSmith/instamancer](https://github.com/ScriptSmith/instamancer) instead.\n\nThis repository's code will remain here, unmaintained.\n\n## Scraping an instagram hashtag - Working as of April 19th, 2017\n\n**Basic knowledge of how a web browser works and how to use `Python 3` required**\n\nInstagram's API no longer allows you to scrape data from a given hashtag. Thankfully, we can use its backend to get it automatically with the browser, and a simple python program\n\nTo get an instagram hashtag, visit this link:\n\n[https://www.instagram.com/explore/tags/hashtag/](https://www.instagram.com/explore/tags/hashtag/)\n\nWhere hashtag is the name of your hashtag\n\nScroll to the bottom of the page and click the `Load More` button\n\nOpen your console (`Ctrl` + `Shift` + `i`) and paste in the following javascript code\n\n```javascript\nvar pictureCount = 1000\n```\n\nChange pictureCount to the number of pictures you want to download, then press enter\n\nNow paste the following javascript:\n\n```javascript\nvar intervalID = window.setInterval(function() {\n\n    if(document.getElementsByClassName(\"_8mlbc _vbtk2 _t5r8b\").length \u003c pictureCount){\n        console.log(\"scrolled bottom\")\n        window.scrollTo(0,document.body.scrollHeight);\n\n        setTimeout(function(){\n                        console.log(\"scrolled top\");\n                        window.scrollTo(0,0);\n                    },250);\n    } else {\n        clearInterval(intervalID);\n        alert(\"Finished!\")\n        if (confirm(\"Export data\")){\n            var imgs = document.getElementsByClassName(\"_8mlbc _vbtk2 _t5r8b\")\n            var links = []\n            for (var img in imgs){\n                links.push(imgs[img].href);\n            }\n            window.open(\"data:text/json;charset=utf-8,\" + JSON.stringify(links))\n        }\n    }\n\n\n}, 500);\n```\n\nWait until the page has finished scrolling, accept the prompts and allow popups.\n\nLeave that window open.\n\nCreate a new python program by copying the following code\n\n```python\nimport requests\nimport json\nfrom bs4 import BeautifulSoup\nlinks = \n\nfor link in links:\n    req = requests.get(link).text\n    soup = BeautifulSoup(req, \"html.parser\")\n    scripts = soup.find_all(\"script\")\n    for script in scripts:\n        if script.text[:18] == \"window._sharedData\":\n            break\n\n    data = json.loads(script.contents[0][21:-1])\n    # print(json.dumps(data, indent=4))\n    print(\"timestamp: \" + str(data[\"entry_data\"][\"PostPage\"][0][\"graphql\"][\"shortcode_media\"][\"taken_at_timestamp\"]))\n    print(\"caption: \" + str(data[\"entry_data\"][\"PostPage\"][0][\"graphql\"][\"shortcode_media\"][\"edge_media_to_caption\"][\"edges\"][0][\"node\"][\"text\"]))\n    print(\"user: \" + str(data[\"entry_data\"][\"PostPage\"][0][\"graphql\"][\"shortcode_media\"][\"owner\"][\"username\"]))\n    print(\"full name: \" + str(data[\"entry_data\"][\"PostPage\"][0][\"graphql\"][\"shortcode_media\"][\"owner\"][\"full_name\"]))\n    print(\"comments: \" + str(data[\"entry_data\"][\"PostPage\"][0][\"graphql\"][\"shortcode_media\"][\"edge_media_to_comment\"][\"count\"]))\n    print(\"likes: \" + str(data[\"entry_data\"][\"PostPage\"][0][\"graphql\"][\"shortcode_media\"][\"edge_media_preview_like\"][\"count\"]))\n    print(\"url: \" + str(data[\"entry_data\"][\"PostPage\"][0][\"graphql\"][\"shortcode_media\"][\"display_url\"]))\n    print(\"dimensions: \" + str(data[\"entry_data\"][\"PostPage\"][0][\"graphql\"][\"shortcode_media\"][\"dimensions\"]))\n    print(\"location: \" + str(data[\"entry_data\"][\"PostPage\"][0][\"graphql\"][\"shortcode_media\"][\"location\"]))\n\n\n    if(data[\"entry_data\"][\"PostPage\"][0][\"graphql\"][\"shortcode_media\"][\"is_video\"]):\n        print(\"video: yes\")\n        print(\"video views: \" + str(data[\"entry_data\"][\"PostPage\"][0][\"graphql\"][\"shortcode_media\"][\"video_view_count\"]))\n\n    else:\n        print(\"video: no\")\n\n    print(\"################################################\")\n```\n\n\nPaste the output of the javascript popup into the links variable. Be sure to remove any nulls that might be generated at the end of the list.\n\nMake sure `BeautifulSoup`, `requests` and `json` are available on your operating system's version of Python.\n\nThe program will output like so:\n\n```\ndate: 1475615708\ncaption: From @mr_dog_spa #cutepetclub\nuser: cutepetclub\nfull name: Cute Pet Club\ncomments: 597\nlikes: 21712\nurl: https://scontent-syd1-1.cdninstagram.com/t51.2885-15/e15/14488289_188979234844412_7114537064384692224_n.jpg?ig_cache_key=MTM1Mzg4NTE1MzQ0MTQyMjYxMg%3D%3D.2\nvideo: yes\nvideo views: 70070\n################################################\ndate: 1475613401\ncaption: 😍💞😍 TWO PaRTS OF ToP CLiPS iN THe PaST 😍💞😍 ViDeO : @marianne.holmli \n#animals #animal #Pets #pet #dogsofinstagram #dog #puppy #hound #cutepuppy #instapuppy #puppies #cachorrinho #woof #fluffy #paws #cachorro #perro #baby #собака #щенок #babyanimals #funny #chowchow #love #anjing #chowchowpuppy #vine #강아지 #犬 #개 \nMY SPESIAL CHOW FRIENDS : \n@SDSTaSiuK @DIGSBY_N_CiNDeReLLa_THe_CHoWS \n@KHePeLKHaN.CHoWCHoW\n\nTaG YouR FRieNDs :👇👥👇\nuser: chowchow.gallery\nfull name: CHOWSTAGRAM CHoW CHoW PuPPieS\ncomments: 363\nlikes: 4297\nurl: https://scontent-syd1-1.cdninstagram.com/t51.2885-15/e15/14606962_1323728720995088_3535359629137543168_n.jpg?ig_cache_key=MTM1Mzg2NTc5MzYwNzMwMjI4NQ%3D%3D.2\nvideo: yes\nvideo views: 10639\n################################################\ndate: 1475606702\ncaption: So precious 💕\n@mikelefebvre1\nuser: ilovegolden_retrievers\nfull name: I Love Golden Retrievers\ncomments: 268\nlikes: 15396\nurl: https://scontent-syd1-1.cdninstagram.com/t51.2885-15/s640x640/sh0.08/e35/14473915_1105621309485529_7287598845976903680_n.jpg?ig_cache_key=MTM1MzgwOTYwMTA5MDQzMjgxNg%3D%3D.2\nvideo: no\n################################################\ndate: 1475618794\ncaption: Photo by @lylathebernie\nuser: babyanimalstagram\nfull name: Baby Animal Instagram\ncomments: 212\nlikes: 11574\nurl: https://scontent-syd1-1.cdninstagram.com/t51.2885-15/e35/14449346_391509197639414_4618319290473381888_n.jpg?ig_cache_key=MTM1MzkxMTAzNTI4MzQwMjAyNg%3D%3D.2\nvideo: no\n################################################\ndate: 1475607841\ncaption: pls don't talk to me ( @cabbagecatmemes )\nuser: chaos.reigns_\nfull name: chaos reigns\ncomments: 337\nlikes: 4498\nurl: https://scontent-syd1-1.cdninstagram.com/t51.2885-15/e35/14515597_1413720808929307_990947391542657024_n.jpg?ig_cache_key=MTM1MzgxOTE1OTQ0MDM3OTAwNQ%3D%3D.2\nvideo: no\n################################################\n```\n\nYou can modify the code to do more analysis\n\n\n## Disclaimer\nThis was written over a 1 hour period; it might be wrong and it will probably break.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscriptsmith%2Finsta-scrape","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscriptsmith%2Finsta-scrape","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscriptsmith%2Finsta-scrape/lists"}