Scraping facebook emails like a Pro ( Real Advanced method )

emptyzero

Power Member
Joined
Aug 13, 2012
Messages
726
Reaction score
370
Hello, seen people trying to gather facebook uids, emails etc.. to use in marketing..
So before this goes down, i will share this cool method to extract emails from facebook groups.

- Better be a member in the group so it works..

First, go to
Code:
https://developers.facebook.com/tools/explorer/

Hit generate access token, and make sure you check the ( groups action )

second, get the group id by entering this into your graph command line ( /me/groups ) this will show a list of all groups you are in, with its names and ids.

once you get the group id you want..

Code:
https://graph.facebook.com/v1.0/(Group ID)/members?fields=username&limit=5000&access_token=(your access token)
replace (Group ID) and (your access token) and browse the link you will get around 5000 results, and if group have more members, you will find a link below results to continue browsing results from where you reached !


Now Cleaning results, it comes like this :
Code:
[COLOR=#000000]   "username": "wafa.zagal.1",[/COLOR]         "id": "100004550220996"
      },
      {
         "username": "layal.mattar.1",
         "id": "100002974932215"
      },
      {
         "id": "100005475917204"
      },
      {
         "username": "ahmad.shaaban.507",
         "id": "634233856"
      },
      {
         "username": "fatima.diab.338",
         "id": "100000486916699"
      },
      {
         "username": "alaa.azab.96",
         "id": "100001977767819"
      },
      {
         "username": "rawand.aldeeb", [COLOR=#000000]         "id": "1339392086"[/COLOR]

save all results into txt file let's say ( results.txt )

now upload this into your root, or linux vps, or leave it if you are already using linux.

In Terminal CMD or SSh, use this command to eliminate bad results :

Code:
grep username results.txt > clean.txt
now all lines that contains ( username ) will be moved to a new file called clean.txt

download this file again :)
in notepad hit CTRL H

Replace "username" with nothing..
Replace ", with @facebook.com
Replace " with nothing

i can scrap 100,000 results in 5 min only ( that's even faster than tools lol )
That's all folks ;)

emptyzero
 
Code:
grep username results.txt > clean.txt
this is not working for me, can u help me?
anyways GREAT SHARE!
 
looks like this is being patched as we speak, could not get this to work :(
 
Code:
grep username results.txt > clean.txt
this is not working for me, can u help me?
anyways GREAT SHARE!

Maybe you're using windows.
Save your text file to C:\users\welcome

Now open cmd and use the below command to clean the file.

Code:
findstr username results.txt > clean.txt

The clean.txt file will be at C:\users\welcome
 
Thanks for this method,

I can't browse the next page up to the 5000 limit though, when I copy the "next" link, the result page shows only a "previous" link without any data . any ideas?
 
Any idea of why if you dont have joinde the group, its impossible to scrap the group?
 
this method is for linux users, or guys who have dedicated / vps ( linux ) and use SSH ( putty ) to control ..
 
I'm pretty sure you can add a &filter=id

To only get the ID's. Something like that.
 
I noticed that I can only scrap groups with this url structure "groups/199109493482902" but not the ones with this one "https://www.facebook.com/groups/199109493482902/?ref_br or something like that"
 
Thanks for this method,

I can't browse the next page up to the 5000 limit though, when I copy the "next" link, the result page shows only a "previous" link without any data . any ideas?

Yes. I am also having this problem. Could you please advise? Or have facebook patched this?

I can get the 1st 5000 with no problems.

I would appreciate a response, thanks a lot :)
 
This will probably get patched anytime now, you shouldn't have shared it publically. FB forbids scraping.
 
actually facebook does not mind because they benefit from it. Facebook give you an option to upload UIDS to use for the ad campaign on a like page
 
Back
Top