skip to Main Content

How to get Facebook fans count using http request in API 2.8

— I test these requests but not working

This return an array but no Fans Count

https://graph.facebook.com/v2.8/{APP_ID}?access_token={ACCESS_TOKEN}&edges=fan_count

Return

{
  "category": "Entertainment",
  "link": {APP LINK},
  "name": {NAME},
  "id": {ID}
}

— This throw an error array

https://graph.facebook.com/v2.8/{APP_ID}?access_token={ACCESS_TOKEN}&fields=likes

Return

{
  "error": {
     "message": "(#100) Tried accessing nonexisting field (likes) on node type (Application)",
     "type": "OAuthException",
     "code": 100,
     "fbtrace_id": "FlkGoTOJ403"
  }
}

2

Answers


  1. Chosen as BEST ANSWER

    Use {PAGE_NAME} instead of {APP_ID}

    GET ACCESS TOKEN: https://graph.facebook.com/oauth/access_token?client_id={APP_ID}&client_secret={APP_SECRET_KEY}&grant_type=client_credentials
    
    GET FANS COUNT: https://graph.facebook.com/v2.8/{PAGE_NAME}?access_token={ACCESS_TOKEN}&fields=fan_count
    

    Thanks for luschn


  2. This is the correct one:

    https://graph.facebook.com/v2.8/{PAGE_ID}?access_token={ACCESS_TOKEN}&fields=fan_count
    

    Not sure why you would use an App for this, Fans are for Pages.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search