Connect to Facebook (Power Query)

Use Excel's Get & Transform (Power Query) experience to connect to Facebook and retrieve information about selected categories, like Friends or Comments.

On the Data tab, click Get Data > From Online Services > From Facebook. If you don't see the Get Data button, click New Query > From Other Sources > From Facebook.

In the Power Query ribbon tab, click From Other Sources > From Facebook.

Note:  If this is the first time you've connected to Facebook, you will be asked to provide credentials. Sign in using your Facebook account, and allow access to the Power Query application. You can turn off future prompts by clicking the Don't warn me again for this connector option.

  1. In the Facebook dialog box, connect to Facebook using “Me”, your Username, or Object ID.

    Note:  Your Facebook username is different from your login email.

  2. Select a category to connect to from the Connection drop-down list. For example, select Friends to give you access to all information available in your Facebook Friends category.

  3. Click OK.

  4. If necessary, click Sign in from the Access Facebook dialog, then enter your Facebook email or phone number, and password. You can check the option to remain logged in. Once signed in, click Connect.

  5. After the connection succeeds, you will be able to preview a table containing information about the selected category. For instance, if you select the Friends category, Power Query renders a table containing your Facebook friends by name.

  6. Click Load or Edit.

Query Editor Formula Example

You can use the Query Editor to write formulas for Power Query.

= Facebook.Graph("")

Power Query Editor with Facebook formula

Note: The Query Editor only appears when you load, edit, or create a new query using Power Query. The following video shows the Query Editor window appearing after editing a query from an Excel workbook. To view the Query Editor without loading or editing an existing workbook query, from the Get External Data section in the Power Query ribbon tab, select From Other Sources > Blank Query. The following video shows one way to display the Query Editor.

How to see Query Editor in Excel

Need more help?

You can always ask an expert in the Excel Tech Community, get support in the Answers community, or suggest a new feature or improvement on Excel User Voice.

See Also

Get & Transform in Excel 2016

Import data from external data sources

Expand your Office skills
Explore training
Get new features first
Join Office Insiders

Was this information helpful?

Thank you for your feedback!

Thank you for your feedback! It sounds like it might be helpful to connect you to one of our Office support agents.