Skip to content

Super lightweight Python 3 Instagram scraper for requesting and processing Instagram data

License

Notifications You must be signed in to change notification settings

Paola351/instascrape

 
 

Repository files navigation

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 the seasoned data scientist trying to quickly get an idea of a page's 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 Issues 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 

Dependencies

Install required dependencies using

$ pip3 install -r 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

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()

Contributing

All contributions, bug reports, bug fixes, documentation improvements, enhancements, and ideas are welcome!

Feel free to open an Issue or look at existing Issues to get a dialogue going on what you want to see added/changed/fixed!

Hacktoberfest 2020

This repo is participating in Hacktoberfest 2020! I would love for this repo to be a resource to absolute beginners looking to make some of their first contributions. Check out Issues for some easy ideas or open your own with something you want to work on! Please see the official Hacktober FAQ for rules/questions.

Happy hacking!

License

MIT


Support

Reach out to me if you have questions or ideas!

About

Super lightweight Python 3 Instagram scraper for requesting and processing Instagram data

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 98.5%
  • Shell 1.2%
  • Makefile 0.3%