Retrieve Facebook full name and picture from profile url - facebook

I'm trying to make a website with text input for facebook profile url and after procceeding, there should be user's name and profile image shown.
I saw something like that here: http://hackfbaccountlive.com/hack_account.php
(No, I'm not making another fb hack.)
I have been trying for a couple of hours now, and I always need to log in, and it's not working as I want.
Can you help me?

You should go into detail about what you're trying to do, as it sounds suspicious (please do not create a hack site). That being said, this all public information that can be fetched with the following calls:
https://graph.facebook.com/[user_id]
https://graph.facebook.com/[user_id]/picture
https://graph.facebook.com/[profile_username]
https://graph.facebook.com/[profile_username]/picture
You can then use either the UID or the profile username to create the profile URL, which is just https://www.facebook.com/[username_or_id]

Related

Is it possible to use an uploaded file handle to upload to Facebook from the share dialog?

I have a photo sharing web application and one of my requirements is to add a way to quickly share a photo to Facebook.
I have looked at several ways to do this, and the one I like the most is to get an OAuth access token and redirect back to my site. Once they select the image they want to share, I then launch the share dialog window in an iframe:
https://www.facebook.com/dialog/share?app_id=[MY_APP_ID]&display=iframe&href=https%3A%2F%2Fexample.com%2Fsomepic.jpg&access_token=[TOKEN_FROM_OAUTH]
This all works fine, except it shares a LINK to the picture and doesn't actually upload the image and store on Facebook.
So, my next thought was to use my access_token and create an upload session. So, I first create the session at this endpoint:
POST https://graph.facebook.com/app/uploads?access_token=[MY_OAUTH_ACCESS_TOKEN]&file_type=image/jpeg
That returns a session id for me as I expect. I then upload the file through this endpoint:
POST https://graph.facebook.com/[SESSION_ID_FROM_PREVIOUS_STEP]?is_reusable=true&file_length=[BYTES_OF_IMAGE]&data=[IMAGE_DATA_BYTES]
The above all seems to work, and it returns me a "File Handle". Something that looks like this:
4::aW1hZ2UvanBlZw==:ARaQWknagoLiMi1rE4wzsPLLKoWuwj0hpx8Wyv9p7VX0cMvZ0c5qTESqW1qyeb-ejM-BsoIaHcy1DfkEGZhAAaN-7ShSffoRDEZn1kK1IJ00bA:e:1632539894:100624633370919:533575686:ARZVnrjRFvfvQcEYvbw
Now to the point of my question. Is it at all possible to somehow pass the above file handle to the dialog share iframe as opposed to passing it a URL? Something like this:
https://www.facebook.com/dialog/share?app_id=[MY_APP_ID]&display=iframe&attachment_id=4::aW1hZ2UvanBlZw==:ARaQWknagoLiMi1rE4wzsPLLKoWuwj0hpx8Wyv9p7VX0cMvZ0c5qTESqW1qyeb-ejM-BsoIaHcy1DfkEGZhAAaN-7ShSffoRDEZn1kK1IJ00bA:e:1632539894:100624633370919:533575686:ARZVnrjRFvfvQcEYvbw&access_token=[TOKEN_FROM_OAUTH]
I know that attachment_id doesn't work, but is there another way to do this?
It may not be possible, but would make it a cleaner solution that having a link to the images, which may end up changing...
Thanks!
My thoughts so far:
To Post a image with text to a Facebook Page i use this endpoint 'https://graph.facebook.com/{page-id}/photos?url={image-url}&message=your message'
This works fine but to get the {image-url} the image needs to be uploaded beforehand.

How to find my own facebook ID? (not the app-scoped ID)

I used to be able to go to my Facebook profile page https://www.facebook.com/{Username} and replace the "www" for "graph" https://graph.facebook.com/{Username}.
The answer to that used to be my real facebook ID and some other info, but now I get:
{
"error": {
"message": "(#803) Cannot query users by their username ({Username})",
"type": "OAuthException",
"code": 803
}
}
Yesterday I made the exact same thing and it worked, but today it doesn't. Is there any other way of finding my ID? Does it work for anyone?
For finding any facebook group_id or page_id or user_id go to inspect element of page and find these in meta tags.
Group Id
fb://group/Here_is_your_group_id
Profile user_id
fb://profile/here_is_your_user_id
Page Id
fb://page/here_is_your_page_id
graph.facebook.com/{Username} is not available now but lookup-id.com still can find your facebook ID
There are already 3 exact same questions in the last 2 hours. Please use the search function of StackOverflow before posting a question!
You cannot get the username field anymore. This is very well documented in the Facebook docs.
See
graph.facebook.com/username does not work
If you only have your user ID, the simplest way would be to use an online service (like this one: http://getuserid.com) and paste your Facebook username.
If you need the user ID by programming, this is different. You could in this case parse the HTML code of the page (CTRL + U will show you the HTML code of the page) and search for the term entity_id, which is the user ID. You could then use regex to extract the information.
There is no way to get your Facebook ID via the Graph API!
You can use a regular expression to find your Facebook ID. If you paste the source of a profile page (or page/group) inside http://regexr.com/3gi7q it will match the Facebook ID for you.
It is using the following regex to find the Facebook ID:
/fb:\/\/profile\/(\d+)|fb:\/\/page\/\?id=(\d+)|fb:\/\/group\/\?id=(\d+)/;
You can also use the tool i created and just fill in your profile url: https://commentpicker.com/find-facebook-id.php
Go to your Facebook profile and right click on your cover photo, if you copy the URL it should have your Facebook id in it like so. fbid is what you want. I don't there's any AIP for it anymore. Looks like Facebook may be finally phasing it out.
https://www.facebook.com/photo.php?fbid=1512641059003115&set=a.1376251679308721.1073741827.100007717054203&type=1
You can use the sources already identified or you can right click below the navigation bar and view page source. Use your CTRL+F (find) and search for [profile_owner&quot].
The number listed shortly thereafter will be your global ID. It will generally look like this:
[profile_owner":"10000320024513431&quot].
The # is listed multiple times (like 75) in the data and follows terms such as ["profile_id"], ["uid":], and [?profileid=] to name a few.
I always us this tool https://www.graphsearcher.com/ to find my personal facebook ID. Hope can help you.
Head over to here and authenticate with it, you can then use the Graph explorer to get your ID. You'll also need an access token to view the https://graph.facebook.com/{ID} page.
I just tested this for you and it works correct.
I can see FB source and above i can see my FB ID also.
I used https://graph.facebook.com/username and tested with firefox.
Maybe your using it wrong per accident?
It seems like code 803 means no valid username.
Are you really sure you are using a correct username?
You can also try below link to find your FB ID.
http://findmyfacebookid.com/
Good luck mate!

Retrieve facebook id from profile image address

If I only have the facebook profile address (something like https://fbcdn-profile-a.akamaihd.net/hprofile-ak-prn2/c0.0.180.180/1425794_10202604468931708_129792007_a.jpg ) , can I retrieve it's user ID? The aforementioned address is the only information known.
Thanks
Yes.
From the second set of numbers in the file name go to this URL http://facebook.com/10202604468931708
You will see that takes you to a page for that picture. On that page you can see the owner of the picture. Navigate to the profile.
From the profile, change www to graph In the URL.
The resulting page will show the Facebook id of the user.
The second set of numbers is indicative of the profile it originated from.
www.facebookcreep.com is a tool that takes this number and searches for the profile it came from.
Hope this helps people!

Stuck with Facebook like box for months

Never had such problems with any of the software in my life.
I have a facebook page http://www.facebook.com/zelife.ru
and all the time I try to create a likebox code for inserting it on my web-site I see this:
"Could not retrieve id for the specified page. Please verify correct href was passed in."
As far as I understand, I need to get an ID, where should I get it?
Thanks in advance.
Art
The facebook like-box is designed for facebook pages only! You are trying to use your profile, that's why you're getting an error.

Getting facebook profile picture

i need to get the facebook profile picture of anyone by passing their id. But i no need to use facebook API or Graph anything else.. Just i need to give the url with that id.. Is it possible to get the profile picture in this way? I tried in google but i didnt get it. If anyone knows this please respond me...
Well, I think the only options available are:
https://graph.facebook.com/[PROFILE_ID]/picture (You can include this URL inside a tag and it will work).
Scrap yourself the page corresponding to the profile, i.e. http://www.facebook.com/profile.php?id=[PROFILE_ID] and get the URL of the picture there.
I would suggest you to use the first one, because it gives you more flexibility about the picture size (?type=small, ?type=thumbnail, etc).
Edit
Keep in mind that this answer is from 2011, and Facebook makes changes in its APIs frequently.
Apart from using Graph API as already mentioned above (https://graph.facebook.com/[PROFILE_ID]/picture), there are a couple more ways:
FlipTop has a service that pulls up all sorts of information on Facebook users, including direct CDN URLs (e.g. https://fbcdn-profile-a.akamaihd.net/hprofile-ak-snc4/275588_504804917_147319_n.jpg) of profile pictures. (Link to API documentation)
Cloudinary has a similar service, but with hosting thrown in the mix. They do require you to open an account, but it's free. Then you can use their CDN URL format to link to any picture like this: http://res.cloudinary.com/[YOUR_ACCOUNT]/image/facebook/[PROFILE_ID].jpg (Read more here)