1

I've used the old Facebook SDK where I could do FQL-queries. I want to fetch all nearby places that also has a page attached. And with those results, I want as many columns as possible.

I want to rewrite this function so I can do the same but with the latest Facebook SDK 2.3.

The old way:

SELECT name, type, page_id, hours, categories, about, bio, description, general_info, location, checkins, fan_count, phone, pic_big, website FROM page WHERE page_id IN(SELECT page_id FROM place WHERE distance(latitude, longitude, '37.76', '-122.427') < 1000)

But this doesnt work so well with the new SDK. I've tried the search-method and tried to write different types of queries (in the 'q' parameter) but nothing gets close to this.

As you can see, I want as many columns about the pages as possible.

The closest I've come is this far: https://developers.facebook.com/tools/explorer/145634995501895/?method=GET&path=search%3Fq%3Dcoffee%26type%3Dpage%26center%3D37.76%2C-122.427%26distance%3D1000&

Does anyone know how I should think/do in order to get this data in the new way?

1 Answer 1

1

Have a look at

You can specify the desired result fields according to the fields which are available for the respective object.

For example

/search?q=coffee&type=place&center=37.76,-122.427&distance=1000&fields=id,name,hours,category,category_list,about,bio,description,general_info,location,talking_about_count,were_here_count,likes,phone,cover,website

Try it

https://developers.facebook.com/tools/explorer/145634995501895/?method=GET&path=search%3Fq%3Dcoffee%26type%3Dplace%26center%3D37.76%2C-122.427%26distance%3D1000%26fields%3Did%2Cname%2Chours%2Ccategory%2Ccategory_list%2Cabout%2Cbio%2Cdescription%2Cgeneral_info%2Clocation%2Ctalking_about_count%2Cwere_here_count%2Clikes%2Cphone%2Ccover%2Cwebsite

Keep in mind that the fieldnames are not the same from FQl to Graph API.

7
  • This was very helpful. One thing though, I'd like to fetch all places in the area, but without any information in the "q"-parameter. E.g I want to search for All places. Is that possible?
    – Oakleaf
    Commented Jun 1, 2015 at 8:49
  • Yes, that should be possible, why don't you just try it?
    – Tobi
    Commented Jun 1, 2015 at 9:03
  • I have, the q-parameter is required.. That's why im asking :) ; { "error": { "message": "(#100) The parameter q is required", "type": "OAuthException", "code": 100 } }
    – Oakleaf
    Commented Jun 1, 2015 at 9:05
  • Oh, and it doesnt seem to work with coordinates when searching for a page: developers.facebook.com/tools/explorer/145634995501895/…
    – Oakleaf
    Commented Jun 1, 2015 at 9:26
  • Updated my answer. You need to use /search?q=&type=place&... Then you can also leave q blank
    – Tobi
    Commented Jun 1, 2015 at 10:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.