I want to make a request to search for 'customized' things, like: Restaurants nearby (see screenshot here)..
Another example is: Music my friends like, in the Graph API explorer, if I query music, I just get what I like, not my friends'. Any tip? tks.
me/friends?fields=music
will give you the music interests of your friends
and for nearby restaurants you will have to execute a complex query like
search?q=cafe&type=place¢er=37.76,-122.427&distance=1000
Refer to this page for search types
Related
how can i extract name list && phone numbers of the users liking certain page ?
I have tried using software called facepager but i couldn't extract names .
note:I'm not the owner of the page
You'd most likely have to write code yourself to do something like this. However,
Almost no-one publicly shares their phone number.
Facebook try to prevent this kind of data collection.
Even when facebook list's "likers" of a page, it'll wait till you scroll down to load more. You'd have to play with your browsers debug tools and look into where it get's that data from
https://www.facebook.com/search/<group id here>/likers
In the end you'll probably not get much better than just searching for the page and clicking each person's profile because the site is designed to not let what you're trying to do happen...
I'm doing a query of this form:
https://graph.facebook.com/search?q=Beshoff&fields=likes,checkins,products,name,talking_about_count,description,category&type=place¢er=37.327453,-121.813102&distance=400
I am interested in finding out the exhaustive list of fields that can be selected for a Place object.
In particular, on the facebook page for a specific place, there are often multiple categories listed which I have been unable to figure out if it's possible to retrieve using the Graph API.
e.g. On https://www.facebook.com/BeshoffInfiniti, there is an entry "Car Dealership" but the graph api call above returns "Local business".
If you leave out the "fields" attribute in your query you will get all the fields. The number of fields depends on the object type (for example owned pages vs. wiki pages)
Don't just look at the Graph API. Take a look at FQL. There are different fields available in FQL vs. the API. And yes, using the distance function you can look for places in an area.
Graph API != FQL
One thing to try is the Facebook Open Graph schema entry for Page and Place.
You'll find all the additional fields for Pages. You can think of places as a subclass of pages.
If you're curious about the types of page that might be returned, try having a look through the create a page flow.
Is there anyway to determine if an object in Open Graph has been liked?
The documentation seem to imply that I have to post a like action on my object and expect an Error 3501 when it has been liked before.
From an UI pov this doesn't make sense, I want to change my like button ui to an "unlike" state without having to like my object and see if it fails or not.
Thanks!
If you're looking specifically for likes on an Open Graph Object (as in the target of an Open Graph Action), and you're talking about built-in (og.likes) likes, Shawn's answer is mostly right, but you need to look in a different FQL table.
An Open Graph Object is just a URL that resolves to a page that has og:type meta in its header. Facebook treats these as link objects (you can check this with SELECT type FROM object_url where url='http://url.to/your/object')
You can find interesting information in the link and link_stat FQL tables, but what you're looking for is the join table where Facebook relates user likes to links: the url_likes table.
So, to tell if the current user has liked a given Open Graph Object, you'd use:
SELECT user_id FROM url_like WHERE user_id=me() AND url='http://url.to/your/object'
If you get a value back, the current user has already liked it. If you get an empty array, the current user has not liked it.
To my knowledge, there's no way to do this with the Graph API, only FQL. I'd love to be proven wrong, though.
Depending on the object, if the object has a like connection you can user the graph api to determain if current user has liked the object.
i use fql in a similar fasion to check if a user likes a post.
/fql?q=SELECT+user_id+FROM+like+WHERE+post_id=\''.$postid.'\'+AND+user_id=me()
refer to post / like https://developers.facebook.com/docs/reference/api/page/
I can drop a message and share a link to someone's wall using Facebook graph API.
However as if in http://www.facebook.com/permalink.php?story_fbid=114961875194024&id=7901103 , I want the names as a link. How can I achieve this? Thanks.
First, retrieve your friends like this:
https://graph.facebook.com/me/friends?access_token=2227470867|2.EHCI04eO2X4n4cxQlvnS2Q__.3600.1305194400.0-100001037215362|3ABwjZygEj8OZS2247vzgDoLyr4
Now, you only have to pair the names with their IDs like this:
FRIEND_NAME
If you want to make a function that transforms a text with Friends names use regular expressions.
I would like to know if there is a free api that would allow me to get restaurant information for an android application. The Application is supposed to search for nearby restaurants and display to the user. The problem is that there are some criteria that the restaurants must satisfy. The specific information I need is: location, type of food (mexican, italian, burger, etc.), type of restaurant (sit-down, fast food, buffet, etc.). Would there be any api that would give me these information? I know that I can use apis like Google custom search but the problem is that the result may not include all the information I want to have on every query( type of food, type of restaurant...)
thanks
As mentioned, the Yelp! API allows you to filter based on a lot of categories. The other alternative would be the Google Places API, but that doesn't give you the sort of contextual information about the restaurant that you want.