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?

Oakleaf
  • 393
  • 3
  • 14

1 Answers1

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.

Tobi
  • 31,405
  • 8
  • 58
  • 90
  • 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 Jun 01 '15 at 08:49
  • Yes, that should be possible, why don't you just try it? – Tobi Jun 01 '15 at 09: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 Jun 01 '15 at 09:05
  • Oh, and it doesnt seem to work with coordinates when searching for a page: https://developers.facebook.com/tools/explorer/145634995501895/?method=GET&path=search%3Fq%3Dgym%26type%3Dpage%26center%3D59.341098%2C18.0542351%26distance%3D1000%26fields%3Did%2Cname%2Ctype%2Chours%2Ccategory%2Ccategory_list%2Cabout%2Cbio%2Cdescription%2Cgeneral_info%2Clocation%2Ctalking_about_count%2Cwere_here_count%2Clikes%2Cphone%2Ccover%2Cwebsite& – Oakleaf Jun 01 '15 at 09:26
  • Updated my answer. You need to use `/search?q=&type=place&...` Then you can also leave `q` blank – Tobi Jun 01 '15 at 10:12
  • Now I just feel retarded, you're right, it's just to leave the parameter empty (I tried this earlier but it didnt work because I specified a field that wasnt allowed). A follow up question; How can I get pages based om this information? In my FQL I joined the pages attached to the place, but it doesnt seem to be possible now? – Oakleaf Jun 01 '15 at 10:34
  • The place IS the Page – Tobi Jun 01 '15 at 10:40