5

How can i fetch data with group page alias ?

Take for example this group: http://www.facebook.com/groups/toroneradio/. Making request to https://graph.facebook.com/toroneradio gives me back:

"message": "(#803) Some of the aliases you requested do not exist: toroneradio"

Making request to the graph API with the group's id: https://graph.facebook.com/173246339390721 works OK.

It works great for pages though. Looked at FQL groups table but name is not searchable. (FQL Groups table) Also looked for some documentation and in FB bugtracking, couldn't find anything.

Is there way to get programaticly the group id from group alias or directly to get Group graph object?

Thanks, in advance!

Alex Kolarski
  • 3,255
  • 1
  • 25
  • 35
  • The "Easy way" suggested above does not work for me: in fact, the alias is not part of the attributes returned in the objects after a /me/groups request. As a consequence, I still haven't found an easy way to get a Group ID out of a Group Alias: it sounds incredibly dumb Facebook doesn't allow it to be retrieved the way users and pages can. – Mike Bannion Mar 10 '12 at 12:06

3 Answers3

5

The Easy Way

  1. If you haven't done so, join the Facebook group which you want to fetch the group ID
  2. Use the Facebook Graph API explorer
  3. Access your list of groups via http://graph.facebook.com/me/groups
  4. Search for the group and the ID will be listed in the object

If you are doing it through your Facebook application, all you need is to grab an FB access token before you do the FB Graph API call (read up the documentation here, especially the Authorization section)

The Hard Way

In case the easy way doesn't work (or if you feel iffy in joining the group), here's the sure-fire way to do so:

  1. Start up Firebug and enable the "Net" tab
  2. Bring up Facebook - check that the Net panl will show all the HTTP requests that's happening
  3. Click the "Clear" button so that you have the panel in the blank slate
  4. Click on the link of the Facebook group that you wanted to retrieve the Facebook ID
  5. Look out for a GET request to generic.php - that would be the very first request, but hunt it down if it's not. Click on the [+] box to expand the details
  6. Click on the "Parameters" tab and you'd see a key-value dictionary of the request. There'll be two fields in there called "key" and "sk", both of which would carry the same value like "group_1656399367890"
  7. The group's ID will be the numeric value after "group_" (in this case, it'll be 1656399367890)

Hope that helps!

Seh Hui Leong
  • 1,112
  • 1
  • 8
  • 19
0

By using FQL:

SELECT id FROM profile WHERE username='groupname' AND type='group'
-1

Just figured this out! Do this: http://graph.facebook.com/search?q=[ALIAS]&type=group

tekNorah
  • 389
  • 3
  • 12
  • Unfortunately, this is not reliable. As its a search, you may get responses that are similar to your alias. – Brad Mar 26 '18 at 22:01