Graph API - how to get ID of user by username [duplicate] - facebook

This question already has an answer here:
Facebook - "Cannot query users by their username" solution
(1 answer)
Closed 7 years ago.
Facebook API endpoint
https://graph.facebok.com/{username}
stopped work in recent two weeks. Temporarily pages like www.findmyfacebookid.com didn't return proper results, but now they works fine.
How can I grab userId from Graph API now?
I know about stragne workaround with data-hovercard parameter. Manner described here. However, I find it hard to believe that they use such a odd solution especially I know tools which probably use another way and have not outages. Does anybody know more efficient way to get that data? Your help appreciated.

You are not supposed to use the username anymore, only the App Scoped User ID you get after authorizing a User. I assume those tools switched to parsing the Facebook User profile, which is not allowed according to the scraping terms.

Related

Degree of Separation with Facebook API [duplicate]

This question already has an answer here:
Degree of separation
(1 answer)
Closed 8 years ago.
I am trying to fetch degree of separation between users in Facebook API. Similar to the one in LinkedIn. I tried to fetch friends of friends through the Facebook API v2.2, but it didn't work out.
How can I achieve this?
"it did not work out" is not a good description. But anyway, what you are trying to achieve is not possible at all. You can´t get access to "friends of friends", you can´t even get access to "all friends" (first level) anymore. With /me/friends, you only get friends who authorized your App too, for privacy reasons.
See the changelog for more information: https://developers.facebook.com/docs/apps/changelog

How to get the fans of a page I am admin of? [duplicate]

This question already has answers here:
Querying Users who 'like' my Facebook Page
(8 answers)
Closed 9 years ago.
I am admin of a page which has over 1000 likes. I want a list of all my fans. Is it possible to do this ? If yes how ?
I have been checking the facebook documentation and FQL but am not able to figure out anything. Please help.
What I want is a query like "select uid from page where page_id=xyz"+ access_token of the page
I have tried firing a query on the connection table, page table and page_fan table. But am not able to make any progress.
I highly doubt that is possible, and if so it shouldn't.
This is a privacy issue. A facebook page is meant to give you the ability to either connect to people with a common interest or to promote your cause/product/company.
You are able to get insights on your fans via: "https://www.facebook.com/{yourpagename}?sk=insights" which is fine to get some demographic data of your audience.
If you would get a list of your fans, you would basically have a template to send spam mails.
I don't say this is what you are trying to do, but if you could - everybody could.
This answer isn't very good, I know. But as far as I could research it there is no way to do that.

Automatic 'like' after logging in via Facebook [duplicate]

This question already has an answer here:
How can I use the Facebook Javascript API to automatically make a user like a page?
(1 answer)
Closed 9 years ago.
I've been googling for days. I have a read a lot of documentation, forums etc, but I haven't found a working solution.
I am trying to add 'like' to the page https://www.facebook.com/Superawesometest on behalf of the user after he/she has logged in via facebook. I recieve all the necessarry permissions and an access_token.
but using $facebook->api("/Superawesometest/likes", 'post'); wouldn't work
what am I doing wrong?
Try using the Superawesometest page's Page ID instead of the name "Superawesometest" in the API path

Retrieve list of facebook pages with a specific application installed [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Can I get a list of Pages that have installed my Tab app?
I'm trying to get some table where i can find the information that relates the application with the pages where the application page tab appears, i'm using Facebook API, but i don't know where to get that tables or info that i have so much need of , I've surfed this pages with no result so far:
http://developers.facebook.com/docs/reference/api/page/
http://developers.facebook.com/docs/reference/fql/application/
http://developers.facebook.com/docs/reference/fql/page/
I intent to use a query using fql to retrieve that, or anything else you think will work.
Please help.
There isn't a direct way to do this with FQL, however the Pages API (via Graph API) has a solution for you here: https://developers.facebook.com/docs/reference/api/page/#tabs
You can pass in /PAGE_ID/tabs and it will return an array of the page's tabs including each app ID.

How to show my Facebook page questionn poll in my website?

I spent a couple of hours reading Facebook developers docs and trying to figure out if there is a way to show my Facebook page question poll in my website somehow - I still don't have an answer...
Does anyone know if it's even possible?
It is possible, but not trivial.
If you just want to display the question, answers and current results, you'll need to:
Gain a valid access token for the profile that hosts the question with user_questions permission.
Make a call to the API at https://graph.facebook.com/PROFILE_ID/questions using this access token, and
Parse the JSON object that is returned and display this on your site.