6

I want to use the Facebook Graph API to search for exact page matches to "My String".

I tried https://graph.facebook.com/search?q=%22My%20String%22&type=page - but it returns pages that match either "String" or "My".

How do I construct a search query that returns only exact matches to the quoted string?

coffee-grinder
  • 26,940
  • 19
  • 56
  • 82

2 Answers2

6

Currently, you can't. It's triaged on the wishlist.

So, you'll have to wrap the request, in Python :

import requests
query = 'My String'
r = requests.get('https://graph.facebook.com/search?q=%s&type=page' % query)
result = r.json
result['data'] = [ item for item in result['data']
                   if query.lower() in item['name'].lower() ]
print [ item['name'] for item in result['data'] ]

Now you only have exact matches.

Maxime R.
  • 9,621
  • 7
  • 53
  • 59
-1

try using Unicode, U+0200 is the space bar, so concatenate "My", U+0200, and "String". No clue if that works.

paul
  • 1