<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Peepee Poopoo</title>
    <description>The latest articles on DEV Community by Peepee Poopoo (@peepee_poopoo_2be58ded487).</description>
    <link>https://dev.to/peepee_poopoo_2be58ded487</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4237464%2Fa603d9eb-6b48-4bbc-9f37-e7f0ad35be84.png</url>
      <title>DEV Community: Peepee Poopoo</title>
      <link>https://dev.to/peepee_poopoo_2be58ded487</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/peepee_poopoo_2be58ded487"/>
    <language>en</language>
    <item>
      <title>Can I Track Instagram Follower Growth Over Time Without Maintaining a Scraper?</title>
      <dc:creator>Peepee Poopoo</dc:creator>
      <pubDate>Tue, 10 Nov 2026 16:14:58 +0000</pubDate>
      <link>https://dev.to/peepee_poopoo_2be58ded487/can-i-track-instagram-follower-growth-over-time-without-maintaining-a-scraper-797</link>
      <guid>https://dev.to/peepee_poopoo_2be58ded487/can-i-track-instagram-follower-growth-over-time-without-maintaining-a-scraper-797</guid>
      <description>&lt;p&gt;My original Instagram tracking script broke when I tried to turn a few manual profile checks into a repeatable data collection process.&lt;/p&gt;

&lt;p&gt;At first, the idea was simple: record an Instagram account's follower count every day and plot how it changes over time.&lt;/p&gt;

&lt;p&gt;I wasn't building a full analytics platform. I just wanted a small side project that could answer a few questions:&lt;/p&gt;

&lt;p&gt;How quickly is an account gaining or losing followers?&lt;/p&gt;

&lt;p&gt;Are there noticeable spikes in follower growth?&lt;/p&gt;

&lt;p&gt;Does posting frequency correlate with changes in follower count?&lt;/p&gt;

&lt;p&gt;Can I collect this data consistently without maintaining a browser scraper?&lt;/p&gt;

&lt;p&gt;The interesting part turned out to be less about plotting data and more about collecting it reliably.&lt;/p&gt;

&lt;p&gt;Why My Initial Approach Wasn't Sustainable&lt;/p&gt;

&lt;p&gt;My first approach involved checking public Instagram profiles and recording follower counts manually.&lt;/p&gt;

&lt;p&gt;That was fine for occasional observations, but it wasn't useful for tracking trends.&lt;/p&gt;

&lt;p&gt;I considered automating the process with browser scraping or instagrapi.&lt;/p&gt;

&lt;p&gt;Both approaches have their advantages. Scraping gives more control over the extraction process, while instagrapi provides a Python interface for many Instagram operations.&lt;/p&gt;

&lt;p&gt;However, I didn't want to maintain browser sessions, handle frequent frontend changes, or depend on an Instagram login for a simple analytics tool.&lt;/p&gt;

&lt;p&gt;I started looking into hosted Instagram APIs instead.&lt;/p&gt;

&lt;p&gt;One option I experimented with was HikerAPI, a REST Instagram API that uses an x-access-key header for authentication.&lt;/p&gt;

&lt;p&gt;Its advertised pricing starts at $0.001 per request, with 100 free requests available for initial testing.&lt;/p&gt;

&lt;p&gt;The appeal was straightforward: use HTTP requests for data collection and spend the rest of the time working on the analytics.&lt;/p&gt;

&lt;p&gt;Step 1: Fetching Instagram Account Data&lt;/p&gt;

&lt;p&gt;I started by checking whether I could retrieve structured information about a public Instagram account.&lt;/p&gt;

&lt;p&gt;Here's a basic example that resolves a username and then requests its media:&lt;/p&gt;

&lt;p&gt;import requests&lt;/p&gt;

&lt;p&gt;headers = {"x-access-key": "YOUR_KEY"}&lt;/p&gt;

&lt;p&gt;user = requests.get(&lt;br&gt;
    "&lt;a href="https://api.hikerapi.com/v2/user/by/username?username=natgeo" rel="noopener noreferrer"&gt;https://api.hikerapi.com/v2/user/by/username?username=natgeo&lt;/a&gt;",&lt;br&gt;
    headers=headers&lt;br&gt;
).json()&lt;/p&gt;

&lt;p&gt;r = requests.get(&lt;br&gt;
    f"&lt;a href="https://api.hikerapi.com/v2/user/medias?user_id=%7Buser%5B'pk'%5D%7D" rel="noopener noreferrer"&gt;https://api.hikerapi.com/v2/user/medias?user_id={user['pk']}&lt;/a&gt;",&lt;br&gt;
    headers=headers&lt;br&gt;
)&lt;/p&gt;

&lt;p&gt;print(r.json())&lt;/p&gt;

&lt;p&gt;This example retrieves account information first, extracts the account ID, and uses that ID to request media.&lt;/p&gt;

&lt;p&gt;For my follower-growth project, the main value was the initial account lookup. The media endpoint was useful for experimenting with posting activity, but it wasn't necessary for the basic follower chart.&lt;/p&gt;

&lt;p&gt;I wanted to keep the first version simple.&lt;/p&gt;

&lt;p&gt;Step 2: Building a Daily Follower Tracker&lt;/p&gt;

&lt;p&gt;I created a Python script that requests the current account data and saves the follower count with a timestamp.&lt;/p&gt;

&lt;p&gt;Instead of hardcoding the API key, I used an environment variable.&lt;/p&gt;

&lt;p&gt;import os&lt;br&gt;
import sqlite3&lt;br&gt;
import requests&lt;br&gt;
from datetime import datetime, timezone&lt;/p&gt;

&lt;p&gt;API_KEY = os.environ["HIKERAPI_KEY"]&lt;br&gt;
USERNAME = "natgeo"&lt;/p&gt;

&lt;p&gt;url = "&lt;a href="https://api.hikerapi.com/v2/user/by/username" rel="noopener noreferrer"&gt;https://api.hikerapi.com/v2/user/by/username&lt;/a&gt;"&lt;/p&gt;

&lt;p&gt;response = requests.get(&lt;br&gt;
    url,&lt;br&gt;
    params={"username": USERNAME},&lt;br&gt;
    headers={"x-access-key": API_KEY},&lt;br&gt;
    timeout=30&lt;br&gt;
)&lt;/p&gt;

&lt;p&gt;response.raise_for_status()&lt;br&gt;
data = response.json()&lt;/p&gt;

&lt;p&gt;followers = int(data["follower_count"])&lt;/p&gt;

&lt;p&gt;with sqlite3.connect("followers.db") as conn:&lt;br&gt;
    conn.execute("""&lt;br&gt;
        CREATE TABLE IF NOT EXISTS follower_history (&lt;br&gt;
            username TEXT NOT NULL,&lt;br&gt;
            timestamp TEXT NOT NULL,&lt;br&gt;
            followers INTEGER NOT NULL&lt;br&gt;
        )&lt;br&gt;
    """)&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;conn.execute(
    """
    INSERT INTO follower_history
    (username, timestamp, followers)
    VALUES (?, ?, ?)
    """,
    (
        USERNAME,
        datetime.now(timezone.utc).isoformat(),
        followers
    )
)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;print(f"{USERNAME}: {followers} followers")&lt;/p&gt;

&lt;p&gt;The exact response structure should be checked against the API version being used. This example assumes the account response includes a top-level follower_count field.&lt;/p&gt;

&lt;p&gt;I chose SQLite because I didn't need a separate database service.&lt;/p&gt;

&lt;p&gt;Every execution adds a new historical observation rather than overwriting the previous value.&lt;/p&gt;

&lt;p&gt;That distinction is important. A current follower count is only a snapshot. Growth analysis requires historical snapshots.&lt;/p&gt;

&lt;p&gt;Step 3: Plotting Follower Growth&lt;/p&gt;

&lt;p&gt;Once I had several observations stored in SQLite, I could visualize the history using Pandas and Matplotlib.&lt;/p&gt;

&lt;p&gt;import sqlite3&lt;br&gt;
import pandas as pd&lt;br&gt;
import matplotlib.pyplot as plt&lt;/p&gt;

&lt;p&gt;with sqlite3.connect("followers.db") as conn:&lt;br&gt;
    df = pd.read_sql_query(&lt;br&gt;
        """&lt;br&gt;
        SELECT timestamp, followers&lt;br&gt;
        FROM follower_history&lt;br&gt;
        WHERE username = ?&lt;br&gt;
        ORDER BY timestamp&lt;br&gt;
        """,&lt;br&gt;
        conn,&lt;br&gt;
        params=("natgeo",)&lt;br&gt;
    )&lt;/p&gt;

&lt;p&gt;df["timestamp"] = pd.to_datetime(df["timestamp"])&lt;/p&gt;

&lt;p&gt;plt.figure(figsize=(10, 5))&lt;/p&gt;

&lt;p&gt;plt.plot(&lt;br&gt;
    df["timestamp"],&lt;br&gt;
    df["followers"],&lt;br&gt;
    marker="o"&lt;br&gt;
)&lt;/p&gt;

&lt;p&gt;plt.title("Instagram Follower Growth")&lt;br&gt;
plt.xlabel("Date")&lt;br&gt;
plt.ylabel("Followers")&lt;br&gt;
plt.grid(True)&lt;br&gt;
plt.tight_layout()&lt;br&gt;
plt.show()&lt;/p&gt;

&lt;p&gt;At this point, the project had a basic workflow:&lt;/p&gt;

&lt;p&gt;Fetch the latest public account information.&lt;/p&gt;

&lt;p&gt;Store the follower count and collection timestamp.&lt;/p&gt;

&lt;p&gt;Repeat the collection on a schedule.&lt;/p&gt;

&lt;p&gt;Read historical observations from SQLite.&lt;/p&gt;

&lt;p&gt;Plot follower growth over time.&lt;/p&gt;

&lt;p&gt;I could schedule the collection script through cron or Windows Task Scheduler.&lt;/p&gt;

&lt;p&gt;There was no need to keep a browser open or manually refresh profiles.&lt;/p&gt;

&lt;p&gt;Step 4: Calculating Daily Changes&lt;/p&gt;

&lt;p&gt;A follower-count chart shows the overall direction, but daily changes are often more interesting.&lt;/p&gt;

&lt;p&gt;I added a simple calculation:&lt;/p&gt;

&lt;p&gt;df["growth"] = df["followers"].diff()&lt;/p&gt;

&lt;p&gt;df["growth_pct"] = (&lt;br&gt;
    df["followers"].pct_change() * 100&lt;br&gt;
)&lt;/p&gt;

&lt;p&gt;print(&lt;br&gt;
    df[["timestamp", "followers", "growth", "growth_pct"]]&lt;br&gt;
    .tail()&lt;br&gt;
)&lt;/p&gt;

&lt;p&gt;This made it easier to identify unusually large increases or decreases.&lt;/p&gt;

&lt;p&gt;One limitation is that the calculation measures changes between observations, not necessarily calendar days.&lt;/p&gt;

&lt;p&gt;If the script runs irregularly, the results need to be normalized by the time between samples.&lt;/p&gt;

&lt;p&gt;I also avoided treating follower growth as evidence that a particular post caused the increase. That would require additional data and a more careful analysis.&lt;/p&gt;

&lt;p&gt;Hosted API vs. Scraping vs. instagrapi&lt;/p&gt;

&lt;p&gt;After experimenting with the architecture, I found the tradeoffs fairly clear.&lt;/p&gt;

&lt;p&gt;Approach&lt;/p&gt;

&lt;p&gt;Advantages&lt;/p&gt;

&lt;p&gt;Limitations&lt;/p&gt;

&lt;p&gt;Browser scraping&lt;/p&gt;

&lt;p&gt;Full control over extraction logic&lt;/p&gt;

&lt;p&gt;Fragile selectors, browser overhead, maintenance&lt;/p&gt;

&lt;p&gt;instagrapi&lt;/p&gt;

&lt;p&gt;Python-native Instagram interface&lt;/p&gt;

&lt;p&gt;Login/session management and potential access restrictions&lt;/p&gt;

&lt;p&gt;Hosted REST API&lt;/p&gt;

&lt;p&gt;Structured responses, simple HTTP integration&lt;/p&gt;

&lt;p&gt;Usage costs, provider dependency, API limits&lt;/p&gt;

&lt;p&gt;A hosted API doesn't guarantee uninterrupted access to Instagram data.&lt;/p&gt;

&lt;p&gt;The provider can experience outages, change response formats, or encounter upstream restrictions. Requests can fail, and some information may be unavailable.&lt;/p&gt;

&lt;p&gt;For production use, I would add retries with exponential backoff, response validation, logging, and alerting when scheduled collection fails.&lt;/p&gt;

&lt;p&gt;I'd also monitor API usage because even inexpensive requests create recurring costs when collection frequency and account counts increase.&lt;/p&gt;

&lt;p&gt;What I'd Build Next&lt;/p&gt;

&lt;p&gt;The current architecture is intentionally small: Python for collecting data, SQLite for historical storage, and Matplotlib for visualization.&lt;/p&gt;

&lt;p&gt;The next improvements I'd consider are:&lt;/p&gt;

&lt;p&gt;Tracking multiple public accounts in the same database.&lt;/p&gt;

&lt;p&gt;Calculating rolling growth averages.&lt;/p&gt;

&lt;p&gt;Identifying unusual follower-growth spikes.&lt;/p&gt;

&lt;p&gt;Comparing growth with posting frequency.&lt;/p&gt;

&lt;p&gt;Building a lightweight dashboard using Streamlit.&lt;/p&gt;

&lt;p&gt;Adding automated checks for failed collection runs.&lt;/p&gt;

&lt;p&gt;The most useful lesson from this experiment was that follower-growth tracking doesn't require an elaborate architecture.&lt;/p&gt;

&lt;p&gt;It requires consistently collected observations, accurate timestamps, and a data model that preserves history.&lt;/p&gt;

&lt;p&gt;Using a hosted API reduced the amount of Instagram-specific maintenance I needed to handle, but the responsibility for data quality, scheduling, and interpretation stayed with my application.&lt;/p&gt;

&lt;p&gt;I'm curious how others approach this kind of project.&lt;/p&gt;

&lt;p&gt;If you're tracking social media metrics over time, do you prefer collecting snapshots through an API, maintaining your own scraper, or using an existing analytics service?&lt;/p&gt;

</description>
      <category>python</category>
      <category>ai</category>
      <category>api</category>
    </item>
  </channel>
</rss>
