Get all photos of a page using Facebook API

前端 未结 2 516
暖寄归人
暖寄归人 2020-12-22 23:55

I am new to Facebook API but I have to get all photos from a Facebook page. I managed to get a graph api query that returns all pictures of only the first ever c

相关标签:
2条回答
  • 2020-12-23 00:39

    try this and let me know how it goes for you, I've successfully pulled all photos.

    1. Ensure that you are an Admin of the Facebook Page.

    2. go to : http://developers.facebook.com/tools/explorer

    3. In the API Navigator, you can see "/me" will bring up the basic information of yourself.

    4. Try typing in "/me/accounts" to see if you can see anything. It should give you an error.

    5. Click on "Get Access Token"

    6. a window will pop-up. Navigate to "Extended Permissions"

    7. Select "manage_pages"

    8. Click "Get Access Token"

    9. Now try "/me/accounts" again. You should see a list of Pages inside the viewing window.

    10. Select the Page you want, and click on the "id" field

    11. Next, on the left window, you can see "Node: " and a + sign. Click on the + sign to see what are the options you have.

    12. Click on the + sign and scroll down to "connections" and select "Albums"

    13. The child-level, select "Photos"

    14. The "Photos" child-level, select "source"

    15. Now click "Submit" on the right hand side. You will see a JSON returned with the url of all the photos in your selected Facebook Page.

    16. Copy the URL - https://graph.facebook.com/?fields=albums.fields(photos.fields(source)) and plug it into your browser. You should see a JSON of all your photos, and its corresponding url on Facebook's CDN.

    0 讨论(0)
  • 2020-12-23 00:50

    When you get your Facebook user, you can:

    • get the list of all its albums
    • get the user's profile picture
    • get the photos the user (or friend) is tagged in

    They respectively need those permissions:

    • user_photos or friends_photos
    • not needed
    • user_photos or friends_photos

    UPDATE:

    If you want to get those information from a Facebook page:

    • Photos - The Page's uploaded photos.
    • Albums - The photo albums the Page has uploaded.

    Permissions are: any valid access_token or user access_token

    0 讨论(0)
提交回复
热议问题