how to get members' info by using group id in facebook? - facebook

Here is a group A. I want to extract the members' group information as the training data set.
For example, group A has a list of 400 members and each member joins a number of different groups.
How can I get the members' information from the group? Can I get members' information by simply using the group id?

You can query the group endpoint using the graph api...
https://graph.faecbook.com/GROUP_ID/members
This will return (quoting facebook docuemntation) :
All of the users who are members of this group (can only currently return the first 500 members).
You will have to use a valid access token and you will only be able to retrieve one if you are administering the group.

Related

Microsoft Graph query parameter

I use the below query to list all Microsoft 365 groups from our tenant. I would like to add one more filter so that it should only return the groups which have a guest member (Usertype eq 'Guest') in it. Could someone please help
https://graph.microsoft.com/v1.0/groups?$filter=groupTypes/any(c:c+eq+'Unified')
Unfortunately there is no such filter to do what you are proposing, you will have to get a list of groups, then use that to query the List members endpoint /groups/{id}/members https://learn.microsoft.com/en-us/graph/api/group-list-members?view=graph-rest-1.0&tabs=http . then make your own list.
so to summarize, first run your query, get the guids for each group, then grab the members from each group and do some filtering on the client side for usertype.
In theory group/members filtering is possible as of a few weeks ago, with a query like this: https://graph.microsoft.com/beta/groups/{id}/members?$count=true&$filter=UserType eq 'Guest'
https://microsoftgraph.uservoice.com/forums/920506-microsoft-graph-feature-requests/suggestions/35630488-enable-filter-on-group-members#%7Btoggle_previous_statuses%7D
note that you need to put in a custom request header of consistencylevel as per the docs.

How to get Facebook group member count in html document?

I want to get the total number of members count of my fb group in a HTML document tag (div) which I admin. Need the complete code where I can replace only the ID and APT secret.
This is not directly possible because the Group object in the Graph API doesn't have a members count field. You could iterate through the members list though...
See
https://developers.facebook.com/docs/graph-api/reference/v2.3/group
https://developers.facebook.com/docs/graph-api/reference/v2.3/group/members/

How to get group info of a user

I get a user's JID,i want to get the group info that the user has joined by user JID.
Can someone help me ?Please.
Depending on which storage type you are using in there (CoreData/Memory) - the 'groups' field on the user (XMPPUserCoreDataStorageObject) is a 1:m relation to the groups (XMPPGroupCoreDataStorageObject) of that user, and each group also has a 1:m relation to users (group.users).
So you should be able to get the user object via the jid of that user ([xmppRosterStorage userForJID:jid ...]), and from there, get the groups (user.groups).

Use Facebook API to list group members' join date and inviter

I can use the Facebook Graph API to get a list of group members. The simplest way to do this is to go to the Graph API Explorer and do a GET request of the form {group_id}/members. Is there a way to similarly obtain the members' join date and who they were invited by?
The relevant Graph API doc doesn't seem to mention it. But I know the information is stored by Facebook because it is possible to list all of the group members and their inviters through Facebook itself. Is there a way to get this information through the API?
EDIT: Nothing in the FQL group or group_member API either.
While this information is not available on the API, you can get it by using Selenium to scrape the members page.
First, instantiate a driver and use it to get the members page:
driver.gethttps://www.facebook.com/groups/your group number/members
Then, look for the member information:
containers = driver.find_elements_by_tag_name('td')
Finally, iterate through the web elements, extracting text and parsing resulting list for joined date information:
member_info = container.text.split('\n')
name = member_info[0]
member_since = member_info[-1]
You'll still have to map this information to the user ids, which you can do by looking for another element in the container and using REGEX.
`def parse_id(self, container, name):
hovercard = container.find_element_by_link_text(name).get_attribute('data-hovercard')
regex_id = re.compile('php\?id=(\d*)')
member_id = regex_id.search(hovercard).group(1)
return member_id`
It is indeed stored by Facebook and retrieved for use with internal APIs. For the Graph API however it is not possible to get this information.
All the fields available for a group_member are listed at SELECT column_name FROM column WHERE table_name = "group_member"

Facebook Ads API query to pull the adgroup my campignId and the adstats that suprrort them at the same time

I am running the query below and it is returning all of the the adgroups associated with this campaign ID which is provided, I am wondering would it be possible for me to get the ad-statics using the same query for all of the adgroups provided. if so how would i go about doing this. Please take into account I want the data to return all of the data for the adgroups and the statistic for that adgroup
act_10188168/adgroups?end_time=2013-06-02&start_time=2013-06-01&campaign_ids=[60074688]
You need us the adgroupstats API with the list of ad ids received from the previous query.
https://graph.facebook.com/act_{ad_account_id}/adgroupstats?adgroup_ids=[JSON-encoded array of ad group IDs]