What is Facebook Graph API?

The Graph API is the primary way to get data into and out of the Facebook platform. It’s an HTTP-based API that apps can use to programmatically query data, post new stories, manage ads, upload photos, and perform a wide variety of other tasks.

Let’s get started

  1. Open your browser and search for Graph API
  2. Then select the first link which is shown.

Access Data From Facebook Using Facebook Graph API and Python

This will take you to this page and then select the tools option and then select graph API explorer. It will open the graph API explorer.

You have to login with your Facebook id to get started. So, first login and then start the process.

Access Data From Facebook Using Facebook Graph API and Python

As you can see there is Access token option. This token is like your password which shows who are you so, keep it safe.

The above link you can see i.e. me?fields = id, name where memeans you, fields means which fields you like to see here we can see **id and name **of the Facebook account we have signed it with.

When you click on Generate Access token button the **submit **gets enabled. When you click on the submit button you can see the fields you have entered. In this case it is id and name.

Access Data From Facebook Using Facebook Graph API and Python

At the bottom right there is an option called Add permission. Select the User data Permission option and then select the fields that you want to access such as birthday, gender, hometown etc.

Access Data From Facebook Using Facebook Graph API and Python

In this case I have selected birthday and gender option. First you have to enable it from Add permission and then on the Left side you can search and add the fields you want to access and then generate access token and click on submit to see the result.

Let’s see how we can request the Facebook server using python. So that we can access our data.

#technology #facebook #graph api #python

Access Data From Facebook Using Facebook Graph API and Python
3.85 GEEK