List of Facebook Users Containing a Particular Name - facebook

I wish to use the Facebook api to return a list of users contain a particular name:
For example, the following http search for the name Macallum:
https://www.facebook.com/search/results/?q=Macallum&type=users
gives the desired result. However I wish to do this using the api. Is this possible?

Have a look at the answer I gave here: Is it possible to retrieve list of public facebook profiles through the Graph API?
You can use the /search endpoint to search for names.

Related

Facebook Graph API: search people by city

I'm trying to find people either from particular city or who live in that city. Is there an API for this purpose?
When I use Facebook page, I can type in "People who live in Rome, Italy" (which is translated to URL https://www.facebook.com/search/115353315143936/residents/present) and it shows me all people who currently live in Rome. Using web page I can also search people by name and then add additional filter by city.
Can I do something similar with Graph API?
You can only search by name with the API: https://developers.facebook.com/docs/graph-api/using-graph-api#search - there is no way to get the same kind of search than on facebook.com.
you can add center and distance in the query
this comes from the documentation, you can change the type to type=user
GET graph.facebook.com
/search?
q=coffee&
type=place&
center=37.76,-122.427&
distance=1000

Query for pages of a specific type on Facebook

I need to have something like http://fanpagelist.com/category/musicians/ in my web app.
Basically I need to allow users to search through Facebook pages of musician/band category and sort by number of fans.
The closest I got was with this FB Graph API call:
search?q=musician&type=page&limit=25&after=MjQZD&fields=name,fan_count,category
But that is searching for pages that have 'musician' in the name, not in the category field.
Any idea? It must be possible since fanpagelist can do it...
There is no way to filter the results from that search endpoint directly.
You are limited to the options described under https://developers.facebook.com/docs/graph-api/using-graph-api/#search, and that basically means you can search by name, but nothing else.
So you will need to filter the results on your end.

How to retrieve a list of facebook pages with a given keyword using facebook graph apis?

I want to get a list of facebook pages which has a given word in it's description or name. Is it possible to get it from existing facebook graph apis.
yes it is available
use this:
search?q=Your_keyword&type=page
https://developers.facebook.com/tools/explorer/?method=GET&path=search%3Fq%3DYour_keyword%26type%3Dpage&version=v2.10#
for more options go here:
https://developers.facebook.com/docs/graph-api/using-graph-api/#search
you can also extend as many options you need like this:
search?q=Your_keyword&type=page&fields=id,name,location

Searching for open graph objects using substring matching

When I want to search for an open graph object, I use an URL like this
http://graph.facebook.com/?ids=platform
In this case, I was searching for platform.
Are wildcards possible? I want to do substring searches.
The /?ids endpoint is not for searching. It tries to resolve the given parameters (url (primary use), page name or object id), not more and not less.
See
https://developers.facebook.com/docs/graph-api/reference/v2.3/url
/?id={url} Represents an external URL as it relates to the Facebook social graph - shares and comments from the URL on Facebook, and any Open Graph objects associated with the URL.
Use the /search endpoint instead, although there's no option to search for OpenGraph objects.
See
https://developers.facebook.com/docs/graph-api/using-graph-api/v2.3#search

Given a Facebook app's page/id, how do I find how many "likes" that app has?

farmville/frontierville/etc
How do I figure out how many "likes" these apps have?
The graph API does not work with apps.
The graph api below will show all the information related to the app
https://graph.facebook.com/159616034235/
result:
Call
https://graph.facebook.com/APP_ID
Try this example call in Graph Explorer:
https://graph.facebook.com/farmville
which will return a JSON reponse with id, name, picture, link and then likes as 5th value.
You can get the number of likes from Graph API by querying by Application id or Application namespace.
https://graph.facebook.com/APP_ID_OR_NAMESPACE
You can also limit results to be only constructed from id of an application and likes by using fields argument in URL:
https://graph.facebook.com/APP_ID_OR_NAMESPACE?fields=likes
Beware that not every application have a namespace defined and because name of application is not unique, it's better to use id of application to retrieve details from Graph API
You are wrong. The graph API does not work with apps.
http://www.facebook.com/dominodraw/
takes me to 'page not found'. So, dominodraw is not a valid facebook username.
Try graph.facebook.com/<your_app_id> and it will get likes for your app.
p.s. Just in case you are confused.
farmville is not only the name of app, but also they have registered farmville as facebook username.
So, they can do https://graph.facebook.com/farmville along with graph.facebook/208633805894647
If you havent set username for your app, you can only call graph api by app_id.