Facebook API page_impressions/page_storytellers by age_gender return empty array - facebook

i am currently working with the Facebook API pulling data for an analytics platform, i have managed to retrieve everything Facebook has to provide but when it comes to
332405516848997/insights/page_impressions_by_age_gender_unique
332405516848997/insights/page_storytellers_by_age_gender
332405516848997/insights/page_storytellers_by_country
the following calls return :
{
"data": [
],
"paging": {
"previous": "https://graph.facebook.com/332405516848997/insights/page_impressions_by_age_gender_unique?since=1374763564&until=1375022764",
"next": "https://graph.facebook.com/332405516848997/insights/page_impressions_by_age_gender_unique?since=1375281964&until=1375541164"
}
}
My access token has the required permissons (manage pages, read insights).
I am using the Facebook Graph API explorer.
Any help would be greatly appreaciated.
Thanks in advance.

After digging to the earth's core and back i stumbled upon the following :
Note: That start and end dates can be applied using since and until unix timestamps based on midnight in PST described in UTC.
Turns out it was the midnight pacific time range that was causing the issue.
Docs

Related

Facebook graph api me/events returns blank

I'm using the Graph API Explorer and have given permissions for user_posts, user_likes & user_events.
me/posts and me/likes return non-empty data, but me/events returns this:
{
"data": [
]
}
I do have ongoing and upcoming events (interested) and they are visible on my Facebook profile.
Any idea what's going wrong? Or is it a Facebook bug?
https://developers.facebook.com/blog/post/2018/04/04/facebook-api-platform-product-changes
Testing of our more robust process starts today and the new process
should resume in a few weeks, but apps currently accessing Events and
Groups APIs will lose access today.
This may also be interesting for you: https://developers.facebook.com/docs/graph-api/changelog/breaking-changes#events-4-4

Facebook analytic export always return "SCHEDULED" when call check status

Im new on getting with facebook api. When i try to use facebook analytic export API, i got FBID then I query status but it always return "SCHEDULED" status, on facebook api document, they said it will take about 1 -> 2 hours, but it waiting for about 3 days but it not change.
This is API link:
https://developers.facebook.com/docs/analytics/export/
This is a example of request i made in today at 2017-10-09 04:10 UTC
"data": [
{
"id": "352212478559555",
"start_ts": "2017-10-07T08:00:00+0000",
"end_ts": "2017-10-07T09:00:00+0000",
"status": "SCHEDULED",
"column_names": [
.....
}
Anyone faced with this problem? i already searched on google but no luck :(
This problem have been resovled. I have sent support ticket to facebook and problem is facebook export system too busy and it have delay time.

Facebook graph API does not return any metric from two days

I have been using graph API since june 2017 but from past two days its giving empty data for all metrics.
Does anyone know whats wrong with API??
{
"data": [
],
"paging": {
"previous": "https://graph.facebook.com/v2.10/pageid/insights?access_token=pageToken&pretty=1&since=1506495600&metric=**page_fans**&until=1506582000",
finally the query got resolved and now the data is coming smoothly.
Don't know how the read_insights permissions got removed for the app associated with my page.
gave the read_insight permission again and the code is running very well now.

How to get results from Facebook Insights API

I'm trying to get useful data from the Insights section using the the Graph API Explorer.
I've tried different metrics and dates, and the results for data is always empty.
I was able to look at my page dashboard for number of likes and select a range based on that, but I still don't see any data.
If the access_key is an issue, would it return an error saying so, or just return empty results?
Here is the debug output from a popular company that I would imagine has new likes in the past few weeks.
=== Query
curl -i -X GET \
"https://graph.facebook.com/v2.8/14226545351/insights/page_positive_feedback_by_type?since=1487788679&until=1490812690&access_token=<access token sanitized>"
=== Access Token Info
{
"perms": [
"user_likes",
"manage_pages",
"pages_show_list",
"public_profile"
],
"page_id": 167544343274096,
"user_id": "10152810337959467",
"app_id": 145634995501895
}
=== Parameters
- Query Parameters
{
"since": "1487788679",
"until": "1490812690"
}
- POST Parameters
{}
=== Response
{
"data": [],
"paging": {
"previous": "https://graph.facebook.com/v2.8/14226545351/insights?access_token=<access token sanitized>&pretty=0&since=1484764668&until=1487788679&metric=page_positive_feedback_by_type",
"next": "https://graph.facebook.com/v2.8/14226545351/insights?access_token=<access token sanitized>&pretty=0&since=1490812690&until=1493836701&metric=page_positive_feedback_by_type"
},
"__debug__": {}
}
=== Debug Information from Graph API Explorer
- https://developers.facebook.com/tools/explorer/145634995501895/?method=GET&path=14226545351%2Finsights%2Fpage_positive_feedback_by_type%3Fsince%3D1487788679%26until%3D1490812690&version=v2.8
Is anyone able to give an actual working example? I have not come across any yet.
I discovered in the Graph API explorer, when you generate an access token, you need to give it permission "read_insights".
Also, this will only work on a page which your account has access to that given object.
Unfortunately the documentation is pretty vague in this area and there was no permissions error message give.
This might be a bit late, but better late then never I guess :)
On this Facebook docs page you can find a list of all the metrics you can use.
As for empty data, I had the same problem. I could never find how to get data from Facebook Insights; but thanks to the cheatsheet, I can give you an example:
Facebook Insights Example
https://graph.facebook.com/{page_id}?fields=insights.metric(page_fans)&access_token={access_token}
EDIT
Also, user Ravi Patel has a great, working example showing how to get insights from your posts:
/{page-id}/posts?fields=insights.metric(post_impressions_fan,post_engaged_users)
Original question

getting insights about a page

I am trying to get the page insights.. the only metrics being shown are page_fans_country and page_storytellers_by_country. For rest of the metrics the following output is coming
{
"data": [
],
"paging": {
"previous": "https://graph.facebook.com/22754734656/insights/page_fan_adds?since=1364712822&until=1364972022",
"next": "https://graph.facebook.com/22754734656/insights/page_fan_adds?since=1365231222&until=1365490422"
}
}
Even if there is no addition in the no of fans '0' value should come as the output.. I am stuck.. Please help
Thanks
I know that it won't answer the question correctly but...
Those insights are public so you just need an App, Page or User access token to request them.
However, Facebook is struggling to have its insights working properly. They use to be 3 days delay, now it's 5 days sometime. And now for few days it's not returning anything if you don't specify the date range. ie:
/cocacola/insights
is not returning anything but sometime it is (latest insights)
To fix it few weeks ago I've read that specifying the metric would do it, and yes:
/cocacola/insights/page_fans_country,page_storytellers_by_country
But now it's not anymore. The only thing working is if you specified since and until
ie: /cocacola/insights?since=1368503760&until=1368662399
But it's really a pain in the *** because you need to know which date is the latest available before to query your insights.
Facebook API sucks!