Reputation: 27610
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?
Upvotes: 7
Views: 5522
Reputation: 10001
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.
Upvotes: 6
Reputation: 1
try using Unicode, U+0200 is the space bar, so concatenate "My", U+0200, and "String". No clue if that works.
Upvotes: -1