Forum Thread: Instagram Crawler - Setting Things Up (Part 1)

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.

FolderName
-instagramApi.py
-_init_.py
-test.py

Step 2: Run the Script

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

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

Never Miss a Hacking or Security Guide

Get new Null Byte guides every week.

1 Response

You can get good traffic by posting on Instagram, if the post gets likes then this crawl is also quick.

Share Your Thoughts

  • Hot
  • Active