{} 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
Code Preview
Pythonanalytics_api.py
1@app.get("/api/analytics/{account_id}")2async def get_analytics(3account_id: str,4days: int = 30,5db: Session = Depends(get_db),6):7snapshots = db.query(ProfileSnapshot).filter(8ProfileSnapshot.account_id == account_id,9ProfileSnapshot.timestamp >= days_ago(days),10).order_by(ProfileSnapshot.timestamp).all()1112growth = calculate_growth_rate(snapshots)13top_posts = db.query(MediaSnapshot).filter(14MediaSnapshot.account_id == account_id,15).order_by(MediaSnapshot.engagement.desc()).limit(10)1617return {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}