官术网_书友最值得收藏!

  • Python Social Media Analytics
  • Siddhartha Chatterjee Michal Krystyanczuk
  • 174字
  • 2021-07-15 17:24:58

Selecting the endpoint

The main endpoint for Graph API which permits to access the Facebook resources. However, we have to specify which node we want to query and the other parameters we send to the API.

url = 'https://graph.facebook.com/v2.8/' 

We will use version 2.8 of Facebook Graph API. There are small differences between versions, mostly in available endpoints, resources, and parameters. We use the basic functionalities of this API so switching between versions should not cause any problems in terms of endpoints and resources, but we have to check the documentation to pass the right arguments.

The are several scenarios we might be interested in. The first one is retrieving all the comments from a public page of a brand:

page_url = 'https://graph.facebook.com/v2.8/{page-id}/feed' 

An example using Mercedes Benz France:

page_url = 'https://graph.facebook.com/v2.8/MercedesBenzFrance/feed' 

In some cases, {page-id} may be represented by a number.

We can use the same logic to access another kind of resource such as photos for example:

page_url = 'https://graph.facebook.com/v2.8/{page-id}/photos' 

All available resources are described in the official documentation for the API.

主站蜘蛛池模板: 乐平市| 汝城县| 永兴县| 民丰县| 襄垣县| 集贤县| 佳木斯市| 兰西县| 岫岩| 新泰市| 特克斯县| 天气| 绵竹市| 上蔡县| 海伦市| 唐海县| 晴隆县| 莱西市| 长治市| 谢通门县| 上高县| 江华| 清流县| 体育| 长沙县| 宁国市| 新龙县| 原平市| 太和县| 开阳县| 彩票| 二手房| 方山县| 肥西县| 资源县| 新闻| 广河县| 潍坊市| 清流县| 榆树市| 墨竹工卡县|