- 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.
- Microsoft Dynamics 365 Extensions Cookbook
- HTML5+CSS3基礎開發教程(第2版)
- CouchDB and PHP Web Development Beginner’s Guide
- Apache Spark 2.x for Java Developers
- INSTANT Sinatra Starter
- Microsoft Azure Storage Essentials
- 動手學數據結構與算法
- 深度探索Go語言:對象模型與runtime的原理特性及應用
- QPanda量子計算編程
- SFML Game Development
- C# 7.0本質論
- 菜鳥成長之路
- Implementing Splunk(Second Edition)
- 深入實踐C++模板編程
- Visual C++ 開發從入門到精通