Facebook graph API 2.0 returns small photos

In my application, I am asking for the latest feeds of some selected feeds. For the request, I am using the following request (the token and app ID were hidden for this post) -

https://graph.facebook.com/me/home?access_token=my_access_token&fields=from,story,picture,link,type,message,object_id&filter=app_id&locale=en_US&limit=20

      

as a result I get a json object that contains all the requested data, BUT, the "picture" URL always points to a small image.

How can I modify my request to return a large image? I am trying to add -

&type=large

      

But it didn't work for me.

+3


source to share


1 answer


I was only able to do very basic testing, but I have a few things you can try.



  • Split API call:
    The easiest way to achieve this is to use a link similar to the one you are using for your call.
    https://graph.facebook.com/me/picture?type=large&access_token=token


    should get the right image.

  • Socket Query:
    You can try nesting queries, so called "field expansion". The request will look like this:
    &fields=from,story,picture,link,

    (a snippet of your current request) to look something like this:
    &fields=from,story,picture.type(large),link,


    where picture.type(large)

    is the part you want to pay attention to.

    You will find documentation for nesting requests here: https://developers.facebook.com/docs/graph-api/using-graph-api/v2.2#fieldexpansion

0


source







All Articles