Skip to main content

🚀 Sponsored by CoreClaw

Looking for a production-ready Instagram scraping API?

CoreClaw provides APIs and open-source Workers for Instagram posts, profiles, comments, and more, helping developers collect structured data at scale.

🎁 Start free → https://coreclaw.com

Instagram Posts Scraper

InstagramPostsScraper is a Python library for collect instagram users' data.

The data obtained by web crawlers is not real-time data, but rather data from a specific point in time on the same day.

I’d really appreciate your support! You can star ⭐ or fork this repository to help me keep sharing more interesting web scrapers.

Support Me

If you enjoy this project and would like to support me, please consider donating 🙌
Your support will help me continue developing this project and working on other exciting ideas!

💖 Ways to Support:

Thank you for your support!! 🎉

Requirements

beautifulsoup4==4.13.4
cloudscraper==1.2.71
lxml==6.1.1
pandas==2.2.3
pytz==2024.2
requests==2.32.3
selenium==4.33.0
seleniumbase==4.39.2

Installation

To install the latest release from PyPI:

pip install instagram-posts-scraper

Usage - Sample

from instagram_posts_scraper.instagram_posts_scraper import InstaPeriodScraper
from IPython.display import display

ig_posts_scraper = InstaPeriodScraper()
target_info = {"username": "stephencurry30", "days_limit": 30}
res = ig_posts_scraper.get_posts(target_info=target_info)
display(res)

Optional parameters

  • username: target instagram user
  • days_limit: Number of days within which to scrape posts..

Version

You can check the installed version and module documentation:

import instagram_posts_scraper

print(instagram_posts_scraper.__version__)  # e.g. 0.2.0
print(instagram_posts_scraper.__doc__)      # module documentation

Sample Output

The scraper returns a single consolidated dictionary containing the target's normalized profile, the account_status, the scraping timestamp (updated_at), a posts list of normalized posts, plus the raw init_posts (picnob first-page HTML posts) and top_posts (profile-scraper highlights) collections, which are preserved verbatim so no source data is lost.

Profile metadata is normalized: followers comes from the profile scraper's precise count, while following and the biography fallback come from picnob. Each entry in posts is normalized to a single, consistent engagement shape (like_count / comment_count as integers). init_posts and top_posts keep their original shapes untouched.

Below is an abbreviated example (long media URLs are truncated with ... for readability). For the complete, real output see examples/example_output.json.

{
  "profile": {
    "username": "stephencurry30",
    "userid": "324599988",
    "full_name": "Wardell Curry",
    "biography": "Believer. Husband. Father. Founder. Philanthropist. Olympic Gold Medalist. NYT Best Selling Author. Philippians 4:13.",
    "followers": 57049215,
    "following": 1296,
    "posts_count": 1556,
    "profile_picture": "https://cdn.iqsaved.com/..."
  },
  "account_status": "public",
  "updated_at": "2026-08-21 15:28:13.009746+08:00",
  "posts": [
    {
      "shortcode": "6772442523573164715722",
      "caption": "Played a lil G with my boy @stephencurry30 this week to kick off Father’s Day weekend! ...",
      "media_type": "igtv",
      "is_video": true,
      "timestamp": 1781966678,
      "like_count": 98397,
      "comment_count": 540,
      "thumbnail": "https://scontent-ord5-1.cdninstagram.com/...",
      "image_url": "https://scontent.cdninstagram.com/..."
    }
    // ... more posts
  ],
  "init_posts": [
    {
      "text": "Quality time looks a little different in our family ...",
      "likes": "101k",
      "comments": "425",
      "time": "7 days ago",
      "thumbnail": "https://sp1.pixnoy.com/..."
    }
    // ... picnob first-page posts, preserved verbatim (now includes the cover `thumbnail`)
  ],
  "top_posts": [
    {
      "timestamp": 1786636718,
      "caption": "Quality time looks a little different in our family 😂 ...",
      "comment_count": 425,
      "like_count": 100894,
      "shortcode": "Db_GagbB20Q"
    }
    // ... profile-scraper highlights, preserved verbatim
  ]
}

Metadata

Release files for instagram-posts-scraper 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for instagram-posts-scraper 0.4.0
File Size Uploaded
instagram_posts_scraper-0.4.0.tar.gz 26.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for instagram-posts-scraper 0.4.0
File Interpreter ABI Platform
instagram_posts_scraper-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 54.0 kB

Release files / instagram_posts_scraper-0.4.0.tar.gz

Download URL instagram_posts_scraper-0.4.0.tar.gz
Size 26.3 kB
Tags Source
SHA-256 checksum
How to use checksums
452ba5e09108492dbb8da169404d8fb8a4b7dcd65b1d6a4940971b280bd516d8
BLAKE2b-256 checksum
How to use checksums
f9e4e8399232207d71457dfee76477c0310c0e1f7de2631ecbded52c3cb943a7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.13.1

Release files / instagram_posts_scraper-0.4.0-py3-none-any.whl

Download URL instagram_posts_scraper-0.4.0-py3-none-any.whl
Size 27.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
137cdb6fd8540ec7424cf4f9e58fca10adb257428ca05cd6c079eb5fd400e7c1
BLAKE2b-256 checksum
How to use checksums
f321070dbb58504178b1a88b3f2a7797ce8d8f7cf30a9fb8954f36e31573a316
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.13.1

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

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