Skip to content
{} Service◌ WIP

Instagram Model Analytics Scraper

Track Instagram profile, post, and reel performance at scale.

About

A backend service that monitors Instagram accounts, captures profile growth and media performance over time, and exposes analytics endpoints for ranked winning content, follower history, and per-media history. Designed to run continuously on a VPS with automated scheduling, session reuse, and historical snapshot storage.

Tech Stack

PythonFastAPIPlaywrightPostgreSQLSQLAlchemyAlembicAPScheduler

Info

Category
Service
Status
WIP
Technologies
7

Architecture

scrapesnapshotsscheduleanalytics📸InstagramPlaywrightPostgreSQLAPScheduler🚀FastAPI

Code Preview

Pythonanalytics_api.py
1@app.get("/api/analytics/{account_id}")
2async def get_analytics(
3 account_id: str,
4 days: int = 30,
5 db: Session = Depends(get_db),
6):
7 snapshots = db.query(ProfileSnapshot).filter(
8 ProfileSnapshot.account_id == account_id,
9 ProfileSnapshot.timestamp >= days_ago(days),
10 ).order_by(ProfileSnapshot.timestamp).all()
11
12 growth = calculate_growth_rate(snapshots)
13 top_posts = db.query(MediaSnapshot).filter(
14 MediaSnapshot.account_id == account_id,
15 ).order_by(MediaSnapshot.engagement.desc()).limit(10)
16
17 return {
18 "follower_history": [s.followers for s in snapshots],
19 "growth_rate": growth,
20 "top_content": [serialize_media(m) for m in top_posts],
21 "engagement_avg": calculate_avg_engagement(snapshots),
22 }