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"].
The number listed shortly thereafter will be your global ID. It will generally look like this:
[profile_owner":"10000320024513431"].
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!
Related
Seemingly simple question but I found no obvious answer so far.
I logon to Facebook.com using my browser. I go to the search bar, type in 'Obama'. Then Select 'Public Posts' on the left hand side bar, which starts listing all PUBLIC posts. I pick up one of the posts that shares a like/photo and has a URL like this : 'www.facebook/com/story_fbid=&id=. I figure out that abc is the user_id and xyz is the object_id. This also means that the post_id is abc_xyz.
Then I go to the graph.facebook.com API explorer, generate a user access token, then type this query:
https://graph.facebook.com/fql?q=select post_id from stream where
post_id="abc_xyz"
NOTHING.
I even try
select link_id from link where link_id in ("xyz", "abc_xyz")
still NOTHING.
So, What is happening here? Some posts on StackOverflow talk about how facebook's public posts are not truly public - BUT, there is no reference to this in the official FB documentation.
Then, I tried creating a new account, creating post on my wall, making my wall posts public, then I tried the same queries as above, and yet again NOTHING (just an empty dataset).
Guys, are there any official explanations to this behavior? When I am logged in as user, I AM NOT an APP!/ROBOT, but just an end user - I can see a public post/link/share/photo, then why on earth can the API not do the same? What can I do, to make a PUBLIC POST, MORE PUBLIC?
I believe the answer to this question answers my question: Trying To Read Friends Links in Facebook Using FQL: Why do some friends return an empty set?
Facebook's users are allowed to set separate permissions for apps, so even when I am using the graph api explorer (which is an app) or the api directly (which is equivalent to an app), any public links/photos are only available to these apps when the original author of these links/photos/status has NOT unchecked it from "How people bring your info to the apps they use" setting under privacy settings.
I experimented with a test fb account, shared a link (with the default privacy settings), and I was able to query it using FQL on the link table, and then, I turned off 'My Links' under privacy settings and this time the same query in api explorer returned empty set.
So, the answer to my question "What can I do, to make a PUBLIC POST, more PUBLIC" would be that I can't do nothing about it - it is a setting that the user who posted this public post controls. When it is at default, I'll have access to it, when its not, I won't.
Hope, this helps others looking for similar answers.
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.
So really what i would like to do is access my page's photos albums to include them into my own website. So i can upload to facebook and have that viewable on my own site.
I using the php skd but fql would be better for this as i can easily get a JSON object back and i believe i wouldn't need to use the sdk as this is for user's informtaion not a pages details.
So does anybody have ideas on this?
url i'm trying to access the query:
https://api.facebook.com/method/fql.query?query=SELECT%20name%20FROM%20album%20Where%20aid=%27118818791532414%27&format=JSON
Page i am taking the photos from:
www.facebook.com/mayfieldathleticfc
Album i am using as an example:
http://www.facebook.com/media/set/?set=a.118818791532414.24873.118816378199322
I thought maybe i hadn't set the photos to public but after closer inspection i don't believe you can do this?
Anyway thoughts are welcome =)
That URL returns to you an informative error message:
{"error_code":102,"error_msg":"Session key invalid or no longer valid",
"request_args":[{"key":"method","value":"fql.query"},
{"key":"query","value":"SELECT name FROM album Where aid='118818791532414'"},
{"key":"format","value":"JSON"}]}
To call Facebook APIs, you have to pass in a session key - even to access 'public' things. A good starting point for learning how to authenticate and get a session key is http://developers.facebook.com/docs/authentication/
After a little more routing around i realised that it was my id's and owners details that was not correct: api.facebook.com/method/… i had this sorted it worked.
I want to do a simple thing yet it seems none of the FB api options (Graph/others) seem to be able to solve it.
Say "Johny Brown" is my friend and I want to include his name in a wall post. What I can do is type #Johny Brown then facebook shows a nice dropdown from which I can select his name.
However the same behavior cannot be mimicked using Facebook API.
Any tips will be greatly appreciated. I tried "#" before name, using full url, using "Name" etc. None of them work.
yup you're correct. in the new graph api facebook simply removed this feature (possibly due to too much spamming).
I know that it was previously possible to display your most recent Facebook statuses on your website as an RSS feed, but it seems they've changed their setup and I can't figure out where to find the feed anymore....
I saw some people searching for this a while ago, but since Facebook just released their new layout, I didn't know if this might have changed again.
Any help would be greatly appreciated.
Try this for a feed in JSON-format.
http://graph.facebook.com/[uid]/feed
Facebook appears to have killed all the public status feeds in the name of user privacy. The only way to fetch it is to build a facebook application that gets your status updates, and then associating your facebook account with that application to give it permission to access your status updates so it can put them somewhere else.
Thankfully, someone has already done that for us. Just go to http://apps.facebook.com/statusexport/ while logged in to facebook and grant the app permission. Then it will give you a public URL to an RSS feed of your status updates.
Just keep it simple... This is an easy way to load your latest status(es) using graph.facebook.com through curl / php. Includes a quick simple function.
Easiest way to load your latest facebook status
I found this site which you authenticate, and it will then give you a working rss feed.
I have found that it does have some limitations, but you can see it here:
http://www.fbrss.com
If you wan't to display status updates only, you can use:
https://graph.facebook.com/[uid]/posts
This URL will return a JSON string of user [uid]:s status updates.
To get your status feed, follow these instructions:
Log into Facebook
Go to http://www.facebook.com/notifications.php
Click the link titled "Your Notifications" at the bottom of the box to the right of the list of notifications
That will bring you to a feed of your notifications, which is not what you asked for. This url will be something like feed://www.facebook.com/feeds/notifications.php?id=XXXXXX&viewer= XXXXXX&key=YYYYYYYY&format=rss20
Change notifications.php to status.php in the URL (preserving all the URL parameters).
That should be a feed of your status updates.
Start at http://www.facebook.com/notes.php and click on the "My Friend's Notes" link. Change the friends_notes part of the url to friends_status, and you should be good to go.
Programmatically specifying user to query status updates for
(Note: This is a server-side solution)
It's possible the feed you're looking for has been deprecated for security purposes.
Alternatively facebook FQL on the Status table might provide an answer because it allows you to specify the user ID (for example, your own) for which to retrieve status updates, and a time frame can be specified to limit them as desired.
A raw fb FQL query example, for status updates:
select uid,status_id,message
from status
where uid in
(select uid2 from friend where uid1= uid)
AND time > {time in the last week}
The main FQL guide starts here.
Sample
Poking around the Internet you can pick up sample code of FQL code being called from PHP and other platforms.
PHP example:
<?php
$q = "SELECT name FROM user WHERE uid='$id'";
$query = $facebook->api_client->fql_query($q);
?>
The facebook client API library for your platform of choice can be downloaded and used to issue FQL statements.
--
There is also a Test Console hosted online for facebook developers to test API statements against their own account.
You can also use a RSS feed generator for your Facebook Statuses (or Photos) like the RSS Feeds application on Facebook.
It will help you generate a RSS feed for all your statuses and photos while maintaining the privacy modes.
Although, I am not a fan of the user interface the application has, but the functionality is what is awesome :)
Theres also anther way to do it..Which is simple and easy...its not an rss feed but a plugin can be developed to output as an rss...Theres a tutorial of it on http://Fourgefeed.com