# How to Automate Instagram Comment Moderation using the API

- Tool: API Automations
- Difficulty: Intermediate
- Fix time: 30-60 minutes
- Compatibility: Instagram Business or Creator account required; Facebook Page linked; instagram_business_manage_comments scope requires Meta App Review (2-4 weeks); free API tier
- Last updated: May 2026

## TL;DR

Automate Instagram comment moderation using the Graph API: list comments with GET /{media-id}/comments, hide them with POST /{comment-id}?hidden=true, delete with DELETE /{comment-id}, and reply with POST /{comment-id}/replies?message=. There is no webhook for new comments — you must poll. The instagram_business_manage_comments scope requires separate App Review approval (2-4 weeks). The 200 calls/hour rate limit requires smart polling intervals across multiple posts.

## Best practices

- Prefer hiding over deleting for borderline content — hidden comments can be reviewed and unhidden, while deleted comments are permanent
- Build a state file or database tracking processed comment IDs to prevent re-processing the same comments on every polling run
- Never make fully automated permanent deletions on high-confidence-only content — even the best keyword filters produce false positives
- Poll recent posts (published in last 48 hours) every 5-10 minutes; poll older posts much less frequently (hourly or less) to stay within rate limits
- Log all moderation actions with the original comment text, applied rule, and timestamp — this creates a training dataset for improving rules
- Set up a human review queue for comments that score borderline on your classifier, rather than making automated decisions on uncertain cases
- Test your blocklist and rules against historical comment data before deploying to avoid accidentally hiding legitimate comments at launch

## Frequently asked questions

### Is there a webhook for new Instagram comments so I don't have to poll?

No — the Instagram Graph API does not provide webhooks for new comments. You must poll GET /{media-id}/comments at regular intervals to detect new comments. The Meta Webhooks product covers some Instagram events (mentions, story interactions) but comment webhooks are not available for most Business accounts. Design your polling with smart prioritization (recent posts more frequently) to stay within the 200 calls/hour limit.

### What's the difference between hiding and deleting a comment?

Hiding (POST /{comment-id}?hidden=true) makes a comment invisible to all users except the original commenter, who does not know their comment is hidden. The comment still exists in the API and can be unhidden by setting hidden=false. Deleting (DELETE /{comment-id}) permanently removes the comment — it cannot be recovered. Best practice: hide borderline content first, review it periodically, and only delete clearly harmful content.

### What happens when I hit the 200 calls/hour rate limit?

You'll receive HTTP 400 with error code 17 (User request limit reached). Each API operation — fetching comments, hiding, deleting, replying — consumes one call. For a bot monitoring 10 posts with 50 comments each per run, that's already 10 calls just for fetching. Implement a processed-ID cache so you don't re-fetch already-reviewed comments, and use exponential backoff (starting at 60 seconds) when rate limited.

### Can I automate comment replies at scale?

Yes, but with care. The API allows replies via POST /{comment-id}/replies?message=. Meta monitors for automated or repetitive replies and can flag your account for spam-like behavior. Keep reply messages varied, reply only to genuine questions (not all comments), and limit reply volume to what would be human-realistic for your account size. Also note the 750 private replies per hour limit for business accounts.

### Do I need a separate App Review for comment moderation vs. post publishing?

Yes. The instagram_business_manage_comments scope requires a separate App Review submission from instagram_business_content_publish. Even if you already have publishing approved, you must submit a new review specifically for the manage_comments permission, including a new screencast demonstrating your comment moderation use case. Each review typically takes 2-4 weeks.

### Can RapidDev build an Instagram comment moderation bot?

Yes — RapidDev has built comment moderation systems combining keyword filtering, ML-based spam detection, and human review queues for brand accounts. We handle the Meta App setup and approval process, build the classification logic, and deliver a moderation dashboard. Book a free consultation at rapidevelopers.com.

### Can I use AI (like OpenAI or Claude) to classify Instagram comments?

Yes, and it's much more effective than keyword matching alone. After fetching comments, send each comment text to an LLM with a classification prompt (rate this comment: spam, toxic, promotional, question, positive, neutral) and use the response to drive moderation decisions. LLM classification is especially good at catching sophisticated spam that bypasses simple keyword lists. Budget for API costs: at roughly 50 comments per post and $0.001/classification with a cheap model, the costs are minimal.

---

Source: https://www.rapidevelopers.com/api-automations/how-to-automate-instagram-comment-moderation-using-the-api
© RapidDev — https://www.rapidevelopers.com/api-automations/how-to-automate-instagram-comment-moderation-using-the-api
