"Facebook" (Service Connection)

Connect your Facebook account to the Wolfram Language to analyze Facebook data like friends, comments, likes, and photos.

Connecting & Authenticating

ServiceConnect["Facebook"] creates a connection to the Facebook Graph API. If a previously saved connection can be found, it will be used; otherwise, a new authentication request will be launched.
Some requests require different permissions than those granted during authentication. The user will be asked to grant each additional permission when it is required. Some data may be unavailable, based on Facebook privacy settings.


ServiceExecute["Facebook","request",params] sends a request to the Facebook Graph API, using parameters params. The following give possible requests.

User Information


"Picture" profile picture

"PictureLink"  ▪  "Bio"  ▪  "Birthday"  ▪  "Cover"  ▪  "CoverLink"

  • "UserID"authenticated useruser ID
  • User Wall Activity Types


    "ActivityWeeklyDistribution" timing of activity types on the user's wall

    "ActivityRecentHistory" plot monthly frequency of activity types

  • "UserID"authenticated useruser ID
    "Limit"500limit of returned posts
  • Page Data


    "Description" description of the page

    "Likes" number of likes the page has received

    "Checkins" number of check-ins the page has received

    "WereHereCount" how many people have visited the page

    "Link" page's Facebook URL

    "Website" page's URL

    "TalkingAboutCount" number of people mentioning the page

    "PageName" name of the page

    "Location"  ▪  "RestaurantSpecialties"  ▪  "RestaurantServices"  ▪  "Parking"  ▪  "Phone"  ▪  "PriceRange"  ▪  "Attire"

    "DirectedBy"  ▪  "CompanyOverview"  ▪  "Mission"  ▪  "Products"  ▪  "PressContact"  ▪  "Founded"

    "BandMembers"  ▪  "Hometown"  ▪  "GeneralManager"  ▪  "CurrentLocation"  ▪  "BookingAgent"

    "About"  ▪  "PageData"  ▪  "Category"  ▪  "CategoryList"  ▪  "BestPage"  ▪  "Cover"  ▪  "CoverLink"  ▪  "CanPost"  ▪  "IsUnclaimed"  ▪  "IsPublished"  ▪  "GeneralInfo"  ▪  "PageID"

  • "PageID"(required)Facebook page ID
  • Page Tags


    "TaggedPosts" a list of posts from the specified page

    "TaggedPhotos" a list of photos posted on the page

    "TaggedVideos" a list of thumbnail links to videos posted on the page

  • "PageID"(required)Facebook page ID
  • Connection Information


    "PermissionList" permissions granted to the connection by Facebook


    Basic Examples  (1)

    Create a new connection by launching an authentication dialog:

    Get a user's profile picture:

    Get your own cover picture:

    Get a page description:

    Get the number of likes for a page:

    Get the number of people interacting with a page: