I have coordinates as latitude and longitude, I want to get a list of place from facebook using facebook query (FQL). Does anyone have an example of how to to that? I am also fine with using the graph api
It's easy with the Graph API:
https://graph.facebook.com/search?q=coffee&type=place¢er=37.76,-122.427&distance=10000&access_token=AAAAAAITEghMBAB7yPm6SoZAeJyU7MnYXqllWwcTLQDZB2g96QCmpb2B2QDAWtPfCkRJtCN8tnPbDrTqaZA6M9fmHdm1FXB0kbmaXEShDwZDZD
(Via the online documentation)
I can't get it to work with FQL, although the correct syntax appears to be:
SELECT name,description,geometry,latitude,longitude,checkin_count,display_subtext FROM place WHERE latitude=40.797702 AND longitude=-105.587082
(Try it)
Related
I am trying to figure out the right parameters for ItemSearch such that the API call will return the same result as on the website. Currently I am using these params it is not consistent with the website.
url_params = dict(
Service='AWSECommerceService',
Operation='ItemSearch',
AssociateTag=AMAZON_ASSOCIATETAG,
SearchIndex='All',
AWSAccessKeyId=AWS_ACCESS_KEY_ID,
Keywords=keywords,
ResponseGroup='Small,OfferSummary,Images'
)
For example if 'iphone%205s' is put in keywords, the API returns a list of iPhone protectors, while searching on the website gives iPhones as top results.
I am also trying to figure out why this is for book searches. One possible answer I found online was that the websites search feature might use more elaborate queries than just one simple API call. For example, it may take into account other factors into the search (not sure what that might be but it may).
I am using graph api explorer to test my results.
I tried getting todays posts by the below query
1061547241/feed?fields=object_id&since=1378122100&limit=100
I am confused with the since parameter. some one help get todays posts using since parameter.
Lets take a look at the documentation for graph api:
https://developers.facebook.com/docs/reference/api/pagination/#timepaging
According to that it uses http://php.net/manual/en/function.strtotime.php function to convert the "since" parameter. So if you want to get it for today you can do something like:
1061547241/feed?fields=object_id&since=today
This would give you feed since start of the day i.e. 00:00:00.
For more details on formats you search for datetime.formats in php, doesn't allow me to post more than 2 links.
Any one have any ideas on how to accomplish this?
I have tried
https://graph.facebook.com/search?q=%22%23apple%22
https://graph.facebook.com/search?q=%23apple
https://graph.facebook.com/search?q#apple
which does not work.
To be clear the results should only have posts that contain #apple not "apple".
Facebook says this is not supported at this time: https://developers.facebook.com/x/bugs/313941462054417/
if you're trying to get the #hashtags from Facebook, currently, there is no api for this. and even if there were- the posts are not intermediate, they are being cached. you won't see the most recent hashtag from a person who's not in your friendlist right away, this will take a long time to appear in the hashtag search
I've read too that it's not supported but,
trying the second line of jlarry
https://graph.facebook.com/search?q=%23apple
in Graph API Explorer, it works.
obviously the query is on the posts set as public.
so the query could be something like this
https://graph.facebook.com/search?q=%23joviberton‬&type=post
for further ops check https://developers.facebook.com/docs/graph-api/using-graph-api/
Is it possible to search for users which are beyond my immediate circle using FB graph API?
If not, does having a paid subscription account help to overcome this hurdle?
I'm using following graph query but seems to be restricted within my circle:
https://graph.facebook.com/search?q=xx+yy&limit=5000&type=user&access_token=*
Also if I increase the offset using pagination in the next call, It will still returns the same set of user IDs. So not sure if I'm passing the parameters incorrectly or missing some other parameters.
Thanks for all your help in advance!
Not sure what you mean by your immediate circle in terms of Facebook but I assume you mean your friends. The Graph API allows you to search for all public objects (source) - this means every person (according to answers on this page since names are always publicly available - that's my understanding), not only people who you are friends with on Facebook.
Hence, when you're searching for "John" you should get everyone called John if you're using the Graph API correctly - make sure your access token is valid (you do not need any special permissions to search for people) and your syntax follows the example from here.
In order to test your query I suggest you use the Graph API Explorer before adding the query to your application code. It's a quick way to see if the error is in your query or elsewhere. For example, if you want to find everyone named John, use this link http://developers.facebook.com/tools/explorer?method=GET&path=search%3Fq%3DJohn%26type%3Duser. Just make sure to click Get access token on the right if you're using the Explorer for the first time, otherwise the query will return an error.
It seems that you can make a call to the Graph API that looks like this:
https://graph.facebook.com/me/checkins?since=yesterday
Apparently you can pass either a UNIX timestamp or any valid strtotime value.
The questions...how do you know what other options are available to you in the request? I don't see any documentation about this "since" filter or any other similar filter. Is this information just trickling down from people who know some API engineers at Facebook?
I know that there are some things that you can do in FQL that are similar to what I was describing but I want to stay with the Graph API if I can.
Thanks
--Tony
Anothony Lee:
since, until - (a unix timestamp or any date accepted by strtotime):
EG: since=yesterday until=now, since=6+months+ago until=3+months+ago,
since=10/01/2011 until=10/11/2011
another example
&since=noon+monday+last+week &until=10+minutes+ago.
you need to provide the date filter as shown in the below link. time_range should be attached to the insights.
try this
https://graph.facebook.com/v6.0/me?fields=id%2Cname%2Cadaccounts%7Bcampaigns%7Badsets%7Bads%7Binsights.time_range(%7B'since'%3A'2020-05-01'%2C'until'%3A'2020-05-01'%7D)%7Badset_id%2Ccampaign_id%2Cad_id%2Cclicks%7D%7D%7D%7D%7D&access_token=