skip to Main Content

I need to get the facebook page like count without user login. I want to show the count on my webpage. I don’t want an FB Button, need to show the count only. I saw that several people are using graph api, But I think it requires an accesstoken, so it also required to login by the user. I don’t want that kind of stuffs. Guys help me with a solution. I will also trying, if I get a solution before, will comment here.

2

Answers


  1. GET Request + Regex

    To get pages likes you can perform GET request to this Facebook link with your page:

    http://www.facebook.com/plugins/fan.php?connections=100&id={PAGE_ID}

    and then find the like count with regex.

    Login or Signup to reply.
  2. This would be the API call:

    https://graph.facebook.com/[page-id]?fields=name,fan_count&access_token=[any-access-token]

    The response (JSON):

    {
      "name": "xxx",
      "fan_count": 216,
      "id": "xxx"
    }
    

    About Tokens in general:

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