Facebook GraphAPI to retrieve all user profile images - facebook

I need to retrieve all user profile images by user id and access token using Facebook Graph API.
I can take all user's albums in this way: {user-id}/albums?fields=type
In this list I can see an album with type = profile.
Is possible to change my request to filter directly this album?
Are there an others methods to take all user's profile images (for example using a single FB request)

You can´t filter, you have to get all albums and browse through them in your code to find the profile album. After that, you just need to make another API call to /{album-id}/photos to get access to the photos.

Related

Facebook api: get cover photo with app-scoped id

guys!
Is there any possible way to get user cover photo using app-scoped id? Facebook graph-api accepts only actual facebook id.
There is no way to get a cover photo without using an access token belonging to that application.
Only profile pictures are publicly accessible from an app scoped ID.

How to get OTHER users' photos and albums with Facebook Graph API

Scenario: logged with my Facebook account and using a browser, I'm able to see some photos and albums of some users which aren't friends of mine (with a privacy setting of public or similar) and quite all their past profile photos.
For example the URL
https://www.facebook.com/<userid>/photos_all shows those photos.
I want to replicate behaviour with Graph API but GETting
https://graph.facebook.com/<userid>/photos?access_token=...
Gives me an empty data array.
Same scenario using tagged or albums instead of photos
I've tried to use site scraping but FB website uses AJAX to populate gridview of photos, so It's very difficult.
On Graph API Explorer I've requested and use an access token with all permissions and also a debug access token but I'm still unable to get other users' photos.
It's possibile to get photos of users which aren't in friend list with Facebook Graph API? Am I missing something?
For privacy reasons, it´s not possible to get the photos of OTHER users with the API. Even for the authorized user, you need the user_photos permission.
Scraping is not allowed btw: https://www.facebook.com/apps/site_scraping_tos_terms.php

How to get all images uploaded by an app using facebook graph?

I am trying to make a facebook photo contest app. Users can upload an image via the app and it goes on their wall and into an album automatically created for my app. However I cannot find any way using the graph api to get the array of uploaded images for all users. Is this possible? I thought...
$facebook->api("/$app_id/photos?access_token=$app_long_life_access_token");
would work but it returns an empty array.
The photos are uploaded using...
$facebook->api($this->app_id . '/photos', 'post', $args);
I can access a single image using its id and the app's token but this will require looping through every single image id to get the details.
In order to access a users photo album (even if it was created by your application), you'll need a valid user access token. It's their album after all. If a user changes their password or even uninstalls your application, you will no longer have access to their content.
To keep track of all these photo's you'll have to monitor each upload and store it (in your database for example).
Facebook doesn't usually allow you to collect masses of data in this way. You will have to query each individual user or photo to get this info if you don't store it in some other method.

Facebook Graph API - Is there is a way to determine if a user has uploaded a photo?

Some FB users have not uploaded a profile photo. When they authenticate to my app I don't want to store these default FB photos like so:
https://fbcdn-profile-a.akamaihd.net/static-ak/rsrc.php/v1/yp/r/yDnr5YfbJCH.gif
Is there an API call I can use to determine if the user has uploaded a custom photo?
Thanks
No.
Don't know what else to tell you :)
The only way I could think of doing it would be to pull the user's albums and look for the "Profile Pictures" album. There's a count element there.
Maybe. Read http://developers.facebook.com/docs/api/realtime/
Your app can subscribe to changes to a user's properties. The profile picture is a property of the user object so you can be notified when it changes. The other photos are not properties of the user object, they are listed under Connections at http://developers.facebook.com/docs/reference/api/user/ so I don't know if you can access them from the real time notification api. Whatever, you need the user_photos permission to list them.

How to use Facebook Photos in an iPhone App?

I have a client who wants to use their Facebook photos in an iPhone app. We want to embed their account into the app so that when people download the app, they see the client's Facebook photos. The user should not need to login or connect to Facebook.
This is different than the standard "connect to facebook so we can access you data" - we have no need to access the users data.
Do I need to create a Facebook App, connect the client's Facebook account to the Facebook app, then use that to get the photo data ?
Ok, here is what I found
My business page is http://www.facebook.com/pages/Feltpad-Web-Mobile/128861547181352
That number at the end (128861547181352) is the business' "Facebook Graph ID"
Then use the Business Graph ID and go to http://graph.facebook.com/128861547181352/albums and you will see a list of all of the Photo Albums associated with the business' page. There is only one album, so that is all the info you get. The first valuable line on that page says "id": "133208113413362" - this is the Facebook Graph ID for the album.
Then use the Album's Graph ID and go to http://graph.facebook.com/133208113413362/photos - this will give you a JSON file with all the data you need for all the photos in the album.
You can also use ?limit=25 and ?offset=50 or both ?limit=25&offset=50 to page through the results.
This should be easy. Facebook gives a public URL for albums that are public to be viewed by the Internet without necessity of logging in. You can see this URL al the bottom of the album page that you may want to share.
It looks like this:
Share this album with anyone by sending them this public link:
http://www.facebook.com/album.php?aid=[ALBUM_ID]&id=[USER_ID]&l=[SOME_PARAM]
(quoted from a public album)
you can easily leach data and extract images from there.
However it is more sane to create a Facebook app (takes hardy a minute) and use Facebook graph-API to make REST calls to retrieve all the data about albums and photos within them in well formatted JSON that will be far easier to handle the HTML. Once you have Facebook App in place, you may use it to fetch all the FB data but it violates both of your requirements (1)Not using Facebook app, and (2) user don't have to sign-in.
But it may worth looking at
http://developers.facebook.com/docs/api
http://developers.facebook.com/docs/reference/api/album
Well, there is some trick. If you go to the API page(http://developers.facebook.com/docs/api). Copy the URL given for Coca-Cola album (https://graph.facebook.com/99394368305) and make a request with photos REST command like https://graph.facebook.com/99394368305/photos you can access all the details of all the photos in the album in JSON format. I could not get it work for my personal public album though.