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


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

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.2.0.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

insta_scrape-0.2.0-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: insta-scrape-0.2.0.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.4

File hashes

Hashes for insta-scrape-0.2.0.tar.gz
Algorithm Hash digest
SHA256 606f7ef4c9ff179ec0041f58c3b0261fd7aee1d7a3988926c65d877870933c43
MD5 e53d83ea4e1b3a9a210a6f4b9ccc9f13
BLAKE2b-256 5e6599a7e0e81871f2dffa4e5be803ec1cce27f543cc732c1a07f3e5e1b04dcd

See more details on using hashes here.

File details

Details for the file insta_scrape-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: insta_scrape-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 10.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.4

File hashes

Hashes for insta_scrape-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 568aa7b65c060336434828e725efd1848886af9dc59fc3a5c6aa9fcf3271c40f
MD5 1f09f03ed0cf9260a15992d6718cf5e8
BLAKE2b-256 6294c6804ea788958b38a41b7612df7bea151974fd496bb41207636e7f509e3c

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

0.3.0

1 file

0.2.1

2 files

This release

0.2.0 This release

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