Skip to main content

instascrape logo

Instagram scraping for humans

What is it?

instascrape is a powerful, lightweight Python library for scraping Instagram data with no configurations necessary! It is designed with flexibility and developer productivity in mind so you can stop wasting valuable time trying to figure out how to collect data and just start analyzing :muscle:

Version Language Code style: black Release License

Downloads Activity Dependencies Issues Size

Example showing tech profile scrapes

Key features

  • :muscle: Powerful, object-oriented scraping tools as well as a variety of useful functions
  • :dancer: Flexibly determines whether you want to scrape HTML, JSON, BeautifulSoup, or request and scrape the URL itself
  • :floppy_disk: Download content to your computer as png, jpg, mp4, and mp3
  • :art: Dynamically retrieve HTML embed code for posts
  • :musical_score: Expressive and consistent API for concise and elegant code
  • :bar_chart: Designed for seamless integration with Selenium, Pandas, and other industry standard tools for data collection and analysis
  • :hammer: Lightweight: you don't have to build a hammer factory when all you need is the hammer
  • :spider_web: The only hard dependencies are Requests and Beautiful Soup; no more worrying about configurations or webdrivers
  • :watch: Proven to work as of December, 2020

Table of Contents


:computer: Installation

Minimum Python version

This library currently requires Python 3.7 or higher.

pip

Install from PyPI using

$ pip3 install insta-scrape

WARNING: make sure you install insta-scrape and not a package with a similar name!


:mag_right: Sample Usage

All top-level, ready-to-use features can be imported using:

from instascrape import *

instascrape uses clean, consistent, and expressive syntax to make the developer experience as painless as possible.

# Instantiate the scraper objects 
google = Profile('https://www.instagram.com/google/')
google_post = Post('https://www.instagram.com/p/CG0UU3ylXnv/')
google_hashtag = Hashtag('https://www.instagram.com/explore/tags/google/')

# Scrape their respective data 
google.scrape()
google_post.scrape()
google_hashtag.scrape()

After being scraped, relevant attributes can be accessed with dot (.) or bracket ([]) notation

print(google.followers)
print(google_post['hashtags'])
print(google_hashtag.amount_of_posts)
>>> 12262794
>>> ['growwithgoogle']
>>> 9053408

:books: Documentation

The official documentation can be found on Read The Docs :newspaper:


:newspaper: Blog Posts

Check out blog posts on DEV for ideas and tutorials!


:pray: 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.

Beginners to open source are highly encouraged to participate and ask questions :heart:


:spider_web: Dependencies

Instascrape primarily relies on two third-party libraries for requesting and scraping Instagram HTML content:

  1. Requests: HTTP requests
  2. BeautifulSoup: Scraping and parsing HTML data.

The rest of its functionality is provided directly from Python 3's standard library for unobtrusive code under the hood with little to no overhead.


:credit_card: License

MIT


:grey_question: Support

Check out the FAQ

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

Uploaded Source

File details

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

File metadata

  • Download URL: insta-scrape-1.3.2.tar.gz
  • Upload date:
  • Size: 18.9 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.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.0

File hashes

Hashes for insta-scrape-1.3.2.tar.gz
Algorithm Hash digest
SHA256 a39262842bc4c99f83321e358611ad7c59f9624f051c1ba6147292ea6353895c
MD5 5361e5cad6fbdd2bb4dbbfe837079e3c
BLAKE2b-256 05a711659322e76102f27a7f88cd4fb5ef24160a367d88d1e77412569d6dee89

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

This release

1.3.2 This release

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

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