Search code examples
facebook-graph-apifacebook-graph-api-v2.6

Facebook Graph API V 2.6 User Type


Is there a way to know if the user info being returned by the graph api explorer is a user's profile or a business page?

The query I am using is: me?fields=feed{from,comments{from}}

which gives me back all the users who have left a comment or a post on my page.

Here is an example of what I would get back for that query:

{
  "feed": {
    "data": [
      {
        "from": {
          "name": "John's Tires",
          "id": "114615108955555"
      }, 
      {
         "from": {
         "name": "John Smith",
         "id": "123615108951010"
          },

Is there something I can add to the query to make it return a user type? For example- type:user or type:page?

I've searched facebook graph api documentation and found nothing. Thanks in advance for your help.


Solution

  • With metadata=1 you get a type in the response for a single top level item, but I don't know how to do it for a list.

    $ fbapi /me?metadata=1 | jq .metadata.type
    "user"
    $ fbapi /BBCQuestionTime?metadata=1 | jq .metadata.type
    "page"