Use Facebook GraphAPI to collect page data - facebook-graph-api

I know that Facebook that restricted usage of its GraphAPI, but to what extent? I want to collect data from posts of this page (post content, likes, shares, date). Clearly I am not an admin of this page. When I try to do this using {page-id}/feed i get the message
{
"error": {
"message": "(#100) Page Public Metadata Access requires either app secret proof or an app token",
"type": "OAuthException",
"code": 100,
"fbtrace_id": "A0xAYR0R1KdoDf_6h7EPr8O"
}
}
How can i collect the feed data?

The official Facebook documentation gives the answer:
Access to the Public Feed API is restricted to a limited set of media publishers and usage requires prior approval by Facebook. You cannot apply to use the API at this time.

Related

retrive instagram media comments using graph api business discovery

I am using this URL to retrieve information from a third-party business account:
MY_IG_BUSINESS_ACCOUNT_ID?fields=business_discovery.username(digikalacom){media.limit(5){comments_count}}
The trouble is when I include comments in the media query (after comments_count) I get this error:
{
"error": {
"message": "(#100) Please read documentation for supported fields.",
"type": "OAuthException",
"code": 100,
"fbtrace_id": "A8QnXYZlrudpxF8xhdZsSYf"
}
}
The documentation provided for business_discovery doesn't mention anything about the actual list of comments. It only includes comments_count.
Here is the list of permissions I'm using for my app:
read_insights
pages_show_list
ads_management
business_management
instagram_basic
instagram_manage_comments
instagram_manage_insights
pages_read_engagement
pages_manage_metadata
So I cannot say for sure. whether it's a permission problem or IG graph API does not work that way for comments. So any thoughts on how I can get a list of comments for a third-party IG account's media using graph API?
You can only get comments if you have a valid authentication token for the account you are querying. You would use the /media endpoint to get comments, insights, etc:
/MY_IG_BUSINESS_ACCOUNT_ID/media?fields=id,caption,comments_count,children{media_url},comments.limit(50){id,timestamp,username,text},insights.metric(impressions,reach,engagement,saved,video_views)&limit=30

how to retrieve facebook data from a page that is not mine

I am working on automatic language processing, I want to retrieve data from facebook and build my dataset, the problem is that each time I try to retrieve this data, I encounter this problem:
{
"error": {
"message": "(#100) Page Public Metadata Access requires either app secret proof or an app token",
"type": "OAuthException",
"code": 100,
"fbtrace_id": "Azl7f9Wz5PDpX9K-dDIJ3xm"
}
}
I understand that the problem lies in the app token, but the concern is that I cannot get it and I don't know how to do it, is that possible?
Public meta data access does not cover this, the feed of a page is not meta data. You will have to submit your app for the Page Public Content Access feature.
The Page Public Content Access feature allows read-only access to public data on Pages for which you lack the manage_pages login permission.
Documentation on this can be found by clicking this link.

What permissions are needed to call /{page-id}/ads_posts on Facebook Graph API?

I'm trying to list the Ads for a Facebook Page using the Graph API /{page-id}/ads_posts endpoint, but I get a permissions when I try to.
Using the Graph API Explorer, I generate an Page Access Token with those permissions: email, read_insights, manages_pages, pages_show_list, ads_read, business_management, instagram_basic, instagram_manage_insights and public_profile.
I'm an admin on the Page itself, the attached Business Manager and on the corresponding Ad Account.
Every time I try to call the /{page-id}/ads_posts, I receive
{
"error": {
"message": "(#200) Not enough permission to call this endpoint",
"type": "OAuthException",
"code": 200,
"fbtrace_id": "XXXXX"
}
}
I can't find any help on the Facebook documentation or Google, given that the error isn't really meaningful (in some cases, I get a message saying that a specific permissions is missing, but not here). Anyone can help ?
EDIT: I tried to add the ads_management permission too, without success.
You need to add those pages to your app that is in development mode (https://www.facebook.com/settings?tab=business_tools).

Unable to retrieve data from facebook graph url for a page

Check out:
https://www.facebook.com/MitraJyothiorg
It is a page of an NGO.
Correspondingly, I should be able to find data of the page in:
http://graph.facebook.com/MitraJyothiorg
This does not seem to work. Any clues?
Please note: I am doing a simple http call and it usually works for other pages, for example, if i do the same thing for another page:teachforindia
The error message is quite clear:
{
"error": {
"message": "Unsupported get request. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api",
"type": "GraphMethodException",
"code": 100
}
}
You need to add at least an App Access Token. See
https://developers.facebook.com/docs/graph-api/reference/page#Reading
For pages that are published, you need:
An app or user access token is needed to view fields from fully public pages.
A user access token is needed to view fields from restricted pages that this person is able to view (such as those restrict to certain demographics like location or age, or those only viewable by Page admins).
A page access token can also be used to view those restricted fields.
I am not able to access that page (get a 404 error). Maybe the page is still hidden? Then you will not be able to access it via the graph API imho.

Graph API not responding

I am using graph API to get the feed post.
https://graph.facebook.com/128172073865656/feed?limit=200
but it is showing exception
{
"error": {
"type": "OAuthException",
"message": "An access token is required to request this resource."
}
}.
Could any one please help.
Quite simply, you need to obtain and supply an access token with your request.
In particular, the Graph API connections that you're trying to load have been changed recently, and now require an access_token, where they previously did not.
See the Facebook Developer Blog, posts on this:
https://developers.facebook.com/blog/post/509/ - Notification of change in requirements.
https://developers.facebook.com/blog/post/510/ - Confirmation that the changes are now live.