A comprehensive Python GUI application for analysing Instagram account performance using the Meta Graph API.
- Account Overview: Follower count, engagement rate, posting frequency
- Post Analysis: Performance metrics for individual posts
- Engagement Tracking: Likes, comments, shares, and saves analysis
- Posting Patterns: Optimal posting times and frequency analysis
- Visual Charts: Interactive charts and graphs for data visualization
- Meta Graph API Integration: Real Instagram data via official API
- Demo Mode: Test the application with realistic demo data
- Data Export: Export reports and charts in multiple formats
- Real-time Updates: Fetch latest data from Instagram
- Secure Configuration: Environment-based credential management
- Engagement rate calculation and benchmarking
- Top performing posts identification
- Hashtag performance analysis
- Audience demographic insights
- Growth trend analysis
- Content optimization recommendations
- Python 3.8 or higher
- pip package manager
- Meta Developer Account (for real data)
-
Clone the repository
git clone <repository-url> cd instagram-analytics
-
Install required packages
pip install -r requirements.txt
-
Run the application
python main.py
-
Try Demo Mode
- Click "Load Demo Data" to explore the app with sample data
- No API setup required for demo mode
To use real Instagram data, you'll need to set up Meta Graph API access:
- Go to Meta for Developers
- Create a developer account or log in
- Create a new app
- Add "Instagram Basic Display" product to your app
- Configure OAuth redirect URIs
- Add test users (your Instagram account)
- Generate a User Access Token
- Exchange for Long-Lived Token (optional)
- Get your Instagram Business Account ID
-
Create a
.envfile in the project root:META_ACCESS_TOKEN=your_access_token_here META_APP_ID=your_app_id_here META_APP_SECRET=your_app_secret_here INSTAGRAM_ACCOUNT_ID=your_instagram_business_account_id
-
Or use the "Setup API Credentials" button in the app
-
Launch the Application
python main.py
-
Choose Your Mode
- Demo Mode: Click "Load Demo Data" for immediate exploration
- Live Mode: Configure API credentials for real data
- Click "Load Demo Data" button
- Explore different tabs:
- Account Overview: See account statistics and metrics
- Posts Analysis: View individual post performance
- Charts: Interactive data visualizations
- Insights: Detailed analytics and recommendations
- Click "Setup API Credentials" and enter your Meta API details
- Click "Test Connection" to verify setup
- Use data fetching buttons:
- "Fetch Account Data": Get profile information
- "Fetch Recent Posts": Get latest posts data
- "Fetch Insights": Get account insights
- "Analyze All Data": Perform comprehensive analysis
-
Account Overview Tab
- View follower growth and engagement metrics
- See posting frequency and optimal timing
- Review top-performing content
-
Posts Analysis Tab
- Browse all recent posts with performance metrics
- Identify high and low-performing content
- Analyze posting patterns
-
Charts Tab
- Visualize engagement trends
- See posting pattern distributions
- Compare performance across different metrics
-
Insights Tab
- Get detailed analytics breakdown
- View recommendations for improvement
- See audience demographics (if available)
- Export Report: Save detailed analytics as text file
- Save Charts: Export visualizations as PNG images
- Data Export: Save raw data in CSV/JSON format
instagram-analytics/
β
βββ main.py # Main GUI application
βββ instagram_api.py # Meta Graph API client
βββ data_analyzer.py # Data processing and analysis
βββ demo_data.py # Demo data generator
βββ config.py # Configuration management
βββ utils.py # Utility functions
βββ test_app.py # Unit tests
βββ requirements.txt # Python dependencies
βββ setup.py # Package setup
βββ README.md # This file
βββ .env # Environment variables (create this)
Run the comprehensive test suite:
python test_app.pyThe tests cover:
- Demo data generation
- Data analysis functions
- Metrics calculations
- API integration (mocked)
- Utility functions
Engagement Rate = (Likes + Comments) / Followers Γ 100
Benchmarks:
- 1-3%: Good for large accounts (100K+ followers)
- 3-6%: Excellent for large accounts
- 6-10%: Good for medium accounts (10K-100K)
- 10%+: Excellent for smaller accounts (<10K)
Reach Rate = Unique Accounts Reached / Followers Γ 100
Growth Rate = (Current - Previous) / Previous Γ 100
| Variable | Description | Required |
|---|---|---|
META_ACCESS_TOKEN |
Meta Graph API access token | Yes* |
META_APP_ID |
Meta app ID | Yes* |
META_APP_SECRET |
Meta app secret | Yes* |
INSTAGRAM_ACCOUNT_ID |
Instagram Business Account ID | Yes* |
*Required only for live data mode
Modify config.py to customize:
- API endpoints and versions
- GUI appearance and colors
- Data refresh intervals
- Chart styling options
"API Connection Failed"
- Verify your access token is valid and not expired
- Check that your Instagram account is a Business account
- Ensure all required permissions are granted
"No Data Available"
- Make sure you've fetched data using the fetch buttons
- Try using demo mode to verify the app works
- Check if your Instagram account has recent posts
"Import Errors"
- Install all required packages:
pip install -r requirements.txt - Check Python version (3.8+ required)
- Verify virtual environment activation
"Charts Not Displaying"
- Ensure matplotlib backend is compatible with your system
- Try running:
pip install --upgrade matplotlib - Check if data has been loaded/analyzed
Enable detailed logging by setting:
logging.basicConfig(level=logging.DEBUG)- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Make your changes and add tests
- Run tests:
python test_app.py - Commit changes:
git commit -am 'Add feature' - Push to branch:
git push origin feature-name - Submit a Pull Request
# Clone your fork
git clone <your-fork-url>
cd instagram-analytics
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Run tests
python test_app.pyThis project is licensed under the MIT License - see the LICENSE file for details.
- Meta for providing the Graph API
- tkinter for GUI framework
- matplotlib for data visualization
- All contributors and testers
- Create an Issue for bug reports
- Start a Discussion for questions
- Check existing issues before creating new ones
- Competitor analysis features
- Advanced scheduling recommendations
- Story analytics integration
- Automated report generation
- Multiple account management
- Historical data tracking
- Machine learning insights
- Mobile app version
Made with β€οΈ for Instagram content creators and social media managers