Build Your Facebook Custom Audience Through Graph Search

Here’s how to build a Facebook custom audience for free using their built-in graph search feature. This method doesn’t use the API. This is purely gathering data from the public graph search page in a semi-automated way. The advantage of building a custom audience this way is it’s much more intuitive when doing searches and gives you more flexibility than the current software tools I have seen so far.

Download the “Scraper” extension for Google Chrome browser


Here’s the link to download the Scraper extension.

Log in to Facebook and do a search for your target audience


Quick Tip: To target people that may be a little more engaged with a page, use the “people that like photos by” search – e.g. “people that like photos by Ralph Lauren”.

Right click on the page and select “Scrape Similar…”


It doesn’t really matter where you right click becuase you will be replacing the Xpath selector in the next step anyway.

Enter this into the Xpath selector field and click “Scrape” – //div[contains(@data-bt,’id’)]/@data-bt


*Disclaimer – This selector path is working at the moment. If Facebook decides to change their page layout or structure then this may not work in the future – //div[contains(@data-bt,’id’)]/@data-bt

What we are doing here is scraping the page for each user’s Facebook ID. Facebook can use this value to build a custom audience for your ads.

Click Export to Google Docs


Delete rows with irrelevant data


You will need to delete any irrelevant data from the spreadsheet. The first 2 rows for example and usually the last row so you are only left with the data that contains user ID’s.

Enter this into the B1 field – =RIGHT(LEFT(A1,FIND(“,”,A1) -1),FIND(“,”,A1) -7)


This will select only the ID from the first column text. =RIGHT(LEFT(A1,FIND(“,”,A1) -1),FIND(“,”,A1) -7)


Drag that cell down using the crosshair cursor to reproduce that function on other rows


You can get the crosshair cursor by moving your mouse to the bottom right of the B1 cell.

Copy the contents of that column


Open a new Sheet and select “Paste Special” – “Paste values only”


This will give you a clean sheet of data that only contains User ID’s ready for export

Select File – Download As – Comma Separated Values


Now you can upload this CSV file to Facebook as a custom audience


Mike Leembruggen

Mike Leembruggen is available for consulting, contracting, and tech implementation. Mike lives and breathes 'internet marketing' and has a passion for building automated systems and marketing funnels that convert into big dollars. If you would like to speak to Mike, please send him a quick message through one of the contact forms on this site.

I use "Anyaudience for facebook". It's the only scrapping tool that works for me.. I don't have any problems with that tool

mikeleembruggen moderator

Hey guys,

Facebook has recently been cracking down on people using custom audiences so let's see how that pans out over the next few months.

Last thing I want is for you to lose your FB accounts.

I just had a quick look at the source code on FB again, and it looks like they have taken out the ID reference from graph search listings.


Could someone please update the correct xPath string?! What should we use now to scrape?


FB has changed their layout so selector path is not working


Hi sir!

Scrape Similer not working on my web browse, i'm using Chrome browse, 

I'm not fix it.

Can you help me?

Thanks and Best Regards :3


Thanks for tutorial, unfortunately Facebook  changed their page layout :( Can anyone advise me what to enter into the field xPath now?



Awesome... but unfortunately, it wont work already as you said it, facebook changed their layout. :(