Import Facebook Page Data to Google Sheets

Import Facebook Page Data to Google Sheets

Facebook Pages serve as a business presence for many companies, displaying product info, reviews, posts, and more. In this guide, we’ll walk through how to pull Facebook fan page data from the Facebook API directly into Google Sheets, using the free API Connector add-on.

Note that the process for getting Facebook access tokens isn’t difficult, but it is rather long and can be confusing as there are several kinds of tokens: User Access Tokens, App Access Tokens, and Page Access Tokens. Further, tokens are valid for different lengths of time, and Page Access Tokens are dependent on User Access Tokens. There are many different approaches to retrieve these tokens, but the following method should be the most straightforward.


  1. Begin by navigating to, and click Create App.
  2. Fill out your details and click Create App ID. You can call your app anything, but in this example we’ll call it Google Sheets.
  3. You’ll be directed into your Developer dashboard. You don’t need to do anything in this dashboard. Instead, open up the Facebook Graph API Explorer
  4. Click Get User Access Token from the drop-down menu
  5. fb-img3

  6. A modal will appear prompting you to select the permissions you wish to access. For this example, make sure you’ve at least selected “manage_pages” and “read_insights”. Click Get Access Token.
  7. You’ll be prompted to log in and select the pages which you’d like to access via the API.
  8. Click through, ignoring any prompts to “Submit for Login Review”. We don’t need to worry about that for now.
  9. You should now see your first access token. However it only lasts for 1 hour. We can extend it by clicking the small blue icon next to the short-lived access token, and then clicking Open in Access Token Tool (link).
  10. At the bottom of this page, click Extend Access Token.
  11. This will produce a long-lived token. Click Debug to view the whole string and copy it to your clipboard. We’ll need it in a moment.


  1. You’ll first need your Facebook Page ID. Again, there are a few ways to get this, but the easiest is to open up your Facebook page and right-click on your profile picture. Click Save Link As, and paste the results into Notepad or similar. The URL should look like this:
    Note the highlighted part. This is your Facebook Page ID.
  2. Return to the Facebook Graph API Explorer. Paste the long-lived token into the “Access Token” field, and make a GET request to {page ID}?fields=access_token, making sure to substitute in your own page ID where it reads {page ID}. In this example it would be 507738226062106?fields=access_token, as shown in the screenshot below.
    Click Submit and you will see your permanent Page Access Token returned in the response.
  3. Congrats, you have your permanent Page Access Token! This means you won’t need to go through the above process again. You’re now ready to pull Page data out of Facebook’s API.


We’ll first follow the Facebook documentation to access the latest posts from your Page.

  • API root:
  • Endpoint: /{Page ID}/feed
    Endpoint Example: /507738226062106/feed
  • Query Strings: ?access_token={Page Access Token}
    Query Strings Example: ?access_token=EAAGMSKNpLKwBAILVOrvsA3yM18517sZAVi034…

Putting it together, we get the full API Request URL:…
Don’t forget to substitute in your own Page ID and Page Access Token.


We can now enter all our values into API Connector and import Page Post data into Google Sheets.

  1. Open up Google Sheets and click Add-ons > API Connector > Create New API Request.
  2. In the Create Request interface, enter the Request URL we just created. Leave the Headers selection blank, set a data destination, and click Run. A moment later you should see your most recent posts populate your Google Sheet.


  3. Experiment with endpoints and query strings as described in the documentation to see other types of page data. For example, you can access Page Insights by changing the API URL to{page ID}/insights?metric=page_fan_adds_unique,page_fan_adds&access_token={Page Access Token}. Again, remember to substitute in your actual Page ID and Page Access Token where it reads {page ID} and {Page Access Token}.

    The full list of available Insights metrics is available here:


    Anyone with Owner or Edit access to your Google Sheet can view all the information you've saved within API Connector, including API keys and other credentials. Treat these keys as passwords and limit access to your sheet accordingly.


  1. Is there a way to bring in insight information alongside the individual posts? So, after section 4 when you bring in all of the latest Facebook posts, is it possible to have additional columns with impressions, post likes etc?

    1. Hi Michael, you can do that by creating an API URL like this:{page ID}/posts?fields=insights.metric(post_impressions,post_reactions_like_total)&access_token={page access token}

      Substitute in your own page ID and access token, and you’ll see a list of all your page posts alongside impressions and likes. You can see a list of all available metrics here:

      Note that the page posts will be identified with an ID under the field data » id. To link the IDs back to a name, you can run the request described in Part 3 above, since that contains both the post ID and the post name.

  2. Bonjour,
    Merci cela semble bien mais ne marche pas pour moi!
    Pourrirez-vous mettre la fin du tuto à jour, car la création de l’url ne correspond plus à la réalité de ce qui est proposé.
    Merci de votre aide 🙂

    1. Hey Pascal can you please give me a little info about which part didn’t work for you? I just tried it again and didn’t have any problem.

Leave a Reply

Your email address will not be published.