Home Get type of profile in from-field on a post

Get type of profile in from-field on a post

Marcus
1#
Marcus Published in 2018-01-12 09:30:16Z
 I'm getting all posts from a feed by using GET https://graph.facebook.com/v2.11//feed?fields=id,admin_creator,...,from and all works well. But the from-field in a post is a profile and the data returned does not tell me if the profile is of the type user, page etc. Is there a way to get that information? I had a look at this stackoverflow-post and it says I can use parameter metadata=1 to get the type, but how do I use it to get the type for each from-field in the collection returned?
CBroe
2#
 No, adding metadata=1 is not the solution - that only lists what fields are available. But you can for example ask for the fan_count field - only pages have a fan count, users don’t, so from whether that sub-field will be present, you can determine whether you are dealing with a page or a user. (Keep in mind that the fan count might be 0, so a simple if(fan_count) won’t do here.) Syntax would be ?fields=from{fan_count}