Facebook Graph Api 2.4 Album Cover Photo in High Resolution - facebook

I'm trying to retrieve an Album cover photo in a higher resolution.
The following Graph API call does retrieve a cover photo:
{album-id}/picture
However, i can't get the picture in a high resolution. I've tryed:
{album-id}/picture?type=large
The Graph API Explorer tells me this:
"(#100) type must be one of the following values: thumbnail, small,
album",
The 'album' type is a 180x540 image. I need a higher resolution.
I figured out I can call:
{album-id}?fields=cover_photo
And get the ID of the cover photo, and then do a second call:
{cover-id}?fields=images
This will return all different sizes of the cover photo, and then I can inside my code get the resolution that best fits my needs.
However, I need to do 2 Graph API calls and yet filter the images inside my code. I tryed to filter the result with a '&width=961' but this doesn't seen to work either.
There's an easier way to get what I need?

I imagine you can use the following call to get everything in one call:
/me/albums?fields=id,name,cover_photo.fields(images)&limit=100
This will return you the list of images for each album's cover photo. You can then select the first image in the cover_photo.images array in your application. this should normally be the largest size available.
AFAIK there's no way to filter any further regarding the sizes.

Related

Get largest image from Facebook graph api photo node

I'm using the facebook graph api v2.6. I'm accessing the photo's of a user via "me/photos?fields=images". This provides an array of various sizes of the given photo. Obviously I could just run through the list and pick the largest one but I wanted to know if there is a way to limit the results returned to the largest one to reduce the payload size since I only care about the highest resolution one.
Also, please note that "type=normal" does not return the largest image (nor does it seem to work on the photos node anyway) and the "source" field is not the largest image either and that field is depreciated anyway. Thanks.
Update: please note I am not trying to access the profile image of a user, I am trying to access the photos node of the user which is all of the photos they have been tagged in. Here is the documentation: https://developers.facebook.com/docs/graph-api/reference/v2.6/user/photos
It returns a list of photos as documented here: https://developers.facebook.com/docs/graph-api/reference/photo/
The various sized images are in the "images" field and I want to know if I can restrict that to just the largest image. It doesn't appear so in the documentation but Facebook's documentation has been historically lacking...
You want get a picture for a Facebook User?
Try this way
https://graph.facebook.com/user_id/picture?type=large

Get set photo size from within a nested Facebook api call?

I am trying to get a list of all the photos posted within a Facebook event and then check if those photos have any comments. I am then searching those comments and comment replies for keywords. If the comments have the right keyword then I am saving the photo information for further processing at a later step.
My question is how can I return a certain photo size within my nested call.
Here is what I have so far:
{eventID}/?fields=photos{link,picture,comments{from,message,comments}}
This returns all the info I need other than the photo is only a thumbnail and I want a larger version of the photo?
I also want to keep it to one nested call if possible.
Thanks for any help you can provide me.
4/29 UPDATE:
I also tried this:
{eventID}/photos/?fields=images,link,comments{from,message,comments}`
However, this returns all the image sizes related to the photo and I want to be able to choose what size is returned. Is this possible?

How can I retrieve the new timeline data from the API?

At the f8-conference Facebook just announced the new timeline view. This is based on the new Open-Graph model
The question is, how is this data retrieved via the API?
Retrieval should address a number of complexities:
The filtered nature should be just like in the online view, i.e. not everything from the ticker should show up
Even more, the granularity of the timeline view should be reflected just like on the webpage (more detail today, less detail in the past, but the option to dig deeper at any time)
The aggregation view of app data should be supported
The cover image should be part of the data
Right now, it is not obvious to me if this is or will be possible at all.
In answer to agam360’s further question in the comments,
But how can we get that "Cover Photos" Id? (looping though all of the Graph data?!)
Use FQL, and take name="Cover Photos" into the WHERE condition of your query too. (But keep in mind that this album name is locale dependend, so if you should be querying the data in another locale than english, you’ll have to adapt the search term.)
Partial answer to the fourth bullet:
There is a new photo album called "Cover Photos" with the cover image on position 1. Unfortunately, there doesn't seem to be a way to find the positioning coordinates that define the viewport on the image.
{edit} There's now a cover field on a user which returns the cover photo and the x/y offset needed to display it the same way it's displayed on Facebook {/edit}

What are the max dimensions that should be used for showing facebook photos?

I am grabbing the photo's of my user's friends on my site. And, the photos of the friends look very dull, and photos seem to have a very low resolution.
How can I make sure that the photos are sharp ? Do I need to do any post processing ?
What are the max dimensions that should be used for showing photos ?
If you're grabbing profile thumbnail, it's because they get resized when you upload them to Facebook. Facebook does this automatically. If you want higher quality photos, you need to use a different API method than the the one used to get profile photos:
http://developers.facebook.com/docs/reference/api/
I'd suggest "Photos" or "Photo albums" method.
EDIT The actual dimensions for a profile photo are 50x50. If you try to display them larger than this, you're going to get loss. Non vector graphics can only contain so much data per pixel.

Getting the large picture in search results with Facebook Graph API

In Facebook Graph API, I'm trying to get the large picture of each user in a search result. The following call will give me the small picture of each user:
https://graph.facebook.com/search?q=Bob%20Grossman&fields=name,id,picture&limit=10&type=user&access_token=*
It's rather easy to get the large picture for a single user, by adding the type=large parameter. But that seems to be ignored when searching (probably since there's already a 'type' parameter used to filter the search results).
Is there any way I can do it with Graph API?
Thanks!
My approach was to pre-fetch all users with the large and square pictures so that I can choose to use either. As far as I know, you cannot do this with the Graph API because the Graph API is pre-defined to present a specific output.
Let me know if you need more information around this.