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.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.54.7