Instagram Crawler - Setting Things Up (Part 1)

Oct 13, 2019 12:31 PM
Oct 13, 2019 12:43 PM
637065372716376896.jpg

Hi i'm Crawly

This will be a multi parted guide on how to automate/crawl Instagram.

This guide will be written in python 2.7

Here is the Api we will be using

Note you do not need an api key so don't freak out

I use Pycharm for my IDE

We will be using a slightly modified version of levpasha's Instagram Api which is a copy of mgp25's api (But written in python).

Why is it slightly modified? You need to install a bunch of stuff for the video/photo uploading portion of the script, so i figure it's easier just having a more simpler version for you to get your toes wet.

What to Expect from This Guide?

Here's a general idea of some things to expect from this guide

  • post a comment
  • like a photo/video
  • search hashtags
  • extract sensitive user info (Geo data, emails, phone numbers, full name etc)
  • @user data(How many followers/followings someone currently has, when was last post? etc)
  • much more

Prerequisites

Before diving in, you should have a basic understanding of python.

You will also need an Instagram Account username/password(You don't need an api key)

Step 1: Download the Api & Set Up File Structure

Create a new folder

Download github.com/crawlyy/instagramApi/blob/master/instagramApi.py

Save it as instagramApi.py

Download github.com/crawlyy/instagramApi/blob/master/bot.py

Save it as test.py

(Note: You will need to add your own instagram username/password - you can create a throw away just be careful sometimes it will trigger an sms verification if you create a new account then use api right after)

Create your _init_.py file (Leave it blank )

So your folder should look like this.

637065411629981434.jpg

FolderName

-instagramApi.py

-_init_.py

-test.py

Step 2: Run the Script

Once you run test.py you should get out similar to below

637065413902325009.jpg

Don't be alarmed if it spits out an error like below. So long as it says 'Login success!' we should be good to go!

Request return 429 error!

{u'status': u'fail', u'message': u'Please wait a few minutes before you try again.'}

Request return 405 error!

{u'status': u'fail', u'message': u''}

Request return 404 error!

If you have any questions or need help feel free to ask

Comments

No Comments Exist

Be the first, drop a comment!