Skip to content

Conversation

@AlexanderHeffernan
Copy link
Member

@AlexanderHeffernan AlexanderHeffernan commented Jan 5, 2026

Description

  • Purpose: Implement comprehensive Instagram Business/Creator integration for Autohive, enabling content management, community engagement, and analytics tracking via Instagram Graph API v24.0.
  • Approach: Built a complete integration using the Instagram Graph API with support for account information retrieval, content publishing (images, videos, reels, carousels, stories), comment moderation (read, reply, hide/unhide, delete), and insights/analytics. Includes robust testing, helper functions for media container polling, and comprehensive documentation.

Type of change

  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

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

  • Project and all contained modules builds successfully
  • Self-/dev-tested
  • Unit/UI/Automation/Integration tests provided where applicable
  • Code is written to standards
  • Appropriate documentation written (code comments, internal docs)

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.
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
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

AlexanderHeffernan

This comment was marked as outdated.

- 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.
@AlexanderHeffernan AlexanderHeffernan self-assigned this Jan 5, 2026
- 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.
Copy link
Member Author

@AlexanderHeffernan AlexanderHeffernan left a 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_cursor and next_cursor support. This addresses the previous limitation regarding data access.
  • Code Quality: The refactoring of imports and addition of noqa comments shows attention to detail and linting standards.

🟡 Suggestions

  • The API version is still hardcoded in instagram/helpers.py:8. Moving v24.0 to config.json is 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.
Copy link
Collaborator

@TheRealAgentK TheRealAgentK left a 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.
Copy link
Collaborator

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**.
Copy link
Collaborator

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?

Copy link
Collaborator

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?

Copy link
Member Author

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

@AlexanderHeffernan AlexanderHeffernan merged commit dfbb194 into master Jan 5, 2026
1 check passed
@AlexanderHeffernan AlexanderHeffernan deleted the ah/instagram-integration branch January 5, 2026 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants