Retrieve data of a facebook page with graph API

2019-09-16 04:35发布

问题:

I used (in 2012) to code with FQL and I was able to make some features such as

FQL query to fetch all data of a facebook page

Actually, FB migrate to graph API.

My question is : Is it possible to retrieve public data of a page (or person) with graph API, even if I'm not a fan of that page (or not a friend )

回答1:

Yes, everything that you want to do is quite possible with the Graph API. Unless the Page / Group is private, then you will be able to fetch their public data without having to like the page.

https://developers.facebook.com/docs/graph-api

A useful tool that Facebook has provided is the Graph Explorer that allows you to test your queries and see what information will come back: https://developers.facebook.com/tools/explorer

As a specific example that you can fetch without any auth tokens: http://graph.facebook.com/cineplex will return

{
   "id": "11751844989",
   "about": "Starring Galaxy, Cineplex Odeon, SilverCity, Famous Players, Colossus, Coliseum, Cinema City & Scotiabank Theatres.",
   "can_post": false,
   "category": "Movie",
   "checkins": 0,
   "cover": {
      "cover_id": "10150491543319990",
      "offset_x": 0,
      "offset_y": 0,
      "source": "https://scontent.xx.fbcdn.net/hphotos-xpf1/v/t1.0-9/s720x720/10377524_10150491543319990_3410282243848063213_n.png?oh=47c4eb7d50a4d259236ee7c2bbb3300a&oe=55C89C6E",
      "id": "10150491543319990"
   },
   "description": "For showtimes and theatre locations check out www.cineplex.com.\n\nCineplex Entertainment is the largest motion picture exhibitor in Canada and owns, leases or has a joint-venture interest in 162 theatres with 1,639+ screens serving approximately 77 million guests annually. Headquartered in Toronto, Canada, Cineplex operates theatres across Canada and is the exclusive provider of UltraAVX\u2122 and the largest exhibitor of digital, 3D and IMAX projection technologies in the country. Proudly Canadian and with a workforce of approximately 10,000 employees. \n",
   "directed_by": "Cineplex Entertainment",
   "has_added_app": false,
   "is_community_page": false,
   "is_published": true,
   "likes": 414426,
   "link": "https://www.facebook.com/Cineplex",
   "name": "Cineplex",
   "parking": {
      "lot": 0,
      "street": 0,
      "valet": 0
   },
   "phone": "1-800-333-0061",
   "plot_outline": "ESCAPE WITH US",
   "starring": "Cineplex Odeon, Galaxy, SilverCity, Scotiabank Theatres, Famous Players, Colossus, Coliseum and Cinema City",
   "talking_about_count": 5147,
   "username": "Cineplex",
   "website": "www.cineplex.com",
   "were_here_count": 0
}