-
Notifications
You must be signed in to change notification settings - Fork 111
Frequently Asked Questions
UPDATE COMING SOON TO REFLECT CHANGES IN INSTASCRAPE 2.X.X
Below is a list of frequently asked or anticipated questions that pertain to instascrape and their respective answers. If you don't see a satisfactory question/answer here, feel free to contact me! (see Support)
This is perhaps one of the most common exceptions to occur in regards to instascrape's API. Instagram is redirecting you to their login page instead of the page you requested. This prevents the scrape from performing successfully.
This can occur because:
🏃♂️ You made too many requests too quickly!
While I commend your ambition in collecting as much data as you can, it's entirely possible you flew too close to the sun. The eye of the Instagram algorithm has descended upon you and it is angry so it is temporarily redirecting your requests. Don't fret! It happens to the best of us 😅. After a couple hours (maybe a day or two max), the malevolent eye should peer elsewhere and the redirects will stop.
RECOMMENDED: Pause between each scrape with a randomized
time.sleep
! Depending on use case, this can be everywhere from a couple seconds to a full minute (the longer, the better). Just do anything to trick Instagram into thinking you're a standard user browsing the site.
👥 You are not logged in
You must be logged in or able to login to a valid Instagram account on the machine you are attempting to use instascrape on. instascrape operates outside of Instagram's official API. With that being said, Instagram validates that requests are being made from a valid user by checking for cookies you get on your machine upon logging in. It isn't clear how frequently you must login but as long as you have logged in relatively recently, the library should operate fine.
❗ Misc. suspicious activity
I recently heard that someone moved to a new city and instascrape mysteriously stopped working for them because Instagram had flagged their activity as suspicious. It isn't clear what the solution to problems like this are as of now but I suggest logging out of Instagram, clearing all of your Instagram cookies, and logging back in. Since instascrape operates entirely outside of the official Instagram API, it scrapes HTML and JSON data served back from Instagram by standard HTTP requests. Any form of suspicious use or abuse in the form of rate limits, strange behavior (requesting the same page over and over), requesting hundreds of times a minute, etc. could lead to temporary suspicion flags. Reevaluate your code and use case and see if you're doing anything that is tipping Instagram off that you are not a standard user browsing the site.
Nope! Word on the internet (*cough* Stack Overflow) has it that this endpoint is in the process of being deprecated as a stable means of collecting data from Instagram. Thus, instascrape does not support scraping from any URL with this query string. I also suspect that requesting from these endpoints runs the risk of temporarily flagging your requests as suspicious (see Misc. suspicious activity for more info)
Haha nope, instascrape operates entirely outside of the official API. Instagram has been stripping away access to their developer API for a few years now. As far as I know, their API has been totally disabled as of June 29, 2020 (per this document) instascrape primarily scrapes HTML and JSON data received in standard HTTP requests.
As of now, no it does not. Scraping certain dynamic content from Instagram such as the usernames of all followers, all comments on a post, and even all posts on a users page is not immediately supported by instascrape. Instascrape does not render any JavaScript, it simply scrapes data from standard HTTP requests to Instagram. instascrape can however work in conjunction and even be extended by tools such as Selenium, Scrapy, pyppeteer, requests-html, other Instagram scraping packages, etc.
See the Scraped data points section of the wiki.