The new Facebook Graph Search – part 2

The next step

In this part, we’re talking about combining searches. Just like in part 1, we will be translating JSON to Base64. And of course we’ll take you through it step by step 🙂

What to combine?

Well, you can only combine when you stay in the same category. In part 1 we’ve discussed the following categories: – Search/top/ – Search/posts/ – Search/people/ – Search/photos/ – Search/videos/ – Search/pages/ – Search/places/

It’s not possible to combine a query from ‘photos’ together with a query from ‘people’. So you’ll have to find a query to make which stays within one category (for example, posts you’ve viewed with your profile in a specific group).

How to start combining

In order to combine the queries, we’ll have to put two (or more) JSON lines together. This can be best explained with an example. Let’s say we’re looking for people named ‘John’ who live in ‘Mountain View, California’ and work for ‘Google’.

We’re going to build the base URL first. In the case of the example, it will look like this:

facebook.com/search/people/?q=john&epa=FILTERS&filters=

‘search/people/‘ because we want to search for people.‘?q=john‘ because this is our search query in order to find people named ‘John’.

Now we need to combine those two lines. In order to combine them, we’ll need to remove some curly braces and add a comma. The curly braces that need to be removed are highlighted and the comma that needs to be inserted is highlighted too:

The most common mistake is that the quotations in the JSON line aren’t straight. They need to be straight, not slightly tilted. If you’re getting errors while testing your JSON line, make sure to copy and paste the JSON line in a text program like Microsoft Word, select the text and change the font to something like ‘Lucinda Console’. Now copy and paste the JSON line and your problem should be fixed.

So now that we’ve got the right JSON line, we move back to CyberChef. We’re going to ‘bake’ the JSON to Base64, just like we did in the first blog.

Now you see the results for people named ‘John’, who live in ‘Mountain View’, who work for ‘Google’!

Of course this is an option to filter in the left menu, but if you want to specifically search a page or city, using the page ID number is much more efficient than searching the specific page in the drop down menu when clicking ‘Choose a City…’.

Trying queries

After reading part 1 and 2 we’ll be able to build your own queries. You’ll have to try different queries to figure out which ones work best for you. Even try to put more than 2 JSON lines in a query.Also, don’t forget about the search bar! There are some good filtering options in there too!

And if you’ve paid attention to the way the URL’s are built up when using the search bar, you’ll notice the Base64 lines in there. You can always try to reverse the Base64 to JSON (with CyberChef) in order to see how Facebook built the query so you can learn from it.

If you’re looking for any new queries, check out Kirby’s website where there is matrix with all kinds of helpful queries you could build. Check it out here.

Or if you’ve found any new interesting queries, feel free to share them in de comments below!