Skip to main content

instascrape logo

instascrape: super lightweight Instagram scraping toolkit

What is it?

instascrape is an incredibly lightweight set of tools geared towards scraping Instagram data. It makes no assumptions about your project and is instead designed for flexibility and developer productivity. It is excellent for for the seasoned data scientist trying to quickly get an idea of a pages engagement as well as beginners looking to explore web scraping and the beauty of Python for the very first time.

Version Language Code style: black Release License

Downloads Activity Dependencies Size

Sample programming gif


Table of Contents

Graph of instagram data Example of Instagram likes per post data scraped using instascrape (this repository and its author(s) are not affiliated with Real Python)


Installation

pip

Install from PyPI using

$ pip3 install insta-scrape

Clone

Clone right from Github to your local machine using

$ git clone https://github.com/chris-greening/instascrape.git 

and install required dependencies using

$ pip3 install -f requirements.txt

Documentation

The official documentation can be found on Read The Docs


Features

Profile

Representation of an Instagram profile. Calling static_load takes care of requesting and scraping static HTML regarding the given URL or username. Profile.static_load scrapes 36 data points including

followers: int
following: int
posts: int 
profile_pic_url: str
is_business_account: bool
is_verified: bool 
#etc. 

Sample code:

from instascrape import Profile
url = 'https://www.instagram.com/gvanrossum/'
post = Profile(url)
post.static_load()

Post

Representation of a single Instagram post. Calling static_load takes care of requesting and scraping static HTML regarding the given URL or post shortcode. Post.static_load scrapes 29 data points including

likes: int
amount_of_comments: int
hashtags: List[str]
tagged_users: List[str]
caption: str
location: str
#etc. 

Sample code:

from instascrape import Post 
url = 'https://www.instagram.com/p/CFcSLyBgseW/'
post = Post(url)
post.static_load()

Hashtag

Representation of an Instagram hashtag page. Calling static_load takes care of requesting and scraping static HTML regarding the given URL or hashtag name. Hashtag.static_load scrapes 10 data points including

amount_of_posts: int
name: str
is_following: bool
allow_following: bool
#etc. 

Sample code:

from instascrape import Hashtag 
url = 'https://www.instagram.com/explore/tags/python/'
hashtag = Hashtag(url)
hashtag.static_load()

License

MIT


Support

Reach out to me if you have questions or ideas!

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

insta-scrape-0.3.0.tar.gz (7.4 kB view details)

Uploaded Source

File details

Details for the file insta-scrape-0.3.0.tar.gz.

File metadata

  • Download URL: insta-scrape-0.3.0.tar.gz
  • Upload date:
  • Size: 7.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.6.9

File hashes

Hashes for insta-scrape-0.3.0.tar.gz
Algorithm Hash digest
SHA256 02b4584616968138ba410f02c5244d1218d50debbd8a954b797cce49c56480bb
MD5 fd7185e33f995cb36ee4bc7670f45513
BLAKE2b-256 981b164559d0284230cdb91461d47fb96a087e91d593c79b9278f8746d8f9107

See more details on using hashes here.

Release history Release notifications | RSS feed

2.1.2

2 files

2.1.1

2 files

2.1.0

2 files

2.0.2

2 files

2.0.0

1 file

1.7.1

2 files

1.7.0

1 file

1.6.1

2 files

1.6.0

1 file

1.5.0

1 file

1.4.0

2 files

1.3.4

1 file

1.3.3

1 file

1.3.2

1 file

1.3.1

1 file

1.3.0

1 file

1.2.8

1 file

1.2.7

1 file

1.2.6

1 file

1.2.5

1 file

1.2.4

1 file

1.2.3

1 file

1.2.2

1 file

1.2.1

1 file

1.2.0

1 file

1.1.0

1 file

1.0.1

1 file

1.0.0

1 file

0.11.0

1 file

0.10.0

1 file

0.9.0

1 file

0.8.1

1 file

0.8.0

1 file

0.7.1

1 file

0.7.0

1 file

0.6.7

1 file

0.6.6

1 file

0.6.5

1 file

0.6.4

1 file

0.6.3

1 file

0.6.2

1 file

0.6.1

1 file

0.6.0

1 file

0.5.1

1 file

0.5.0

1 file

0.4.0

1 file

This release

0.3.0 This release

1 file

0.2.1

2 files

0.2.0

2 files

0.1.0

2 files

0.0.7

2 files

0.0.6

2 files

0.0.5

2 files

0.0.4

2 files

0.0.0

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page