"Facebook" (Service Connection)

Connect your Facebook account to the Wolfram Language to analyze Facebook data like friends, comments, likes, and photos. Also post messages directly from the Wolfram Language.

Connecting & Authenticating

    ServiceConnect["Facebook"] creates a connection to the Facebook 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.

Requests

    ServiceExecute[conn,"request",params] sends a request to the connection identified by conn, using parameters params. The following give possible requests.

    User Information

    Requests:

    "Picture" profile picture

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

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

    Requests:

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

    "ActivityRecentHistory" plot monthly frequency of activity types

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

    Requests:

    "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

    "Birthday" "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"

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

    Requests:

    "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

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

    Requests:

    "PermissionList" permissions granted to the connection by Facebook

Examples

Basic Examples  (1)

Create a new connection by launching an authentication dialog:

In[1]:=
Click for copyable input
Out[1]=

Get a user's profile picture:

In[2]:=
Click for copyable input
Out[2]=

Get your own cover picture:

In[3]:=
Click for copyable input
Out[3]=

Get a page description:

In[4]:=
Click for copyable input
Out[4]=

Get the number of likes for a page:

In[5]:=
Click for copyable input
Out[5]=

Get the number of people interacting with a page:

In[6]:=
Click for copyable input
Out[6]=

See Also

ServiceExecute  ▪  ServiceConnect  ▪  Twitter  ▪  Instagram