Facebook Graph API: get all public photos by a specific location - facebook

I don't think it's possible but maybe I'm missing something.
I would like to get all public photos attached to a specific location.
I tried:
graph.facebook.com/place/tagged/. This doesn't seem to return recent results.
graph.facebook.com/search?type=location&center=coordinates&distance=200. This only returns results related to a user (and users friends).
Any ideas on this?

I don't think this is possible.
if you just need photos from a specific place I would use instagram instead.

Facebook will never be so generous to give all public images to a query. That is like Terabytes of data which can be accessed by anyone with a line of code.
What you can do is get the images of the user and users friends. If its a public app, the user base should grow and you get exposure to more images.
Hope that helps.

Related

facebook graph api - get posted images from users on page

I've searched a lot, but I did not get any full information.
I need to get all images which are posted to a specific fb page by users. And do I really ned to get that app reviewed? I only need this application during an exhibition over a weekend.
The fans take a picture at our booth and post it on our timeline. These images are to be displayed automatically on a screen.
How do I get to the pictures via the Facebook API?
update:
My first move was with the following:
graph.facebook.com/v3.1/[pageid]/feed?fields=picture,message,from
Since I need only the posts from others, I'm going to filter the response object.
Is there a better solution?
Okay, so PAGE-ID/visitor_posts?fields=picture,message did the trick!

Getting image and text from facebook post

Is there any possibility to extract/get the image and description from Facebook post in code?
Let say we have a public post
https://www.facebook.com/rihanna/photos/a.207477806675.138795.10092511675/10154095214621676/?type=3&theater
Do we able to extract/get the image and description(Get the new dance remixes ...) of that particular post by using Facebook sdk in code?
thanks in advance
Yes, it's possible. You can access the Graph API through a GET request and the photo ID (in your case it's 10154095214621676). As long as the photo originates from a public page you can call for different parameters like name (that's the description), picture (small image), etc.
You can play around with the Graph API Explorer to figure out what exactly you need. For a more detailed information on the possible parameters you might want to have a look into the Facebook Developers Documentation. There you can also find some examples how to handle requests in different SDKs.
Agreed with trotta.
Something like this https://developers.facebook.com/tools/explorer/145634995501895?method=GET&path=10154095214621676%3Ffields%3Dpicture%2Cname%2Calbum%2Cimages&version=v2.9
and you can get all info for the post.

Getting large photo with additional fields - Facebook

So this is how I'm retrieving Facebook friends and profile picture right now:
https://graph.facebook.com/{{user_id}}/?fields=picture,friends&access_token={{app_id}}|{{app_secret}}
However, the photo I get with it is small and the only way to get a large photo is:
https://graph.facebook.com/{{user_id}}/picture?type=large&access_token={{app_id}}|{{app_secret}}
So now I have to make two get requests; one for a large photo, and one to get the friends. I want to achieve both in one request. Is that possible?
Thank you.
The call
/{user_id}?fields=id,name,friends,picture.type(large)&access_token={access_token}
should do what you desire.

How to get all user's likes using facebook's graph API

How can I query facebook's graph API to retrieve all user's likes (not only pages but also photos and others)?
For instance, how could I get all the pictures a user has liked? Using facebook's search bar you can find them easily by clicking on "photos has liked".
I wrote a script that scrapes the page content and does that but it's not very efficient.
I have recently come accross a similar problem, maybe this helps you solve it.
https://graph.facebook.com/v2.5/{page_id}/feed?fields=likes.limit(1).summary(true)&since={start_date}&until={end_date}&access_token={access_token}
This will give you a list of all posts that received likes during the specified time period. If you manage to write a code summing up the following JSON path you got your sum for "all user's likes":
data[0].likes.summary.total_count
Not entirely sure is this is exactly what you were searching for, hope it helps you though - and if not you, someone else.
As for likes you can also use the same way to extract Shares and Comments:
Shares
https://graph.facebook.com/v2.5/{page_id}/feed?fields=shares&since={start_date}&until={end_date}&access_token=
Comments
https://graph.facebook.com/v2.5/{page_id}/feed?fields=comments.limit(1).summary(true)&since={start_date}&until={end_date}&access_token=
Best regards
There isn't to my knowledge any way to get this from the API without grabbing every type of response from the API and then sorting through for likes. Facebook search bar uses an internal API different from the Graph API.

Inconsistent Graph API Behavior for Album Requests

I am trying to get a listing of photo albums using:
https://graph.facebook.com/USER_ID/albums
It is working perfectly for some users, and other users I am getting nothing:
{
"data": [
]
}
I am sure in both cases the user ID is correct and valid. For the users that return nothing I can see the albums when logged in as the same user, so I don't see how permissions could be an issue.
Any suggestions would be greatly appreciated!
Igy appears to be correct. This is a duplicate of 10939051.
Since I could not find it, the setting that will exclude all user photos and albums from apps can be found by going to Privacy Settings > Apps, Games and Websites > How people bring your info to the apps they use > De-check My photos.
Here is a screen shot:
You'll get better results by writing it this way:
https://graph.facebook.com/USER_ID?fields=albums.fields(id)
I got this result while playing with the Graph API Explorer.
Here,
you've to generate a new token with user_photos and friends_photos selected.
Then, select what you need in the list:
And it seems to display what you need (at least if the ID you are looking for is the one of your friends)!