Facebook API: get adAccount campaigns by ids - facebook

How to get multiple campaigns insights but filter the campaigns by id.
I find it how to get multiple campaigns and insights in one request:
GET facebookapi/{adAccountId}/campaigns?fields=name,status,insights{impressions,reach,clicks,cpm,cpc,ctr}
But this will return only 25 or I can add a limit of 100 and get the first 100.
What I want to do is to query by campaigns ids. Because I already have the list of campaigns.
Something like that
GET facebookapi/{adAccountId}/campaigns?fields=name,status,insights{impressions,reach,clicks,cpm,cpc,ctr}&filter=id{id1,id2,id3}
Is this possible with Facebook API?

You could pass the filtering params as example:
act_<ID>/campaigns?fields=name,status,insights{impressions,reach,clicks,cpm,cpc,ctr}&filtering=[{'field':'id','operator':'IN','value':[<campaign_id1>,<campaign_id2>,....]}]
Hope this help

Related

How to get my all facebook posts by group ID

As the fql is deprecated for versions v2.1 and higher, So I am not able to access the data using fql. Is there any way to fetch only my posts by group id.
Please correct me, if Im wrong.
You can get all posts of a group via the GraphAPI endpoint
v2.5/{group-id}/feed
Anyways, you are not able to perform this action if you are not "Admin" of the specific group. You need the additional permission of 'user_managed_groups'.
To drill it down to a specific user query against
v2.5/{group-id}/feed?fields=from,message
Then you have have the users' id and the message. Just iterate of the response and filter out by the user of your choice.

Querying a Facebook group

Do you know a way to retrieve the posts of a group given a query as you can see in the image below?-> Query Search example
This example returns us a list of posts related to our query, but we're trying to do that through any API.
So far we've tried this using Graph API getting the feed of the group, but feed doesn't support filtering by a query. Below you can see the type of GET request we're working with.
graph.get('our_group_id?fields=feed.limit(500).fields(message, likes, type, comments.fields(like_count,message))'
We've also tried using SEARCH, though Search is not able to deal with groups, so we can't retrieve the posts of a group based on a query, but some public posts. Finally we've tried also with FQL, but it doesn't appear to support query terms when searching posts of a group.
Thanks.

Facebook: is it possible to get insights of impressions for a specific OpenGraph object?

my app is generating OpenGraph objects for users and I want to give those users analytics for their objects (total impressions, clicks, etc..).
I tried using the graph API to get those insights with https://graph.facebook.com/APP_ID/insights but I don't see how I can filter the results by a specific OpenGraph object.
is it possible to do what I'm looking for?
You can pull, for example, insights data for individual posts as follows:
First, get the list of posts for a page:
/<pageId>/posts
Then for each post get the insights which will look something like this:
/<pageId>_<postId>/insights
Note: It's best to batch call the post insights into one request.

Getting Facebook groups

My project is to get around 1000 Facebook groups and do some analysis of the data collected from those groups. Is there any way to accumulate Facebook group ID's (1000 or less) so that I don't have to manually search for each Facebook group. Is there a query or something that allows me to see Facebook groups based on category, etc?
Maybe I don't understand the question correctly, but facebook has a very convenient api for this:
https://graph.facebook.com/search?q=programming&type=group&access_token=lala
It is on the developer page: http://developers.facebook.com/docs/reference/api/
you can use
Batch requests in Graph API to get more ids at once
see https://developers.facebook.com/blog/post/2011/03/17/batch-requests-in-graph-api/

Possible to get Fan Page Update Information via API?

I receive an email once a week with information on my Fan Page (like how many more users than last update have become my fan, how many posts, etc). Is it possible to get this info via the FB API so I can show this data where I want outside FB and outside my email?
One of the way is using fql of facebook :
Group FQL Table
After you can get the group ids, you can use the group_member tables to get all members from that group:
Group Member FQL Table
You can even use Graph API if you want but I am not an expert of that