-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Add Instagram Business/Creator integration #119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This commit introduces a comprehensive integration for managing Instagram Business and Creator accounts. It includes functionalities for account information retrieval, media publishing (images, videos, reels, carousels, stories), comment management, and insights analytics. The integration is built using the Instagram Graph API v24.0 and includes a configuration file, helper functions, and a complete test suite to ensure functionality. Additionally, documentation has been added to outline features, requirements, and usage.
instagram/tests/context.py
Outdated
| sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) | ||
| sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "../dependencies"))) | ||
|
|
||
| from instagram import instagram |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolved.
- Added noqa comments to suppress linting warnings for unused imports in instagram.py and context.py. - Removed unused List import in insights.py to clean up the code.
- Added 'after_cursor' and 'next_cursor' fields to the configuration schema for pagination in media and comments retrieval. - Updated descriptions to clarify usage for fetching subsequent pages of results.
…dia retrieval - Added support for cursor-based pagination in the `get_posts` and `get_comments` actions. - Updated the README to include detailed instructions on how to use pagination with example requests and responses. - Enhanced the response structure to include `next_cursor` for fetching subsequent pages of results.
- Modified the comment for the actions import in instagram.py to clarify its purpose as registering action handlers.
AlexanderHeffernan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛡️ Pull Request Review
Status: Ready to merge
Blockers: 0
Suggestions: 1
Reviewed: January 05, 2026
The addition of cursor-based pagination significantly improves the utility of this integration for accounts with large histories. The implementation looks clean and is well-documented.
✅ Strengths
- Pagination Implemented: Excellent work adding
after_cursorandnext_cursorsupport. This addresses the previous limitation regarding data access. - Code Quality: The refactoring of imports and addition of
noqacomments shows attention to detail and linting standards.
🟡 Suggestions
- The API version is still hardcoded in
instagram/helpers.py:8. Movingv24.0toconfig.jsonis still recommended for easier maintenance in the future.
🔴 Blockers
- None identified.
This review was generated by Pull Request Reviewer, an AI agent operating on the Autohive platform.
- Introduced a new handler for fetching connected Instagram account information, including username, name, and avatar. - Updated the README to reflect the new feature, emphasizing the display of authorized user's profile info.
TheRealAgentK
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some comments, but overall really nice work!
| ## Rate Limits | ||
|
|
||
| - **Content Publishing**: 100 posts per 24 hours (carousels count as 1) | ||
| - **API Calls**: Scales with account reach — `4800 × impressions in last 24hrs`. For example, an account with 1,000 impressions gets 4.8M API calls/day. Minimum floor of 48,000 calls/day for small accounts. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume this is a rule from IG?
|
|
||
| ## API Version | ||
|
|
||
| This integration uses Instagram Graph API **v24.0**. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's our upgrade strategy and requirement here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be more precise - iirc all Meta Graph-APIs have a kind of expiry and sunsetting pathway - are we getting notifications and/or alerts for these kind of things?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just had a look through our Meta Developer Settings, and it does look like we should receive email notifications about this sort of thing to the engineering@autohive.com email. Otherwise, this is a pretty helpful page: https://developers.facebook.com/docs/graph-api/changelog
Description
Type of change
Updates
👉 Added Instagram Business/Creator integration with 8 actions: account management, content publishing, comment engagement, and insights retrieval
👉 Implemented media container polling system for reliable publishing with support for images, videos, reels, carousels, and stories
👉 Created comprehensive test suite with 20+ tests covering all actions and edge cases, plus updated main README with Instagram integration details
Author(s) to check