Facebook API call for places with limited results - facebook

I'm trying to pull all the Facebook public events in my city through graph-API calls, to do that I believe that first I need to get all the places near by a point and then for each place get the events happening there. Is this correct?
Anyhow, when I try to get the places my API call returns only somewhere between 350 - 450 places depending on the center point. I know there are more than that.
My API call is:
/search?type=place&center=31.7570810,-106.4890170&distance=15000&limit=5000
Is there any limits for searching places Im not aware of?
Thanks in advance

Related

Facebook API Post Impressions Unique (reach)

I'm after the impression uniques for our posts and ideally we would like one server call and it would bring back the last 100 posts with the reach (post_impressions_unique).
To get reach, I can currently do this using:
https://graph.facebook.com/nmemagazine/posts?fields=name,message,full_picture,created_time,shares,likes.limit(1).summary(true),comments.limit(1).summary(true)&access_token=USER_TOKEN
and getting the post ID, then calling: https://graph.facebook.com/v2.5/POST_ID/insights/post_impressions_unique?access_token=USER_TOKEN
Is there a way where I can make one call to get all recent posts and their reach in one API call?
You could simply call
https://graph.facebook.com/nmemagazine/posts?fields=name,message,full_picture,created_time,shares,likes.limit(1).summary(true),comments.limit(1).summary(true),insights&access_token=USER_TOKEN
NOTE: extra field "insights".
However, as far as I can tell you cannot limit the insights to just Post_impressions_Unique so it would bring back some data you do not necessarily want/need. I.e. I don't think you can perform a search/filter on a "second level"/child/nested type.
To give an update on this:
In facebook Graph API 2.10, you can (and have to) specify the metrics you are interested in via insights.metric(...). Possible metrics are documented here:
https://developers.facebook.com/docs/graph-api/reference/v2.10/insights#availmetrics
For your example:
curl -i -X GET "https://graph.facebook.com/nmemagazine/posts?fields=name,message,full_picture,created_time,shares,likes.limit(1).summary(true),comments.limit(1).summary(true),insights.metric(post_impressions_unique)&access_token=USER_TOKEN"

In Facebook Graph API - Is LIMIT parameter realy functional?

I'm trying to collect all the posts of my company page with this kind of query
https://graph.facebook.com/v2.2//feed?limit=250&fields=id,type,status_type,comments{id},likes{id},shares
Problem is that I'm not collecting all posts.
I will have a better result with limit=20 and some time with limit=100
Most of the pages (from the pagination mechanism point of view) will not have 100 items.
I know some posts may not be exposed because of privacy settings.
My issue is that a call with limit=20 is not returning once going through pagination the same amount of data as limit=250.
How could it be?
How providers of Facebook Analytics can garanty the quality of data they collect ?
The Facebook graph api only allow the max of 100 items per request, despite you specify more than that.
Afaik the limit parameter is indeed buggy. But 250 would be a very high value, there is a max value for the parameter too - i assume it depends on the API call how high it is, could be fixed too.
Better donĀ“t use limit at all and use paging to get more results: https://developers.facebook.com/docs/graph-api/using-graph-api/v2.2#paging

Issue when trying to requery on postID using facebook graph

Forgive me I'm new to the Facebook graph concept. I've read through the documentation and am a little lost on something that I want to try and do. I have been able to query posts based on a keyword such as "sailing" like so:
http://graph.facebook.com/search?q=sailing&type=post
I see that it returns a result set containing 25 of the most recent posts with the keyword provided. My issue comes when I try to take a post id and query it directly. What I want to do is to be able to take a post id and query it after a 24hr time frame to see if it has received any comments and to see how many likes it has gained since being posted.
I can take the userID_postID and query like:
http://www.facebook.com/userID/posts/postID
I can see the post with the likes but when I try this in the graph:
http://graph.facebook.com/userID/posts/postID
I get the following error message:
{
"error":
{
"message": "Unknown path components: / postID",
"type": "OAuthException",
"code": 2500
}
}
I've seen where people have commented that if you want to access a post you will need to get an access_token. I'm not sure why you need an access_token to access a post that you originally obtained without one. It doesn't seem to make sense. One thing that I have noticed when trying to do this with different posts is that this seems to be related to accessing posts of an individual rather than a fan page. Whereas a public page such as a fan page seems to return the results.
I also tried querying like:
http://graph.facebook.com/userID_postID/likes
this returns the likes for a public page such as a fan page but doesn't return anything for an individual page. Can anyone help point me in the right direction or maybe give me some explanation on what the proper way to handle this would be? Requesting an access_token from the user is something I do not want to do, this is mainly for a service that we're trying to create that allows us to survey based on a keyword. Any help would be much appreciated, thanks.

Query regarding Facebook Places Graph API

I'am using graph API in my application. Recently I have come up with a trouble retrieving places using Places API.
When I try to retrieve locations using places API I'm not getting response as expected, please let me know in case if I'm missing out some steps.
url used in app is:-
https://graph.facebook.com/search?q=Paris%2c%20France&type=place&center=48.8567,2.3508&limit=20&distance=100
What is the minimum value of the distance to be specified?
As I'm able to get more places if I increase distance value from 100 to 1000
Playing with the Graph API explorer, there doesnt seem any specific value that can be used as minimum value while querying. Since using specifying 1 I still seem to be able to fetch the results, as of now the maximum value that you can specify seems to be 50000m for place queries.

Facebook Places API 500 result limit

Facebook OpenGrap API limit results of [id]/checkins to 500. Is there are way to retrieve more than 500. Example if I want to retirve all the place someone has checkin for year 2011. What are possible available methods. Is there a premium service provided by Facebook.
Regards,
Waruna.
As the open grpah documentation describes, there should be a "paging" object at the end of the api response if there is more content than you could load at one time. You can test this by clicking the example links inthe documentation. So, the solution is: Loop your requests until there is no "next" property in the "paging" object of the response.
Also there are possibilites to batch your requests, maybe this is also useful for you.