Use cases · 2026

5 Things You Can Build with an Instagram API

From analytics dashboards to lead generation pipelines, here are five practical projects you can ship with structured Instagram data and a few lines of code.

Published August 17, 2026 · 10 minute read

Instagram holds a wealth of publicly available data: follower counts, post engagement, hashtag trends, and creator bios. With an API that returns this data as structured JSON, you can build tools that would otherwise require brittle scraping setups. Here are five real projects, each with working code using the GramScraper API.

All examples use Python with the requests library. You need a GramScraper API key — new accounts include 100 free credits, and credits never expire.

1. Analytics Dashboard

Track how an Instagram account grows over time. Pull profile data on a schedule, store it, and visualize follower count, post frequency, and engagement trends.

How it works

Call the profile endpoint daily and append the results to a database or CSV. Over time, you build a time series of public metrics.

Python — fetch_analytics.py
import os, requests, json
from datetime import datetime

API_KEY = os.environ["GRAMSCRAPER_API_KEY"]
BASE = "https://gramscraper.com/api/instagram"

def snapshot_profile(username):
    resp = requests.get(
        f"{BASE}/v1/user/by/username",
        headers={"Authorization": f"Bearer {API_KEY}"},
        params={"username": username},
        timeout=20,
    )
    resp.raise_for_status()
    profile = resp.json()
    return {
        "date": datetime.utcnow().isoformat(),
        "username": profile.get("username"),
        "followers": profile.get("follower_count", 0),
        "following": profile.get("following_count", 0),
        "posts": profile.get("media_count", 0),
    }

# Append to a JSON Lines file
record = snapshot_profile("natgeo")
with open("analytics.jsonl", "a") as f:
    f.write(json.dumps(record) + "\n")
print(f"Saved snapshot: {record['followers']:,} followers")

Run this as a cron job or scheduled task. Feed the JSONL file into any charting library to see growth curves.

2. Creator Benchmark Report

Compare a preselected set of public creator profiles for internal research. Pull aggregate follower counts and profile metadata, then save a repeatable benchmark report.

How it works

Maintain a small list of accounts relevant to your analysis and capture the same public fields for each one.

Python — creator_benchmark.py
import os, requests, csv

API_KEY = os.environ["GRAMSCRAPER_API_KEY"]
BASE = "https://gramscraper.com/api/instagram"

usernames = ["creator_one", "creator_two", "creator_three"]

def profile_summary(username):
    resp = requests.get(
        f"{BASE}/v1/user/by/username",
        headers={"Authorization": f"Bearer {API_KEY}"},
        params={"username": username},
        timeout=20,
    )
    if resp.status_code != 200:
        return None
    p = resp.json()
    return {
        "username": p.get("username"),
        "name": p.get("full_name", ""),
        "bio": p.get("biography", ""),
        "followers": p.get("follower_count", 0),
        "verified": p.get("is_verified", False),
    }

with open("creator_benchmark.csv", "w", newline="") as f:
    writer = csv.DictWriter(f, fieldnames=[
        "username", "name", "bio", "followers", "verified"
    ])
    writer.writeheader()
    for u in usernames:
        row = profile_summary(u)
        if row:
            writer.writerow(row)
            print(f"  Added @{row['username']} ({row['followers']:,} followers)")

print(f"Saved {len(usernames)} profiles to creator_benchmark.csv")

3. Content Scheduler

Analyze when a creator's posts get the most engagement, then suggest optimal posting times. Fetch recent posts and group engagement by day of week and hour.

How it works

Pull a user's recent media, extract timestamps and engagement metrics, and find patterns.

Python — posting_times.py
import os, requests
from collections import defaultdict
from datetime import datetime

API_KEY = os.environ["GRAMSCRAPER_API_KEY"]
BASE = "https://gramscraper.com/api/instagram"

def analyze_posting_times(username):
    resp = requests.get(
        f"{BASE}/v1/user/medias/by/username",
        headers={"Authorization": f"Bearer {API_KEY}"},
        params={"username": username},
        timeout=30,
    )
    resp.raise_for_status()
    data = resp.json()

    # Handle response format: may be [posts, cursor] or {items: [...]}
    posts = data
    if isinstance(data, list) and len(data) > 0 and isinstance(data[0], list):
        posts = data[0]
    elif isinstance(data, dict) and "items" in data:
        posts = data["items"]

    by_day = defaultdict(list)
    for post in posts:
        ts = post.get("taken_at") or post.get("taken_at_ts")
        if not ts:
            continue
        dt = datetime.utcfromtimestamp(ts) if isinstance(ts, (int, float)) else datetime.fromisoformat(str(ts))
        likes = post.get("like_count", 0)
        day_name = dt.strftime("%A")
        by_day[day_name].append(likes)

    print(f"Engagement by day for @{username}:")
    for day, likes in sorted(by_day.items(), key=lambda x: -sum(x[1])/len(x[1])):
        avg = sum(likes) / len(likes)
        print(f"  {day}: {avg:,.0f} avg likes ({len(likes)} posts)")

analyze_posting_times("natgeo")

4. Competitor Tracker

Monitor multiple competitor accounts side by side. Compare follower growth, posting frequency, and engagement rates to spot trends in your niche.

How it works

Fetch profiles for a list of competitors and calculate engagement metrics from their recent posts.

Python — competitor_tracker.py
import os, requests

API_KEY = os.environ["GRAMSCRAPER_API_KEY"]
BASE = "https://gramscraper.com/api/instagram"
HEADERS = {"Authorization": f"Bearer {API_KEY}"}

competitors = ["competitor_a", "competitor_b", "competitor_c"]

def get_profile(username):
    resp = requests.get(
        f"{BASE}/v1/user/by/username",
        headers=HEADERS,
        params={"username": username},
        timeout=20,
    )
    if resp.status_code != 200:
        return None
    return resp.json()

print(f"{'Account':<20} {'Followers':>12} {'Posts':>8} {'Verified':>10}")
print("-" * 54)

for u in competitors:
    p = get_profile(u)
    if not p:
        print(f"{'@' + u:<20} {'(unavailable)':>12}")
        continue
    print(
        f"{'@' + p.get('username', u):<20}"
        f" {p.get('follower_count', 0):>12,}"
        f" {p.get('media_count', 0):>8,}"
        f" {'Yes' if p.get('is_verified') else 'No':>10}"
    )

Run weekly and diff the results to catch sudden follower spikes, new content strategies, or accounts going private.

5. Hashtag Content Report

Study the public posts appearing under a relevant hashtag to understand recurring topics and engagement patterns.

How it works

Fetch top hashtag posts and create a compact report from content-level fields such as caption, timestamp, and aggregate engagement counts.

Python — hashtag_report.py
import os, requests

API_KEY = os.environ["GRAMSCRAPER_API_KEY"]
BASE = "https://gramscraper.com/api/instagram"
HEADERS = {"Authorization": f"Bearer {API_KEY}"}

def content_from_hashtag(hashtag, max_posts=10):
    # Get top posts for the hashtag
    resp = requests.get(
        f"{BASE}/v1/hashtag/medias/top/chunk",
        headers=HEADERS,
        params={"name": hashtag},
        timeout=30,
    )
    resp.raise_for_status()
    posts = resp.json()
    if isinstance(posts, dict) and "items" in posts:
        posts = posts["items"]

    report = []
    for post in posts[:max_posts]:
        report.append({
            "shortcode": post.get("code") or post.get("shortcode"),
            "caption": (post.get("caption_text") or "")[:120],
            "likes": post.get("like_count", 0),
            "comments": post.get("comment_count", 0),
            "taken_at": post.get("taken_at"),
        })
    return report

results = content_from_hashtag("sustainablefashion", max_posts=5)
for post in results:
    print(f"{post['shortcode']}: {post['likes']:,} likes, {post['comments']:,} comments")
    print(f"  {post['caption']}")

This workflow stays at the content level: it reports public posts and aggregate engagement metrics without creating an account or contact list.

Getting started

  1. Create a free GramScraper account — you get 100 credits immediately.
  2. Generate an API key from the dashboard.
  3. Copy any example above and run it with your key.

Credits do not expire, so you can experiment at your own pace. When you need more volume, paid plans start at $29 for 15,400 credits.

Start building

Get 100 free credits and try any of these projects today.

Get Your API Key →