FQL how to get the insights for a facebook page - facebook

SELECT metric, value FROM insights WHERE object_id=140902935963424 AND metric='page_fan_adds' AND end_time=1334905200 AND period=86400
HI I have wrote a query to get the fan_page_adds insights but the query did not get executed. I cannot see any wrong with it and i used the facebook page id as the object id. Can anyone help?

Related

Objects I liked in facebook using graph api

I want to find which photo, video, status or other objects I liked in facebook.
Earlier I used fql to search in the like table:
SELECT object_id FROM like WHERE user_id=me() LIMIT 5000
But, in facebook api 2.1, fql is no more supported, so I need to use graph api to replace the above fql.
So, how can I use graph api to get my likes in facebook?
And I need to find who posted those objects also. In fql I used:
SELECT uid FROM status WHERE status_id IN (SELECT object_id FROM like WHERE user_id=me() LIMIT 5000) ORDER BY uid LIMIT 5000
I nee Graph api for the above fql also.
Plese help!
Just call the endpoint "<userid>/likes". This will give you the information. You need the proper permission for it though: "user_likes".

is it possible to get insights for an OpenGraph object?

I want to get insights for a specific OpenGraph object (such as total impressions, clicks, etc..)
I'm getting the object id for the url by using FQL SELECT id FROM object_url WHERE url=......
Once I have the object id, is it possible to get insights for it ?
I tried with https://graph.facebook.com/objectid/insights without too much success..
according to Facebook's documentation, FQL can be used to get insights for a specific story, but I don't have any story ids..
is it possible to get those insights or do I have to store the action id for each generated action and get insights for those recorded action ids ? (btw - is an action id == story id ?)
btw - I'm doing everything with an app access token.

FQL: Unable to read data from insights table

I am trying to access our application's insight data with the following request:
https://graph.facebook.com/fql?format=json&access_token=<removed>&q=
SELECT object_id, metric, value FROM insights WHERE metric IN
('application_widget_comments_views',
'application_widget_comments_views_unique',
'application_widget_comments_views_login',
'application_widget_comments_views_login_unique',
'application_widget_comments_views_logout')
AND end_time=end_time_date('2012-08-01')
AND period=period('day')
AND object_id='10151074438279445'
Access token was obtained as an app access token - Does this mean I don't need read_insights permission?
However I always get back an empty data array. To access insights plugin and domain metrics, what should object_id be?
Fetching data from comment, link_stat tables are working just fine.
Any help would be greatly appreciated.
You aren't getting data because the id you are passing is for a url (a Yahoo Finance url). It seems that application_widget_comments_views... only return data when the object_id is the ID for an app.
Looking through the insights table, it does not appear that there are any ways to get insights for a url other than via the url_like table.
If you've got Facebook comments on a url, you'll need to have the id of the app used to publish the comments and be an admin of the app.

fql query not working for insights

I have tried following queries to get my facebook fan page insights data
SELECT metric, value FROM insights WHERE object_id=2439131959 AND metric='application_active_users' AND end_time=end_time_date('2011-06-26') AND period=period('month')
as well as
SELECT metric, value FROM insights WHERE object_id=111605505520003 AND metric='page_fan_adds' AND end_time=1334905200 AND period=86400
But both are not working. any help will be appreciated . thnks in advance
Make sure your access token has the read_insights permission. Otherwise querying the insights won't return any data.

Trouble with FQL stream_tag

I am trying to retrive posts from a users news feed in which my fan page has been tagged. I'm seaching through stream_tag with FQL but zero results are returned.
Posted a comment on my wall in which I tagged a friend, myself, and my fan page.
Used the Graph API Explorer - developers.facebook.com/tools/explorer/
Used the explorer as one of my apps, and granted every type of permission.
Did the following query:
https://graph.facebook.com/fql?q=SELECT post_id,actor_id FROM stream_tag WHERE target_id = [fan page id]
The following is returned: data: []
This seems to indicate that there is no resaults but I know the tag exists. When I do a query with target_id=me() results are returned, but according to the documentation the target_id can also be a fan page( http://developers.facebook.com/docs/reference/fql/stream_tag/ to craft the query).
How can I create a query that returns posts my fan page is tagged in?
I was trying to do the exact same thing when I came across your post. It looks like there currently is a bug report open that the stream_tag table does not work with when the target is a page.