Specify certain values with Facebook Graph request - facebook

I was wondering if there's a method to specify certain values of for instance "story" or "name" field when doing a request to the facebook graph. What I'm looking for is something like the following:
/{id}/feed?q={bla}&type={story}
Where I want to check a specific person/page's feed on a certain string of text within each story returned.
Hope you can help me out.

No, that is not possible.
Filtering and searching capabilities of the Graph API are very rudimentary.
When any endpoints support additional parameters of that sort, it is usually mentioned in the documentation.
But there is no way to filter a person’s or page’s feed for specific story types and message contents.

Related

Is there a way to get custom conversion data for each ads through Facebook marketing API?

Found this https://developers.facebook.com/docs/marketing-api/reference/custom-conversion/
but it doesn't help me.
I'm trying to get the 'custom conversion' data for each ads but according to the ref. above I can the number for each custom conversion (not separate for each ads).
Any idea ? :)
The link you gave describes the custom conversion object itself (not related to any ad). For individual ad's conversion data you would look at the insights:
https://developers.facebook.com/docs/marketing-api/insights/v2.9
Specifically, query the actions field and filter by action_type (refer to the filtering parameter on insights for how to do filtering https://developers.facebook.com/docs/marketing-api/insights/parameters/v2.9)
And this answer has a concrete example:
Facebook Marketing API Select Fields

How to get responses and comment attachments with Graph API

I am working on capturing Facebook page, event and group feeds with the Graph API. It's for a research project for my master studies. With these lines in the Graph API Explorer
{page-id}/feed?fields=from,message,likes,comments,attachments
I can capture the most I need. But the responses on comments and the attachments in comments (like when someone uses images in his or her comment) are still missing. How can I get them with the Graph API Explorer? It would be greet if I can get them within the whole context of the feed, not just when typing in the specific comment-id in the Graph API Explorer. Is there any way to get the needed data?
As https://developers.facebook.com/docs/graph-api/reference/v2.7/object/comments#read explains, it depends on the filter modifier whether you only get the top-level comments (toplevel, default), or all comments including replies (stream)
So if you modify your request as follows, you will get comments and replies on them in one go:
{page-id}/feed?fields=from,message,likes,comments.filter(stream),attachments
^^^^^^^^^^^^^^^
But that will give you all comments on the same level in the data structure, so you won’t know which are replies – so you might want to request the parent property as well; for replies that holds the id of the parent comment. With
comments.filter(stream){parent,from,message,created_time}
you will also get the parent for comments that have one. (Once you’re asking for a specific field, you need to ask for the rest of the fields you want as well.)

Retrurning extra fields using the facebook search API

I'm using the facebook graph API to search for all public business within a certain range based on location. I want to return some extra fields, specifically the 'hours of business' but can't see how I can do this?
`search?q=&type=place&center=-33.8650,151.2094&distance=5000'
I realize you can add extra fields in the graph API tool but that is only for things that you have a connection to. Whereas I want to query all 'public' businesses therefore it looks like I'm restricted to use the search functionality
You can use the fields parameter to specify fields you want to see... search?q=&type=place&center=-33.8650,151.2094&distance=5000&fields=hours

Facebook API Multiple Search Type

Hi and thanks in advance.
I am currently working with the Facebook API, and I want to incorporate the search feature in my system, but the only problem is that I would like to do a search with one or more keywords for one or more type of object.
In other words not only search for posts but also, I would like to be able to search for posts, users and probably even events.
I have tried to put the parameter type like following type='post,user' but it doesn't return anything, the result is empty.
Is there a way to do it? The Facebook API manual doesn't say much about the search.

Facebook Graph API SEO Comments and Profanity Filter

I'm trying to integrate the Facebook comments left on our site in a way in which the content can be crawled by search engines and also for people (although I highly doubt there will be many) who don't have Javascript enabled on their browser.
Currently our Facebook comments are displayed via the use of the Facebook comment social plugin (using the <fb:comments href="MY_URL" num_posts="50" width="665"></fb:comments> tag). This ends up rendering an iFrame (which are mostly ignored by search engine crawlers) so the plan is to render this information and format it with basic HTML. To do this, the comments are pulled using the Graph API - this is then only be displayed to crawlers and people with Javascript disabled.
This all works nicely using the Graph API call (https://graph.facebook.com/comments/?ids=MY_URL), parsing the JSON result and displaying it on the page. The problem is that the <fb:comments> approach filters our results based on a blacklist we have set up on one of our Facebook Apps. The AppId with the relevant blacklist is stored on the page using metadata (<meta property="fb:app_id" content="APP_ID"/>) which the <fb:comments> control obviously must somehow use to filter the comments.
The problem is the Graph API method does not filter any results as I guess no blacklist (or App Id containing a blacklist) is specified. Does anyone know how to specify a Facebook App ID to the API call URL or of another way to not fetch commnents back that violate the terms of the blacklist?
On a side note, I know the debate about filtering content in comments rages on but it is a management decision to implement the blacklist, and one that I have no influence in changing - just incase anyone felt the need to explain the reasons why content filtering is or isn't a good idea!
Any thoughts on a solution?
Unfortunately there's no way to access a filtered list of comments using the API - it might be a reasonably request to have this in the API - you should file a wishlist item in Facebook's bug tracker
Otherwise, the only solution I can think of is to implement your own filter on your side when retrieving and displaying the comments from the API.
According to the Comments plugin documentation the filter on Facebook's side is implemented as a simple substring match, so it should be trivial to implement.
A fairly simple regular expression match should be able to check each comment against a relatively long list quickly.
(Unfortunately, the tradeoff here is that implementing a filter is easy, but you'd also need to write an interface so that whoever's updating the list of disallowed words can maintain the list for both the Facebook plugin, and your own filtering.)
Quote from docs:
The comment is checked via substring matching. This means if you blacklist the
word 'at', if the comment contains the sequence 'a' 't' anywhere it will be
marked with limited visibility; e.g. if the comment contained the words 'bat',
'hat', 'attend', etc it would be caught.
Pretty sure there is no current way of doing this from the graph API, the only thing I can suggest is taking the blacklist and build your own filter