Hi I am trying to get the number of likes without using the access token.
I came across this link and tried with different accounts.
https://api.facebook.com/method/fql.query?query=select%20like_count%20from%20link_stat%20where%20url=%27http://www.facebook.com/8daysmagazine%27&format=json
Out of all, only one account, the number of likes returned is wrong, which is 0 when it should be more than that.
http://www.facebook.com/8daysmagazine
I am not sure where went wrong and would like to seek your help. I understand that Facebook fql has been deprecated, but I would like to use this instead of Graph API as I dont wish to create an access token everytime.
Thank you.
Related
I am trying to get the mutual likes using the facebook graph API. But I'm having difficulties, I'm testing using the Explorer Application (https://developers.facebook.com/tools/explorer)
Using the following request:
ID?fields=context{mutual_likes}
But if I use my application it returns only the count as
"total_count": 0
But I know there are mutual likes. In fact, if I use the Graph API Explorer Application, (changing the ID) it works and brings the mutual likes.
Both users I'm testing with are friends in facebook and have their likes public. My app has recently been approved to use the user_likes permission. And maybe I'm missing something, I was hoping you could help me achieve this.
I finally figured out why the request returned only the count as 0. It had nothing to do with making the request server-side.
I managed to get the mutual_likes by having the users also approve the user_friends permission. Even though I wasn't going to use it in the GET request.
Apparently you need both permissions (user_likes & user_friends) if you plan to extract anything from the context fields of a user.
Hope it helps someone else.
I'm trying to get the number of Facebook likes using the API for the page of the organization I work for - https://www.facebook.com/giftoflife. (The number is about 150k.)
https://graph.facebook.com/110653755631234/insights/page_fans simply returns no data (I'm using the correct access token).
What am I doing wrong?
EDIT
I need to use the insights API specifically, as I need to get the likes within a specific date range.
Getting the number of likes for a Page is actually a lot easier, you donĀ“t need the insights for that, and only an App Access Token:
https://graph.facebook.com/giftoflife
You only need a User or Page Token for that if the Page is restricted (age/country).
If you want to get access to Insights, make sure you got a Page Access Token with the read_insights permission. You can debug your Access Token here: https://developers.facebook.com/tools/debug/
I am trying to use facebook graph api to find out if a user has liked a particular page.This is the query I tried
https://graph.facebook.com/user_id/likes/page_id?access_token="my access token"
I tried the same kind of query to find if two users are friends but its returning empty data set even for that.
https://graph.facebook.com/user_id/frineds/user_id
How should I solve that issue?
You can use
GET /v2.2/{user-id}/likes/{page-id}
to find out if a user likes a page. Remember that you need the user_likes permission!
See
https://developers.facebook.com/docs/graph-api/reference/v2.2/user/likes#readmodifiers
For seeing if a user is a friend of another user, try
GET /v2.2/{user-id-a}/friends/{user-id-b}
You need the user_friends permission to do so.
https://developers.facebook.com/docs/graph-api/reference/v2.2/user/friends#readmodifiers
How can i show the wall (feed) of my page to app on facebook? As i see in the page
www.facebook.com/kesha?sk=app_178091127385 and
www.facebook.com/pages/Khanduna-Yengu-Nangsu-Amuktang/187317137978077
I want show the wall(feed) of my page to my app of facebook. Please Help me.
I also try and see graph api as below
graph.facebook.com//feed
But Fail,
Please Help any one.
As I understand your question, you want to take the wall of your page and show the content of that on another page controlled by an app you have made, so that is the question I will answer.
There are a couple of things you need to do.
Facebook now requires you to have an access_token to get that information. You can get this in two different ways. Either you get your users permission to grab an access_token for them, or you create an access_token for one of the admin users with offline_access and manage_pages permissions.
There are problems with both cases:
1: Getting an access_token per user requires people to give permissions to your app which is quite annoying if they just gain access to the contents of the feed.
2: Having one access_token is also a problem seeing as Facebook puts a limit on how many requests you can make per access_token in a given time.
You need to balance these things out if you want the feed to be shown. Which case would you most likely use? If you don't have many users the second case might be the best, but if you go over the request limit no content will be shown and that could confuse your users.
Anyways.. Once you are past the access_token problem, you can access the information by getting the content from the page:
https://graph.facebook.com/YOUR_PAGE_ID/feed?access_token=YOUR_ACCESS_TOKEN.
You then get a nice json output you can use. If you are using the Javascript API you can simply use the information here:
http://developers.facebook.com/docs/reference/javascript/FB.api/
If you are ever unsure how to get the information you need there is a nice tool for that developed by Facebook called Graph API Explorer which you can find here:
http://developers.facebook.com/tools/explorer/
Howdy- I have been tooling around with the Facebook Graph API and successfully retrieved back a list of my likes, and a list of my friends (once I authenticated using OAuth). But what I really want to achieve is pulling back my friend's likes. When I try and do that, obviously using the same URL that I use to pull back my own likes but subbing the friend's user id for "me", I don't get anything back, unless they have installed the app as well. Then I get them no problem. To be clear, I can only see the likes of friends who have installed my application. So clearly I am running into a security/rights issue of some sort.
I could see where this would be the case; you simply aren't allowed to see your friend's likes unless they have installed the same app. Fair enough, but then how is blekko.com doing it? I even tried using FQL without much luck. I suspect I am missing something totally obvious. Anyone had any luck with this? Maybe with the Javascript API or one of the other access methods? Thanks in advance for any guidance.
Your application needs the permission "friends_likes".
Check http://developers.facebook.com/docs/authentication/permissions for more info on the different permissions.
This SO answer might help if you're having trouble with the authentication / permission request process.