FQL query info & get Facebook friends by first letter

For example, show all friends of logged in user starting with “j”. (requires valid access token – e.g., from your app or Graph API Explorer or use the legacy fql test console):

SELECT name FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1=me() ) AND strpos(lower(name),"j")==0

To use as a GET request directly from FB:


You can call this directly as above if you have an access token, but more likely you would use the FB API, like the JS, or PHP, SDK.

FQL links:
FB FQL Reference
FB friend API reference
slideshare fql-overview

Click here to see a simple JavaScript SDK example of fql.query

    method: 'fql.query',
    query: 'SELECT name FROM user WHERE uid=5526183'
  function(response) {
    alert('Name is ' + response[0].name);

Leave a Reply