Search code examples
facebookfacebook-likefacebook-pagefacebook-graph-api-v2.0

show facebook like's count using page's name


I'm new to Facebook API. How I can display Facebook's page 'likes' using page's name?

For Example, Steptoinstall is the page's name (URL https://www.facebook.com/steptoinstall). If I give this name, can I know the likes count of this page?


Solution

  • This name is actually the unique username of the page. So, you can use this to make the call to the API /{page-username}?fileds=like and you'll get the response as:

    {
      likes: 999999,
      id: "111222333"
    }
    

    Example:

    http://graph.facebook.com/Steptoinstall?fields=likes

    Hope that helps!