Search code examples
androidfacebookfacebook-graph-apiinstagraminstagram-api

How can I get the connected Facebook page id of an Instagram business account programmatically in Android?


How can I get the Facebook page id which is connected to the instagram business account? Is there an Instagram API that is available for it? I have already searched through the Instagram developer documentation.


Solution

  • You cannot get Facebook Page ID from Instagram ID.

    However, you can get the Instagram ID if you have the Facebook Page ID

    GET graph.facebook.com
      /{FB_PAGE_ID}?fields=instagram_business_account
    

    and then:

    GET graph.facebook.com
      /{IG_BUSINESS_ID}?fields=id,ig_id,username
    

    ig_id is the instagram_id, id is instagram_business_id