Asynx Pvt Ltd logo
Solutions

Solution: Instagram Graph API - Comments Data Returned with Empty Data (No Verification Required)

If you're working the comments section of Instagram Graph API and stuck where the comments endpoint returns empty data. Well you're not alone. This is a common issue every newbie to Graph API face.

Asynx Pvt. Ltd
Share:
Solution: Instagram Graph API - Comments Data Returned with Empty Data (No Verification Required)

The Problem

White making requests to the Graph API for media comments retrieval (e.g. GET /{ig-media-id}/comments) , the response comes back empty like this:

You might have already followed:

  • Used a Businiess or Professional account.
  • Embed URL with correct scopes.
  • Verified that the media contains comments.

Yet, still… no data.

Solution

This often overlooked issue is from the one simple reason:

Your Facebook App is in Development mode


When the app is in development mode (which is the default), it can only access test data from Instagram. Live data fetches need the app to be in live mode.

To Fix this:

  1. Go to Facebook for developers
  2. Navigate to your app.
  3. Under the App Settings -> Basic, fill in:
    1. Privacy Policy URL (e.g. https://pepper.mrbotz.com/privacy-policy )
    2. Terms of Service (e.g. https://pepper.mrbotz.com/terms-of-service )

4. Then, switch you app into the Live Mode.

Default Settings (App in development Mode)

After (Turn on to Live mode):

⚠️ No App review or verification is required to access your own business account's comments since you should have already added the Instagram account into test user for that particular application, However for the users to use it is necessary to submit the application for a review so make sure the privacy policy and TOS are valid and proper while submitting for the verification to Meta.

Final Notes

  • The solution works for the first party usage where Instagram account is added as test user.
  • If you plan to access data from other users, you will need to go through the APP verification process with a proper Privacy Policy and Terms of Service URL.

Share this post with anyone who is new to Instagram Graph API - it might save hours of debugging.

Contact us to build a web app with meta API, X API, Linkedin and other social media's.

Tags

#Instagram Comments empty array

#instagram graph api comments data returned with empty data

#/{ig-post-id}/comments returns empty data

#IG /comments endpoint returns always empty data

About the Author

Vijayaraghavan

Vijayaraghavan

Founder & Director - Asynx Pvt. Ltd.

[@portabletext/react] Unknown block type "undefined", specify a component for it in the `components.types` prop