Search users from Facebook Graph API - facebook

I'm trying to search for users on facebook with an app token. Here's the endpoint that I'm accessing with the graph explorer (I've tried both app and access tokens):
https://graph.facebook.com/v2.5/search?q=foo
Here's the error that I'm receiving:
{
"error": {
"message": "An unknown error has occurred.",
"type": "OAuthException",
"code": 1,
"fbtrace_id": "BbsgVF64X28"
}
}
Any idea what I'm doing wrong?

Look at the docs at
https://developers.facebook.com/docs/graph-api/using-graph-api/v2.5#search
You need to specify a type parameter to be able to use the search, like
https://graph.facebook.com/v2.5/search?q=foo&type=user

Related

Issues with Instagram Graph API (Insights endpoint)

Trying to get Instagram insights data through the Facebook API, and keep getting the same error message. I have all the necessary permissions required, auth tokens, etc, and nothing seems to change the response. Any ideas? Here's what I get back:
{
"error": {
"message": "(#100) Tried accessing nonexisting field (insights) on node type (InstagramUser)",
"type": "OAuthException",
"code": 100,
"fbtrace_id": "A7sn36A6aleX86dUNqQa3kx"
}
}
Appreciate your help!

Query Search FB with postman

i'm trying fb query search on postman
https://graph.facebook.com/pages/search?q=Facebook
&fields=id,name,location,link
&access_token={access-token}
and it returns this error
{
"error": {
"message": "(#100) Page Public Metadata Access requires either app secret proof or an app token",
"type": "OAuthException",
"code": 100,
"fbtrace_id": "A0DGbr5CxQEimI0NDK9UyZj"
}
}
how do i fix this error? i'm new at consuming social media API, and i've got standard apps on developers.faceboook.com

Scraping facebook posts

I want to scrape facebook posts with certain keywords, for example "coca-cola".
Graph api search endpoint (/search?q=coca-cola) does not work, it's returning error like
{
"error": {
"message": "An unknown error has occurred.",
"type": "OAuthException",
"code": 1,
"fbtrace_id": "HRj+AhMuMHw"
}
}
I know, that it is also possible to scrape data with selenium using this endpoint: https://www.facebook.com/search/str/coca-cola/stories-keyword/stories-opinion, but I think browser will hang out when DOM tree will be very large. So, is there any other way to do this?
Thank you in advance.

Facebook Graph API - How to read posts privacy

I read the example of Graph API document at this: https://developers.facebook.com/docs/graph-api/reference/privacy/, and try to get the privacy of specified post but no luck. The link I tried is:
https://graph.facebook.com/me/?fields=value&access_token=<my token>
Response:
{
"error": {
"message": "(#100) Tried accessing nonexisting field (value) on node type (User)",
"type": "OAuthException",
"code": 100,
"fbtrace_id": "DSUBZSZdJT8"
}
}
Please help me.
The error message is very clear, there is no field called "value" in the user table - which is exactly what you are trying to access with the /me endpoint. This would be the API call to get the privacy setting of a specific post:
https://graph.facebook.com/{post-id}?fields=privacy{value}&access_token={user-token}

Get facebook album give error code 100

I use simple app but cannot understand next:
Opened 2 urls:
https://www.facebook.com/media/set/?set=a.675416519138045.1073741830.660049570674740&type=3
AND
https://www.facebook.com/joyasmariajose.valdivieso/media_set?set=a.383620231706322.80737.100001750452794&type=3
When I use Graph Exploder:
GET \675416519138045
return all information about album in this user
But When I try
GET \383620231706322
I can get only user_id and name. On the album have next error:
{
"error": {
"message": "Unsupported get request. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api",
"type": "GraphMethodException",
"code": 100,
"fbtrace_id": "Hb9lKBi2Wpz"
}
}
Question: What can be wrong with second url ?
Unsupported get request usually means that you can't access that resource without an Access Token, i.e. you don't have permissions to this object, as #CBroe said.