Socialbakers API Documentation

Introduction

The Socialbakers REST API allows access to the data points used in Socialbakers suite. Access to the API is available on request for Socialbakers clients only.

If you are interested in the API access, please contact our support team (support@socialbakers.com).

Security and authentication

The API is secured with HTTPS. Authentication is made using Basic HTTP Authorization by token and secret. The authorization is sent in the HTTP headers.

The token and secret are linked to a specific user of a Socialbakers Suite account. Get in touch with our Support team at support@socialbakers.com to get yours.

Basic HTTP Authorization using token and secret

Basic HTTP Authorization uses a token and secret with a colon between them encoded to base64 format.

Example: if we use "Aladdin" as a token and "OpenSesame" as a secret, then "Aladdin:OpenSesame" produces "QWxhZGRpbjpPcGVuU2VzYW1l" when encoded to base64 format.

The parameter in the HTTP header would be then: Authorization: Basic QWxhZGRpbjpPcGVuU2VzYW1l

Example request

GET /2/facebook/profiles HTTPS
Host: api.socialbakers.com
Authorization: Basic QWxhZGRpbjpPcGVuU2VzYW1l
Content-Type: application/json; charset=utf-8

Limits

Rate limits are defined for account and for user:

  • Account: 1000 requests per hour
  • User: 500 requests per hour

Each metrics request is limited by maximum number of:

  • Profiles: 25
  • Metrics: 25
  • Date range: 3 months

Date range is not relative to curent date, so you are able to query historical data.

If you need to query with more profiles, metrics or date range than the limits allow, you can split it into multiple requests.

The oldest historical data you are able to request for is limited by your subscription package.

Errors

If error occurs in any endpoint, standardized error response will be returned.

Error codes

Code Endpoint Description
3 all Input validation error
4 all Profiles, metrics or date range limit exceeded
5 all Profiles not allowed for user
6 all Start date is before history limit date
7 all Profiles do not have insights enabled
8 all Labels used for filtering do not exists
10 all Account request limit exceeded
11 all User request limit exceeded
99 all An unknown error occurred
400 all Bad request
401 all Missing authorization header, invalid secret or token
403 all Action is not permitted
404 all Resource not allowed
405 all HTTP method not allowed
500 all Internal server error
Example response
                {
  "success": false,
  "errors": [
    {
      "code": 3,
      "errors": [
        "Input validation error.",
        "Invalid metrics requested: metric1"
      ]
    },
    {
      "code": 5,
      "errors": [
        "Profiles not allowed for user.",
        "Profiles [164929129743] not allowed."
      ]
    }
  ]
}
              

Reference Data

Lists of values allowed to be used by other endpoints as data sources or filters.

List of Connected Profiles

Returns the list of connected Facebook, Instagram, Twitter, YouTube, LinkedIn, Pinterest or Vkontakte profiles for your account. You will need the profile ID later to call metrics endpoints.

Example request

              GET /2/{network}/profiles HTTPS
Host: api.socialbakers.com
Authorization: Basic base64_encoded_auth
Content-Type: application/json; charset=utf-8
Supported values for {network}: facebook, instagram, twitter, youtube, linkedin, pinterest, vkontakte

Response fields

Name Description
id string, profile unique identifier on the social network.
name string, profile name
profile_name string, profile unique name on the social network.
picture string, profile picture on the social network.
timezone string, timezone selected for this profile in Socialbakers product.
profile_labels array, list of labels assigned to a given profile in the account.
insights_enabled boolean, available for facebook and instagram networks only, true if insights metrics are available for profile.
Example response
{
  "success": true,
  "profiles": [
    {
      "id": "164929129743",
      "name": "Profile #1 name",
      "profile_name": "profile1name",
      "picture": "https://example.cdn.com/picture.hash.png"
      "timezone": "America/Los_Angeles",
      "insights_enabled": true
    },
    {
      "id": "477018229123929",
      "name": "Profile #2 name",
      "picture": "https://example.cdn.com/picture.hash.png"
      "profile_name": "profile2name",
      "timezone": "Europe/Prague"
    },
    ...
  ]
}

List of Post Labels

Post labels are used to label content (posts, videos) across multiple platforms in Suite. The endpoint returns the list of all global post labels available in your account. These labels are identified by name and ID.

You can use the post label IDs to filter the posts or the results of the aggregated post metrics.

Example request

              POST /2/post/labels HTTPS
Host: api.socialbakers.com
Authorization: Basic base64_encoded_auth
Content-Type: application/json; charset=utf-8

Response fields

Name Description
id string, post label unique identifier
name string, post label name
Example response
{
  "success": true,
  "data": [
    {
      "id": "5d879004a44a4cbcb13e",
      "name": "Post Label 1"
    },
    {
      "id": "ffc196eb056b42fd9b03",
      "name": "Post Label 2"
    },
    ...
  ]
}

List of Profile Labels

Profile labels are used to label profiles across multiple platforms in Suite. The endpoint returns the list of all global profile labels available in your account. These labels are identified by name and ID.

Example request

            POST /2/profile/labels HTTPS
                Host: api.socialbakers.com
                Authorization: Basic base64_encoded_auth
                Content-Type: application/json; charset=utf-8

Response fields

Name Description
id string, profile label unique identifier
name string, profile label name
profiles array, information about profile tagged with the specific profile label
Example response
{
    "success": true,
    "data": [
        {
            "id": "5d879004a44a4cbcb13e",
            "name": "Profile Label 1",
            "profiles": [
                {
                    "name": "Profile 1",
                    "platform": "facebook"
                },
                {
                    "name": "Profile 2",
                    "platform": "twitter"
                }
            ]
        },
        {
            "id": "ffc196eb056b42fd9b03",
            "name": "Profile Label 2",
            "profiles": [],
        },
        ...
    ]
}

Profile Metrics

Profile metrics endpoints return daily values for the specified set of metrics and profiles.

Profile metrics attribute data to the profile/page, focusing on when engagement happened, regardless if a post was published during the analyzed date range or not. Data is aggregated by when it happened, and it is not related to a specific piece of content.

Aggregation is the type of calculation used for grouping values of a specific metric.

Facebook Metrics

Returns daily metrics for each requested Facebook profile.

Parameters

Name Description
date_start, date_end string, the beginning / end of the period you want to get the data for in the format YYYY-MM-DD. The response uses a timezone assigned to a profile in Suite settings of the account. The last day will be also included in the response.
profiles object, the list of string values. Each is ID of the profile available from the /2/facebook/profiles endpoint.
metrics array, the list of metrics that will be returned in the response. Available metrics are listed in the table below.
dimensions array of {type: dimensionType} objects. The data of the metric can be split by a specific dimension. The most common dimension is time. See the list of available dimension types for each metric in the table below.
Basic Metrics
Name Dimensions Aggregation Metric description
fans_change date.day,
date.month,
date.week,
profile,
profile_label
sum Absolute change of fans count of a page. No data available for FB pages that is part of the Global Page Structure and does not have insights connected.
fans_lifetime date.day,
date.month,
date.week,
profile,
profile_label
avg Total number of likes (=fans) of a page. No data available for FB pages that is part of the Global Page Structure and does not have insights connected.
Insights Metrics

Metrics prefixed with insights_ can only be used for profiles that have insights_enabled property set to true in the response of the /2/facebook/profiles endpoint.

Name Dimensions Aggregation Metric description
insights_activity date.day,
date.month,
date.week,
profile,
profile_label,
activity_type
sum Number of activities created about your Page. (Total Count)
insights_activity_unique date.day,
date.month,
date.week,
profile,
profile_label,
activity_type,
gender_age,
city,
country,
locale
avg The number of activities created about your Page. (Unique Users).
insights_engaged_users date.day,
date.month,
date.week,
profile,
profile_label
avg Number of people who engaged with your Page. Engagement includes any click or story created. (Unique Users).
insights_fan_adds date.day,
date.month,
date.week,
profile,
profile_label,
like_source
sum Number of new people who have liked your Page.
insights_fan_adds_unique date.day,
date.month,
date.week,
profile,
profile_label,
like_source
avg New Likes : Number of new people who have liked your Page (Unique Users)
insights_fan_removes date.day,
date.month,
date.week,
profile,
profile_label
sum Number of Unlikes of your Page (Total Count)
insights_fan_removes_unique date.day,
date.month,
date.week,
profile,
profile_label,
unlike_source
avg Number of Unlikes of your Page (Unique Users).
insights_fans_lifetime date.day,
date.month,
date.week,
profile,
profile_label,
country,
city,
locale,
gender_age
avg The total number of people who have liked your Page. (Unique Users)
insights_fans_online date.day,
date.month,
date.week,
profile,
profile_label,
hour_of_day
sum Number of fans who saw any posts on a given day.
insights_impressions date.day,
date.month,
date.week,
profile,
profile_label,
activity_type,
post_attribution
sum Total number of times any content associated with your page has been seen
insights_negative_feedback date.day,
date.month,
date.week,
profile,
profile_label
sum The number of times people have given negative feedback to your Page. (Total Count).
insights_positive_feedback date.day,
date.month,
date.week,
profile,
profile_label,
positive_feedback_type
sum The number of times people have given positive feedback to your Page. (Total Count).
insights_post_clicks date.day,
date.month,
date.week,
profile,
profile_label,
click_type
sum The number of clicks on any of your content. Clicks generating stories are included in 'Other Clicks.'
insights_post_clicks_unique date.day,
date.month,
date.week,
profile,
profile_label,
click_type
avg The number of people who clicked on any of your content. Clicks that create stories are included in "Other Clicks." Stories that are created without clicking on Page content (ex, liking the Page from timeline) are not included. (Unique Users)
insights_post_impressions date.day,
date.month,
date.week,
profile,
profile_label,
post_attribution
sum The total number of impressions that came from all of your posts.
insights_post_reach date.day,
date.month,
date.week,
profile,
profile_label,
post_attribution,
frequency_distribution
avg The number of people who saw any of your Page posts. (Unique Users). Note: The sum of each breakdown from the dimension frequency_distribution will not equal the total of insights_post_reach metric.
insights_reach date.day,
date.month,
date.week,
profile,
profile_label,
gender_age,
post_attribution
avg The number of people who have seen any content associated with your Page. (Unique Users)
insights_reach_28_days date.day,
date.month,
date.week,
profile,
profile_label,
gender_age
avg The number of people who have seen any content associated with your Page in the past 28 days. (Unique Users)
insights_reach_7_days date.day,
date.month,
date.week,
profile,
profile_label,
gender_age
avg The number of people who have seen any content associated with your Page in the past 7 days. (Unique Users)
insights_reach_engagement date.day,
date.month,
date.week,
profile,
profile_label
avg The total number of people who engaged with your Page per the number of people who have seen any content associated with your Page. Engagement includes any click or story created. (Unique Users)
insights_reactions date.day,
date.month,
date.week,
profile,
profile_label,
reaction_type
sum The number of reactions on any of your content
insights_video_complete_views_30s date.day,
date.month,
date.week,
profile,
profile_label,
play_type,
post_attribution
sum Total number of times page's videos have been played for more than 30 seconds
insights_video_complete_views_30s_repeat_views date.day,
date.month,
date.week,
profile,
profile_label
sum Number of times that people replay a page's videos for more than 30 seconds.
insights_video_complete_views_30s_unique date.day,
date.month,
date.week,
profile,
profile_label
avg Number of times page's videos have been played for unique people for more than 30 seconds.
insights_video_repeat_views date.day,
date.month,
date.week,
profile,
profile_label
sum Total number of times that people replay a page's videos for more than 3 seconds
insights_video_views date.day,
date.month,
date.week,
profile,
profile_label,
play_type,
post_attribution
sum Total number of times page's videos have been played for more than 3 seconds
insights_video_views_unique date.day,
date.month,
date.week,
profile,
profile_label
avg Total number of times page's videos have been played for unique people for more than 3 seconds
insights_views date.day,
date.month,
date.week,
profile,
profile_label
sum The number of times a Page's profile has been viewed by logged in and logged out people.

Example request

POST /2/facebook/metrics HTTPS
Host: api.socialbakers.com
Authorization: Basic base64_encoded_auth
Content-Type: application/json; charset=utf-8

{
  "date_start": "2016-01-01",
  "date_end": "2016-01-02",
  "profiles": [
	"164929129743"
  ],
  "metrics": ["fans_lifetime"],
  "dimensions": [
  {
	"type": "date.day"
  }
  ]}

Example response


{
  "success": true,
  "header": [{
  "type": "date.day",
  "rows": [
	"2016-01-01",
	"2016-01-02"
  ]},
  {
  "type": "metric",
  "rows": [
	"fans_lifetime"
  ]
  }
  ],
  "data": [
  [
	209119
  ],
  [
	209171
  ]
  ]
}

Instagram Metrics

Returns daily metrics for each requested Instagram profile.

Parameters

Name Description
date_start, date_end string, the beginning / end of the period you want to get the data for in the format YYYY-MM-DD. The response uses a timezone assigned to a profile in Suite settings of the account. The last day will be also included in the response.
profiles The list of string values. Each is ID of the profile available from the /2/instagram/profiles endpoint.
metrics The list of metrics that will be returned in the response. Available metrics are listed in the table below.
Basic Metrics
Name Dimensions Aggregation Metric description
followers_change date.day,
date.month,
date.week,
profile,
profile_label
sum Absolute change of followers count lifetime.
followers_lifetime date.day,
date.month,
date.week,
profile,
profile_label
avg Total number of followed-by of a user by day. Number is aggregated to the midnight of profile timezone.
following_change date.day,
date.month,
date.week,
profile,
profile_label
sum Absolute change of follows of a user by day. Number is aggregated to the midnight of profile timezone.
following_lifetime date.day,
date.month,
date.week,
profile,
profile_label
avg Total number of people profile follows.
Insights Metrics

Metrics prefixed with insights_ can only be used for profiles that have insights_enabled property set to true in the response of the /2/instagram/profiles endpoint.

Name Dimensions Aggregation Metric description
insights_followers date.day,
date.month,
date.week,
profile,
profile_label,
country,
locale,
city,
gender_age
avg Total number of followed-by of a user by day. Total value from this metric may not equal the value from dimension.
insights_impressions date.day,
date.month,
date.week,
profile,
profile_label
avg Total number of times your posts and stories were viewed.
insights_impressions_28_days date.day,
date.month,
date.week,
profile,
profile_label
avg Total number of times your posts and stories were viewed in past 28 days.
insights_impressions_7_days date.day,
date.month,
date.week,
profile,
profile_label
avg Total number of times your posts and stories were viewed in the past 7 days.
insights_profile_clicks date.day,
date.month,
date.week,
profile,
profile_label,
click_target
sum The number of times user clicked on any contact links on your Business Account's profile.
insights_profile_views date.day,
date.month,
date.week,
profile,
profile_label
avg The number of unique accounts who've visited your business profile.
insights_reach date.day,
date.month,
date.week,
profile,
profile_label
avg Number of unique accounts who viewed your posts and stories.
insights_reach_28_days date.day,
date.month,
date.week,
profile,
profile_label
avg Total number of people who have viewed any of your posts and stories in the past 28 days.
insights_reach_7_days date.day,
date.month,
date.week,
profile,
profile_label
avg Total number of people who have viewed any of your posts and stories in the past 7 days.

Example request

POST /2/instagram/metrics HTTPS
Host: api.socialbakers.com
Authorization: Basic base64_encoded_auth
Content-Type: application/json; charset=utf-8

{
  "date_start": "2016-01-01",
  "date_end": "2016-01-02",
  "profiles": ["4108894671", "337453282"],
  "metrics": ["followers_change"],
  "dimensions": [
    {
      "type": "date.day"
    }
  ]
}

Example response


{
  "success":true,
  "header":[
      {
        "type":"date.day",
        "rows":[
            "2016-01-01",
            "2016-01-02"
        ]
      },
      {
        "type":"metric",
        "rows":[
            "followers_change"
        ]
      }
  ],
  "data":[
      [
        209119
      ],
      [
        209171
      ]
  ]
}

Twitter Metrics

Returns daily metrics for each requested Twitter profile.

Parameters

Name Description
date_start, date_end string, the beginning / end of the period you want to get the data for in the format YYYY-MM-DD. The response uses a timezone assigned to a profile in Suite settings of the account. The last day will be also included in the response.
profiles The list of string values. Each is ID of the profile available from the /2/twitter/profiles endpoint.
metrics The list of metrics that will be returned in the response. Available metrics are listed in the table below.
Basic Metrics
Name Dimensions Aggregation Metric description
ff_ratio date.day,
date.month,
date.week,
profile,
profile_label
avg Ratio of total followers and total following aggregated by day.
followers_change date.day,
date.month,
date.week,
profile,
profile_label
sum Absolute change of followers (=fans) of a profile. Number is aggregated by day.
followers_lifetime date.day,
date.month,
date.week,
profile,
profile_label
avg Total number of followers (=fans) of a profile. Number is aggregated by day.
following_change date.day,
date.month,
date.week,
profile,
profile_label
sum Absolute change of how many people profile follows. Number is aggregated by day.
following_lifetime date.day,
date.month,
date.week,
profile,
profile_label
avg Total number of how many people profile follows
listed_change date.day,
date.month,
date.week,
profile,
profile_label
sum Absolute change of on how many lists profile appears.
listed_lifetime date.day,
date.month,
date.week,
profile,
profile_label
avg Total count of on how many lists profile appears.

Example request

POST /2/twitter/metrics HTTPS
Host: api.socialbakers.com
Authorization: Basic base64_encoded_auth
Content-Type: application/json; charset=utf-8

{
  "date_start": "2020-05-10",
	"date_end": "2020-05-18",
	"profiles": [ "78569316" ],
	"metrics": [ "ff_ratio" ],
	"dimensions": [
		{ "type": "profile" },
		{ "type": "date.day" }
	]
}

Example response


{
  "success": true,
  "header": [
    {
      "type": "profile",
      "rows": [
        "78569316"
      ]
    },
    {
      "type": "date.day",
      "rows": [
        "2020-05-10",
        "2020-05-11",
        "2020-05-12",
        "2020-05-13",
        "2020-05-14",
        "2020-05-15",
        "2020-05-16",
        "2020-05-17",
        "2020-05-18"
      ]
    },
    {
      "type": "metric",
      "rows": [
        "ff_ratio"
      ]
    }
  ],
  "data": [
    [
      [
        95.75070224719101
      ],
      [
        95.7436797752809
      ],
      [
        95.19622905027933
      ],
      [
        95.12351709699931
      ],
      [
        95.12072575017446
      ],
      [
        95.11235170969994
      ],
      [
        95.10118632240057
      ],
      [
        95.0907187718074
      ],
      [
        95.07327285415212
      ]
    ]
  ]
}

YouTube Metrics

Returns daily metrics for each requested YouTube profile.

Parameters

Name Description
date_start, date_end string, the beginning / end of the period you want to get the data for in the format YYYY-MM-DD. The response uses a timezone assigned to a profile in Suite settings of the account. The last day will be also included in the response.
profiles The list of string values. Each is ID of the profile available from the /2/youtube/profiles endpoint.
metrics The list of metrics that will be returned in the response. Available metrics are listed in the table below.
Metrics
Name Dimensions Aggregation Metric Description
interaction_change date.day,
date.month,
date.week,
profile,
profile_label,
interaction_type
sum Daily growth of interactions on all uploaded videos by the channel on a given day. Number is aggregated by day to the midnight of UTC timezone.
interactions_per_1k_fans date.day,
date.month,
date.week,
profile,
profile_label
sum Daily growth of interactions per 1000 fans on all uploaded videos by the channel on a given day. Number is aggregated by day to the midnight of UTC timezone.
subscribers_change date.day,
date.month,
date.week,
profile,
profile_label
sum Absolute change of subscribers count lifetime.
subscribers_lifetime date.day,
date.month,
date.week,
profile,
profile_label
avg Total number of subscribers of the channel.
video_lifetime date.day,
date.month,
date.week,
profile,
profile_label
avg Total number of uploaded videos by the channel on a given day. Number is aggregated by day to the UTC midnight.
viewed_time_change date.day,
date.month,
date.week,
profile,
profile_label
sum Absolute daily growth of viewed time. Number is aggregated by day to the midnight of UTC. All values are provided in seconds.
views_change date.day,
date.month,
date.week,
profile,
profile_label
sum This is the absolute daily growth of views. Number is aggregated by day to the midnight of UTC timezone.

Example request

POST /2/youtube/metrics HTTPS
Host: api.socialbakers.com
Authorization: Basic base64_encoded_auth
Content-Type: application/json; charset=utf-8

{
	"date_start": "2016-01-01",
	"date_end": "2016-01-02",
	"profiles": [
		"UCA6AG33Zac0xi6f9VMTxkFQ",
		"UCCAg0pGh47apFzefcJN6x3w"
	],
	"metrics": ["subscribers_change"],
	"dimensions": [{
		"type": "date.day"
	}]
}

Example response

{
      "success": true,
      "header": [
          {
              "type": "date.day",
              "rows": [
                  "2016-01-01",
                  "2016-01-02"
              ]
          },
          {
              "type": "metric",
              "rows": [
                  "subscribers_change"
              ]
          }
      ],
      "data": [
          [
              -3
          ],
          [
              1
          ]
      ]
  }

LinkedIn Metrics

Returns daily metrics for each requested LinkedIn profile.

Parameters

Name Description
date_start, date_end string, the beginning / end of the period you want to get the data for in the format YYYY-MM-DD. The response uses a timezone assigned to a profile in Suite settings of the account. The last day will be also included in the response.
profiles The list of string values. Each is ID of the profile available from the /2/linkedin/profiles endpoint.
metrics The list of metrics that will be returned in the response. Available metrics are listed in the table below.
Metrics
Name Dimensions Aggregation Metric Description
followers_change date.day,
date.month,
date.week,
profile,
profile_label
sum Absolute change of followers of a company by day. Number is aggregated to the midnight of selected timezone.
followers_lifetime date.day,
date.month,
date.week,
profile,
profile_label
avg Total number of followers of a company by day. Number is aggregated to the midnight of selected timezone.

Example request

POST /2/linkedin/metrics HTTPS
  Host: api.socialbakers.com
  Authorization: Basic base64_encoded_auth
  Content-Type: application/json; charset=utf-8

  {
      "date_start": "2016-01-01",
      "date_end": "2016-01-02",
      "profiles": [
          "urn:li:organization:14846557"
      ],
      "metrics": ["followers_change"],
      "dimensions": [{
          "type": "date.day"
      }]
  }

Example response

{
        "success": true,
        "header": [
            {
                "type": "date.day",
                "rows": [
                    "2016-01-01",
                    "2016-01-02"
                ]
            },
            {
                "type": "metric",
                "rows": [
                    "followers_change"
                ]
            }
        ],
        "data": [
            [
                2
            ],
            [
                1
            ]
        ]
    }

Pinterest Metrics

Returns daily metrics for each requested Pinterest profile.

Parameters

Name Description
date_start, date_end string, the beginning / end of the period you want to get the data for in the format YYYY-MM-DD. The response uses a timezone assigned to a profile in Suite settings of the account. The last day will be also included in the response.
profiles The list of string values. Each is ID of the profile available from the /2/pinterest/profiles endpoint.
metrics The list of metrics that will be returned in the response. Available metrics are listed in the table below.
Metrics
Name Dimensions Aggregation Metric description
boards_change date.day,
date.month,
date.week,
profile,
profile_label
sum Absolute change of number of profile boards. Number is aggregated by day.
boards_lifetime date.day,
date.month,
date.week,
profile,
profile_label
avg Total number of boards of the profile.
followers_change date.day,
date.month,
date.week,
profile,
profile_label
sum Absolute change of followers of a profile.
followers_lifetime date.day,
date.month,
date.week,
profile,
profile_label
avg Total number of followers of the profile. Number is aggregated by day.
following_change date.day,
date.month,
date.week,
profile,
profile_label
sum Absolute change of followed profiles. Number is aggregated by day.
following_lifetime date.day,
date.month,
date.week,
profile,
profile_label
avg Total number of followed profiles.
pins_lifetime date.day,
date.month,
date.week,
profile,
profile_label
avg Total number of pins of the profile.

Example request

        POST /2/pinterest/metrics HTTPS
Host: api.socialbakers.com
Authorization: Basic base64_encoded_auth
Content-Type: application/json; charset=utf-8

{
  "date_start": "2020-05-10",
	"date_end": "2020-05-18",
	"profiles": [ "376684093741466051" ],
	"metrics": [ "boards_change" ],
	"dimensions": [
		{ "type": "profile" },
		{ "type": "date.day" }
	]
}
      
   

Example response


      {
        "success": true,
        "header": [
            {
                "type": "profile",
                "rows": [
                    "376684093741466051"
                ]
            },
            {
                "type": "date.day",
                "rows": [
                    "2020-05-10",
                    "2020-05-11",
                    "2020-05-12",
                    "2020-05-13",
                    "2020-05-14",
                    "2020-05-15",
                    "2020-05-16",
                    "2020-05-17",
                    "2020-05-18"
                ]
            },
            {
                "type": "metric",
                "rows": [
                    "boards_change"
                ]
            }
        ],
        "data": [
            [
                [
                    0
                ],
                [
                    0
                ],
                [
                    0
                ],
                [
                    0
                ],
                [
                    0
                ],
                [
                    0
                ],
                [
                    0
                ],
                [
                    0
                ],
                [
                    0
                ]
            ]
        ]
    }

Posts

The endpoints in this section return a list of posts/videos/tweets, accompanied by the fields you specify. It can be an attribute of the post (text, created time, author, id, paid status) or metric (Number of comments, Number of Likes).

Facebook Page Posts Metrics

Returns a set of posts created during the specified date range for each requested Facebook profile. Facebook posts endpoint returns lifetime values of the metrics.

Parameters

Name Description
profiles array, list of profile IDs of the profiles available from the /2/facebook/profiles endpoint.
date_start, date_end string, the beginning / end of the period you want to get the data for in the format YYYY-MM-DD. Your request is transformed using the time zone assigned to a profile in the Suite settings of your account. The response of the endpoint displays the date/time in UTC time zone. You can shift the date/time to the correct timezone using the timezone of each individual profile from the /2/facebook/profiles endpoint. The last day will be also included in the response.
fields array, the list of fields that will be returned in the response. Available fields are listed in the table below.
limit integer, (optional). The number of results per page. The default value is 10 and the maximal value is 500.
after string, (optional). Pagination cursor. Points to the end of the page that has been returned.
sort You can sort the results by specifying a field and sorting order in the sort object: "field": "created_time" and "order": "desc". See the list of fields allowed for sorting.
filter You can filter results by providing the filter parameter with field and value. See the list of fields allowed for filtering.
Basic Fields
Name Type Example Description
attachments array
[{ "title": "Know Where You Stand on Social Media", "description": "Get a free customized report that will provide you with detailed data insights showing you where you stand vereses your competition on Facebook. Try it now! ", "url": "https://goo.gl/AtTi93", "image_url": "https://external.xx.fbcdn.net/safe_image.php?d=AQCXbmZ491Pwd29M&url=https%3A%2F%2Fcdn.socialbakers.com%2Fwww%2Fstorage%2Fmicrosites%2Fkyn%2FOG-KYN.jpg"}]
Array of objects containing details about post attachments. Fields: title, description, url, image_url.
author_id string
164929129743
Facebook page post author profile id.
comments integer
100
Facebook post comments count.
created_time datetime
2016-10-24T16:15:04+00:00
Facebook post created time.
engagement_rate float
4.2
Engagement Rate for a particular post displays the average number of Interactions per Fan. Engagement Rate is therefore calculated by dividing the number of Interactions of a post by the number of Fans on that day.
id string
164929129743_10154702368914744
Facebook post id.
interactions integer
100
Facebook post interaction count.
is_published boolean
true
Is post published
message string
A free tool that delivers a custom benchmark report, in minutes, so you can easily understand how well you are using social media to nurture customer relationships. Do you know your numbers?
Facebook post contents.
page_id string
164929129743
Facebook page id for the published post.
post_labels array
[{"id": "as3442fs", "name": "label 1"}, {"id": "vz4451jg", "name": "label 2"}]
Array of post labels for given post and account
ppd_status string
paid|organic|unknown
Indicates whether the post was organic, paid or unknown based on PPD algorithm.
reactions integer
100
Facebook post reactions count.
reactions_by_type object
{"like": 548, "love": 2, "wow": 2, "haha": 0, "sorry": 0, "anger": 0}
Object containing Facebook post reactions number.
shares integer
100
Facebook post share count.
story string
Socialbakers published a note
Text from stories not intentionally generated by users, such as those generated when two people become friends, or when someone else posts on the person's wall.
type string
photo|status|link|video|offer|note|poll|unknown
Facebook post type.
universal_video_id string
164929129743_10156499215049744
The publishers asset management code for this video. Only available in case the post type is a video.
url string
https://www.facebook.com/permalink.php?story_fbid=10154702368914744&id=164929129743
Link to facebook post.
video_id string
10156498782054744
The id of the video object. Only available in case the post type is a video.
video_length float
125.481
Duration of the video in seconds. Only available in case the post type is a video.
Insights Fields

Metrics prefixed with insights_ can only be used for profiles that have insights_enabled property set to true in the response of the /2/facebook/profiles endpoint.

Name Type Example Description
insights_engaged_fan integer
100
People who have liked your page and engaged with your post.
insights_engaged_users integer
100
The number of people who clicked anywhere in your posts
insights_engagement_rate float
0.0378
Reach shows you how many people were exposed to your content and Reach Engagement Rate shows you how many of those reached people actually interacted with it.
insights_impressions integer
100
The number of impressions for your Page post
insights_impressions_by_paid_non_paid object
{ "paid": 0, "unpaid": 7655, "total": 7655 }
The number of impressions for your Page post, broken down by total, paid, and non-paid
insights_impressions_fan integer
100
The number of impressions for your Page post by people who have liked your Page
insights_impressions_fan_paid integer
100
The number of impressions for your Page post by people who like your Page in an Ad or Sponsored Story
insights_impressions_organic integer
100
The number of impressions of your post in Newsfeed, Ticker, or on your Page's Wall
insights_impressions_paid integer
100
The number of impressions for your Page post in an Ad or Sponsored Story
insights_negative_feedback integer
100
The number of times people took a negative action in your post (e.g. hid it)
insights_negative_feedback_unique integer
100
The number of people who took a negative action in your post (e.g., hid it)
insights_paid_status string
paid|organic
Whether the post has been promoted (received any paid impression) or not
insights_post_clicks integer
100
The number of times people clicked on anywhere in your posts without generating an activity
insights_post_clicks_by_type object
{"photo view": 368, "other clicks": 186, "link clicks": 1, "video play": 0},
The number of times people clicked on anywhere in your posts without generating an activity, broken-down by post click type.
insights_post_clicks_by_type_unique object
{"photo view": 4, "other clicks": 15, "link clicks": 46, "video play": 0},
The number of people who clicked anywhere in your post without generating an activity, broken-down by post click type.
insights_post_clicks_unique integer
100
The number of people who clicked anywhere in your post without generating an activity.
insights_reach integer
100
The number of people who saw your Page post
insights_reach_by_paid_non_paid object
{ "paid": 0, "unpaid": 7655, "total": 7655 }
The number of people who saw your Page post, broken down by total, paid, and non-paid
insights_reach_fan integer
100
The number of people who have like your Page who saw your Page post
insights_reach_fan_paid integer
100
The number of people who have like your Page and saw your Page post in an Ad or Sponsored Story
insights_reach_organic integer
100
The number of people who saw your post in their Newsfeed or Ticker or on your Page's Wall
insights_reach_paid integer
100
The number of people who saw your Page post in an Ad or Sponsored Story
insights_reactions_by_type_total object
{"like": 8, "love": 0, "wow": 0, "haha": 0, "sorry": 0, "anger": 0}
The number of reactions to a Page's post by reaction type.
insights_reactions_like_total integer
100
The number of "like" reactions to a post.
insights_stories integer
100
The number of stories created about your Page (Stories)
insights_story_adds integer
100
The number of stories generated about your Page post.
insights_storytellers integer
100
The number of people sharing stories about your page ("People Talking About This" / PTAT). These stories include liking your Page, posting to your Page's Wall, liking, commenting on or sharing one of your Page posts, answering a Question you posted, RSVPing to one of your events, mentioning your Page, phototagging your Page or checking in at your Place
insights_video_avg_time_watched integer
100
The average length of time (in milliseconds) people spent viewing your video
insights_video_complete_views_30s integer
100
Total number of times Page's videos have been viewed for more than 30 seconds
insights_video_complete_views_30s_autoplayed integer
100
Total number of times Page's autoplayed videos have been viewed to the end, or viewed for more than 30 seconds
insights_video_complete_views_30s_clicked_to_play integer
100
Total number of times Page's videos have been viewed to the end, or viewed after the user clicks on play for more than 30 seconds
insights_video_complete_views_30s_organic integer
100
Total number of times Page's videos have been viewed to the end, or viewed for more than 30 seconds by organic reach
insights_video_complete_views_30s_paid integer
100
Total number of times Page's promoted videos have been viewed to the end, or for more than 30 seconds
insights_video_complete_views_30s_unique integer
100
Total number of times Page's videos have been played for unique people to the end, or viewed for more than 30 seconds
insights_video_complete_views_organic integer
100
The number of times your video was organically viewed from the beginning to 95% of its length
insights_video_complete_views_organic_unique integer
100
The number of people who viewed your video organically from the beginning to 95% of its length
insights_video_complete_views_paid integer
100
The number of times your video was viewed via paid impression from the beginning to 95% of its length
insights_video_complete_views_paid_unique integer
100
The number of people who viewed your video via paid impression from the beginning to 95% of its length
insights_video_retention_graph array
[0.6680000000000001, 1, 0.9683999999999999, 0.8257000000000001, 0.7319000000000001, 0.6640000000000001]
Percentage of viewers at each interval. Video length is divided into short buckets. Each key in response represents a bucket. Values are percent of people saw the video in that bucket
insights_video_retention_graph_autoplayed array
[0.6680000000000001, 1, 0.9683999999999999, 0.8257000000000001, 0.7319000000000001, 0.6640000000000001]
Percentage of viewers at each interval where the video started playing automatically. Video length is divided into short buckets. Each key in response represents a bucket. Values are percent of people saw the video in that bucket
insights_video_view_time integer
100
The total number of milliseconds your video was watched, including replays and views less than 3 seconds.
insights_video_view_time_by_age_bucket_and_gender object
{"M.25-34": 41521414, "U.18-24": 6220}
The total time, in milliseconds, your video played for your Top Audiences, age and gender
insights_video_view_time_by_country_id object
{"US":123, "CZ":54, "DE":6}
The total number of minutes your video played for your Top 45 Locations - Countries
insights_video_view_time_organic integer
100
Total time (in milliseconds) video has been viewed without paid promotion
insights_video_view_time_paid integer
100
Total time (in milliseconds) video has been viewed with paid promotion
insights_video_views integer
100
The number of times your video was watched for an aggregate of at least 3 seconds, or for nearly its total length, whichever happened first.
insights_video_views_autoplayed integer
100
Number of times your video started automatically playing and people viewed it for more than 3 seconds
insights_video_views_clicked_to_play integer
100
Number of times people clicked to play your video and viewed it more than 3 seconds
insights_video_views_organic integer
100
The number of times your video was organically viewed for 3 seconds or more
insights_video_views_organic_unique integer
100
The number of people who viewed at least 3 seconds of your video organically
insights_video_views_paid integer
100
The number of times your video was viewed via paid impression for 3 seconds or more
insights_video_views_paid_unique integer
100
The number of people who viewed at least 3 seconds of your video via paid impression
insights_video_views_unique integer
100
The number of distinct people who viewed your video at least once.

Fields that might be used to sort Facebook posts:
Basic Fields
  • comments
  • created_time
  • interactions
  • reactions
  • reactions_by_type.anger
  • reactions_by_type.haha
  • reactions_by_type.like
  • reactions_by_type.love
  • reactions_by_type.sorry
  • reactions_by_type.wow
  • shares
Insights Fields
  • insights_engaged_users
  • insights_engagement_rate
  • insights_impressions
  • insights_impressions_organic
  • insights_impressions_paid
  • insights_post_clicks
  • insights_post_clicks_by_type_unique.link clicks
  • insights_post_clicks_by_type_unique.photo view
  • insights_post_clicks_by_type_unique.video play
  • insights_reach
  • insights_reach_organic
  • insights_reach_paid
  • insights_video_avg_time_watched
  • insights_video_complete_views_30s
  • insights_video_view_time
  • insights_video_views
  • insights_video_views_organic
  • insights_video_views_paid
  • insights_video_views_unique

Fields that might be used to filter Facebook posts:
Basic FieldsInsights Fields
  • insights_paid_status

Response

Name Description
success Status of the response. Possible values are true or false.
data object containing the following properties:
  • posts: array, containing post metric data
  • next: string, pagination cursor. Used for pagination over posts data.
  • remaining: integer, number of remaining items, counting from current page, until end of posts data.

Example request

POST /2/facebook/page/posts HTTPS
Host: api.socialbakers.com
Authorization: Basic base64_encoded_auth
Content-Type: application/json; charset=utf-8

{
  "profiles": ["164929129743", "543567853435"],
  "date_start": "2017-07-01",
  "date_end": "2017-10-25",
  "fields": [
    "id",
    "created_time",
    "message",
    "comments",
    "shares",
    "reactions",
    "interactions",
    "url",
    "author_id",
    "page_id",
    "attachments",
    "type",
    "reactions_by_type",
    "story",
    "insights_impressions",
    "insights_impressions_paid",
    "insights_paid_status",
    "insights_engaged_users",
    "insights_video_avg_time_watched",
    "insights_engagement_rate",
    "insights_post_clicks_by_type",
    "insights_post_clicks_by_type_unique",
    "universal_video_id",
    "video_id",
    "ppd_status",
    "video_length",
    "post_labels"
  ],
  "sort": [{
    "field": "created_time",
    "order": "desc"
  }],
  "filter": [{
    "field": "type",
    "value": ["video"]
  }, {
    "field": "insights_paid_status",
    "value": "paid",
  }, {
    "match_any": [{
      "field": "post_labels",
      "value": [
        "fa14dde7e4f041e3a646",
        "890c135d9cee4cf89b42"
      ]
    }]
  }],
  "limit": 5
}

Example response

{
  "success": true,
  "data": {
    "posts": [
      {
        "id": "164929129743_10154736430664744",
        "created_time": "2016-11-04T13:00:08+00:00",
        "message": "Brainstorming on your social media content? This tool will help ↓",
        "comments": 10,
        "shares": 20,
        "reactions": 70,
        "interactions": 100,
        "url": "https://www.facebook.com/socialbakers/posts/10154736430664744",
        "author_id": "164929129743",
        "page_id": "164929129743",
        "attachments": [
          {
              "title": "Looking to Get Inspired For Your Next Campaign or Post?",
              "description": "Coming up with ideas for new posts and campaigns is a challenge for every marketer...",
              "url": "https://goo.gl/28ZEjD",
              "image_url": "https://external.xx.fbcdn.net/safe_image.php?d=AQDCqVXSjdGWUTu5&url=https%3A%2F%2Fwww.facebook.com%2Fads%2Fimage%2F%3Fd%3DAQJAeqUrvHG_eEQJrlnw0oLjbP7j0uio9f72hrlJ-8VWCVEc2tV_wkWj3XOLkWrB3R0KYlA09NYIwj1KGgpqOkDtsYkAg49xZVltN_OQloQpjk0smGZC9CwkDTZn9XbotqP5G6MYA8bEjlnhgdc84Exm"
          }
        ],
        "type": "link",
        "reactions_by_type": {
          "like": 10,
          "love": 20,
          "wow": 30,
          "haha": 5,
          "sorry": 3,
          "anger": 2
        },
        "post_labels": [{
          "id": "fa14dde7e4f041e3a646",
          "name": "Post Label 1"
        }],
        "story": "Socialbakers published a note",
        "insights_impressions": 3583,
        "insights_impressions_paid": 496,
        "insights_paid_status": "paid",
        "insights_engaged_users": 50,
        "insights_video_avg_time_watched": 60000,
        "video_id": "1072177562941323",
        "ppd_status": "organic",
        "video_length": 125.481,
        "universal_video_id": "164929129743_10154736430664744",
        "insights_post_clicks_by_type": {
          "other clicks": 381,
          "link clicks": 48,
          "video play": 530
        },
        "insights_post_clicks_by_type_unique": {
          "other clicks": 302,
          "link clicks": 43,
          "video play": 506
        },
        "insights_engagement_rate": 0.017567734751948533
      }, ...
    ],
    "next": "eyJjdXJzb3IiOlt7ImZpZWxkIjoiY3JlYXRlZF90aW1lIiwidmFsdWUiOiIyMDE2LTEwLTI1VDEzOjAwOjA2LjAwMFoiLCJvcmRlciI6ImRlc2MifV0sImlkcyI6WyIxNjQ5MjkxMjk3NDNfMTAxNTQ3MDUwODA3Mzk3NDQiXX0=",
    "remaining": 3276
  }
}

Instagram Profile Posts Metrics

Returns a set of posts created during the specified date range for each requested Instagram profile. Instagram posts endpoint returns lifetime values of the metrics.

Parameters

Name Description
profiles array, list of profile IDs of the profiles available from the /2/instagram/profiles endpoint.
date_start, date_end string, the beginning / end of the period you want to get the data for in the format YYYY-MM-DD. Your request is transformed using the time zone assigned to a profile in the Suite settings of your account. The response of the endpoint displays the date/time in UTC time zone. You can shift the date/time to the correct timezone using the timezone of each individual profile from the /2/instagram/profiles endpoint. The last day will be also included in the response.
fields array, the list of fields that will be returned in the response. Available fields are listed in the table below.
limit integer, (optional). The number of results per page. The default value is 10 and the maximal value is 500.
after string, (optional). Pagination cursor. Points to the end of the page that has been returned.
sort You can sort the results by specifying a field and sorting order in the sort object: "field": "created_time" and "order": "desc". See the list of fields allowed for sorting.
filter You can filter results by providing the filter parameter with field and value. See the list of fields allowed for filtering.
Basic Fields
Name Type Example Description
attachments array
[{ "images": [{ "url": "https://external.xx.fbcdn.net/safe_image.php?d=AQCXbmZ491Pwd29M&url=https%3A%2F%2Fcdn.socialbakers.com%2Fwww%2Fstorage%2Fmicrosites%2Fkyn%2FOG-KYN.jpg" ]}, "videos": [], "indices": [] }]
Array of objects containing details about post attachments. Fields: url, type, width, height
author_id string
490402220
Author profile ID.
comments integer
100
Total number of comments on the media object.
created_time datetime
2016-10-24T16:15:04+00:00
Instagram media created time.
engagement_rate float
4.2
Engagement Rate for a particular post displays the average number of Interactions per Fan. Engagement Rate is therefore calculated by dividing the number of Interactions of a post by the number of Fans on that day.
id string
17966172199068623_490402220
Instagram media ID.
interactions integer
100
Total number of interactions on the media object.
likes integer
100
Total number of likes on the media object.
message string
A first instagram post
Instagram media contents.
post_labels array
[{"id": "as3442fs", "name": "label 1"}, {"id": "vz4451jg", "name": "label 2"}]
Array of post labels for given post and account
type string
carousel|image|video|carousel_album
Media post type.
url string
https://www.instagram.com/p/Bk4f5J_gypJ/
Link to instagram post.
Insights Fields

Metrics prefixed with insights_ can only be used for profiles that have insights_enabled property set to true in the response of the /2/instagram/profiles endpoint.

Name Type Example Description
insights_engagement integer
100
Total number of likes and comments on the media object.
insights_impressions integer
100
Total number of times the media object has been seen.
insights_reach integer
100
Total number of unique accounts that have seen the media object.
insights_saved integer
100
Total number of unique accounts that have saved the media object.
insights_video_views integer
100
(Videos only) Total number of times the video has been seen. Returns 0 for videos in carousel albums.

Fields that might be used to sort Instagram posts:
Basic Fields
  • comments
  • created_time
  • interactions
  • likes
Insights Fields
  • insights_engagement
  • insights_impressions
  • insights_reach
  • insights_saved
  • insights_video_views

Fields that might be used to filter Instagram posts:
Basic Fields

Response

Name Description
success Status of the response. Possible values are true or false.
data object containing the following properties:
  • posts: array, containing post metric data
  • next: string, pagination cursor. Used for pagination over posts data.
  • remaining: integer, number of remaining items, counting from current page, until end of posts data.

Example request

POST /2/instagram/profile/posts HTTPS
Host: api.socialbakers.com
Authorization: Basic base64_encoded_auth
Content-Type: application/json; charset=utf-8

{
  "profiles": ["490402220", "55674325"],
  "date_start": "2018-06-01",
  "date_end": "2018-08-31",
  "fields": [
    "interactions",
    "comments",
    "likes",
    "insights_engagement",
    "insights_saved",
    "insights_reach",
    "insights_video_views",
    "insights_impressions",
    "id",
    "author_id",
    "created_time",
    "type",
    "message",
    "attachments",
    "post_labels",
    "url"
  ],
  "sort": [{
    "field": "created_time",
    "order": "desc"
  }],
  "filter": [{
    "field": "type",
    "value": ["image"]
  }, {
    "match_any": [{
      "field": "post_labels",
      "value": [
        "fa14dde7e4f041e3a646",
        "890c135d9cee4cf89b42"
      ]
    }]
  }],
  "limit": 5
}

Example response

{
  "success": true,
  "data": {
    "posts": [
      {
        "id": "17966172199068623_490402220",
        "created_time": "2018-08-23T09:59:27+00:00",
        "message": "Stuck in a rut with your Instagram marketing? Don’t sweat it 🙅‍♀️. Freshen up your content with these tips for insta success 💥! See link in bio to unlock the full list 📝",
        "comments": 9,
        "likes": 86,
        "author_id": "490402220",
        "type": "video",
        "interactions": 95,
        "profile_id": "490402220",
        "attachments": [
          {
            "images": [],
            "videos": [
              {
                "url": "https://scontent.xx.fbcdn.net/v/t50.2886-16/39076708_281043816045474_2574583738604191744_n.mp4?_nc_cat=0&oh=2d1efdd181ee7d18d1be98d22afdb900&oe=5BF734E0"
              }
            ]
          }
        ],
        "post_labels": [{
          "id": "890c135d9cee4cf89b42",
          "name": "Post Label 1"
        }],
        "insights_engagement": 148,
        "insights_saved": 52,
        "insights_reach": 3094,
        "insights_video_views": 923,
        "insights_impressions": 4178,
        "url": "https://www.instagram.com/p/Bk4f5J_gypJ/"
      }
    ],
    "next": "eyJjdXJzb3IiOlt7ImZpZWxkIjoiY3JlYXRlZF90aW1lIiwidmFsdWUiOiIyMDE4LTA2LTI4VDEyOjM4OjM0KzAwOjAwIiwib3JkZXIiOiJkZXNjIn1dLCJpZHMiOlsiMTc4OTM5NTExNjIyMTY0NjRfNDkwNDAyMjIwIl19=",
    "remaining": 15
  }
}

Twitter Tweets Metrics

Returns tweets metrics for each requested Twitter profile.

According to the Twitter Developer Policies, the Socialbakers API no longer provides details regarding the individual Tweets. Tweet IDs, Author ID, Created Time, and Post Labels assigned in Socialbakers Suite can be still requested for manual analysis.

Parameters

Name Description
profiles array, list of profile IDs of the profiles available from the /2/twitter/profiles endpoint.
date_start, date_end string, the beginning / end of the period you want to get the data for in the format YYYY-MM-DD. Your request is transformed using the time zone assigned to a profile in the Suite settings of your account. The response of the endpoint displays the date/time in UTC time zone. You can shift the date/time to the correct timezone using the timezone of each individual profile from the /2/twitter/profiles endpoint. The last day will be also included in the response.
fields array, the list of fields that will be returned in the response. Available fields are listed in the table below.
limit integer, (optional). The number of results per page. The default value is 10 and the maximal value is 500.
after string, (optional). Pagination cursor. Points to the end of the page that has been returned.
sort You can sort the results by specifying a field and sorting order in the sort object: "field": "created_time" and "order": "desc". See the list of fields allowed for sorting.
filter You can filter results by providing the filter parameter with field and value. See the list of fields allowed for filtering.
Fields
Name Type Example Description
author_id string
100004577
Tweet author profile id.
created_time datetime
2016-10-24T16:15:04+00:00
Tweet created time.
engagement_rate float
4.2
Engagement Rate for a particular post displays the average number of Interactions per Fan. Engagement Rate is therefore calculated by dividing the number of Interactions of a post by the number of Fans on that day.
id string
833759796105007104
Tweet id.
post_labels array
[{"id": "as3442fs", "name": "label 1"}, {"id": "vz4451jg", "name": "label 2"}]
Array of tweet labels for given tweet and account

Fields that might be used to sort Twitter tweets:
Basic Fields
  • created_time

Fields that might be used to filter Twitter posts:
Basic Fields

Response

Name Description
success Status of the response. Possible values are true or false.
data object containing the following properties:
  • posts: array, containing post metric data
  • next: string, pagination cursor. Used for pagination over posts data.
  • remaining: integer, number of remaining items, counting from current page, until end of posts data.

Example request

POST /2/twitter/profile/tweets HTTPS
Host: api.socialbakers.com
Authorization: Basic base64_encoded_auth
Content-Type: application/json; charset=utf-8

{
  "profiles": ["1964904343", "8643567434"],
  "date_start": "2016-01-01",
  "date_end": "2017-01-01",
  "fields": [
    "id",
    "author_id",
    "created_time",
    "post_labels"
  ],
  "sort": [{
    "field": "created_time",
    "order": "desc"
  }],
  "filter": [{
    "match_any": [{
      "field": "post_labels",
      "value": [
        "fa14dde7e4f041e3a646",
        "890c135d9cee4cf89b42"
      ]
    }]
  }],
  "limit": 5
}

Example response

{
  "success": true,
  "data": {
    "posts": [
      {
        "id": "689427258210004992",
        "created_time": "2016-01-19T12:40:41+00:00",
        "post_labels": [{
          "id": "fa14dde7e4f041e3a646",
          "name": "Post Label 1"
        }],
        "author_id": "1964904343",
      }
    ],
    "remaining": 0
  }
}
                

YouTube Profile Video Metrics

Returns a set of videos created during the specified date range for each requested YouTube channels. YouTube videos endpoint returns lifetime values of the metrics.

Parameters

Name Description
profiles array, list of profile IDs of the profiles available from the /2/youtube/profiles endpoint.
date_start, date_end string, the beginning / end of the period you want to get the data for in the format YYYY-MM-DD. Your request is transformed using the time zone assigned to a profile in the Suite settings of your account. The response of the endpoint displays the date/time in UTC time zone. You can shift the date/time to the correct timezone using the timezone of each individual profile from the /2/youtube/profiles endpoint. The last day will be also included in the response.
fields array, the list of fields that will be returned in the response. Available fields are listed in the table below.
limit integer, (optional). The number of results per page. The default value is 10 and the maximal value is 500.
after string, (optional). Pagination cursor. Points to the end of the page that has been returned.
sort You can sort the results by specifying a field and sorting order in the sort object: "field": "created_time" and "order": "desc". See the list of fields allowed for sorting.
filter You can filter results by providing the filter parameter with field and value. See the list of fields allowed for filtering.
Fields
Name Type Example Description
author_id string
UCA6AG33Zac0xi6f9VMTxkFQ
The ID that YouTube uses to uniquely identify the channel that the video was uploaded to.
comments integer
100
The number of comments for the video.
created_time datetime
2018-09-03T16:15:04+00:00
The date and time when the uploaded video file was created.
dislikes integer
100
The number of users who have indicated that they disliked the video.
duration integer
100
The length of the video [s].
engagement_rate float
4.2
Engagement Rate for a particular post displays the average number of Interactions per Fan. Engagement Rate is therefore calculated by dividing the number of Interactions of a post by the number of Fans on that day.
id string
UCA6AG33Zac0xi6f9VMTxkFQ
The ID that YouTube uses to uniquely identify the video.
interactions integer
100
The sum of Likes, Dislikes and Comments.
likes integer
100
The number of users who have indicated that they liked the video.
message string
Get caught up on the most important social media news of the week!
Beginner-friendly guide to Influencer Marketing: http://goo.gl/aTWHRV
The video's description.
post_labels array
[{"id": "as3442fs", "name": "label 1"}, {"id": "vz4451jg", "name": "label 2"}]
Array of post labels for given profile and account
published_time datetime
2018-08-03T12:30:05+00:00
The date and time when the video was published.
video_view_time integer
100
The number of time the video has been viewed multiplied by duration [s].
video_views integer
100
The number of times the video has been viewed.

Fields that might be used to sort YouTube profile video:
Basic Fields
  • comments
  • created_time
  • dislikes
  • duration
  • interactions
  • likes
  • published_time
  • video_view_time
  • video_views

Fields that might be used to filter YouTube profile video:
Basic Fields

Response

Name Description
success Status of the response. Possible values are true or false.
data object containing the following properties:
  • posts: array, containing post metric data
  • next: string, pagination cursor. Used for pagination over posts data.
  • remaining: integer, number of remaining items, counting from current page, until end of posts data.

Example request

POST /2/youtube/profile/videos HTTPS
Host: api.socialbakers.com
Authorization: Basic base64_encoded_auth
Content-Type: application/json; charset=utf-8

{
  "profiles": ["UCA6AG33Zac0xi6f9VMTxkFQ", "455DFG232sdg677"],
  "date_start": "2018-06-01",
  "date_end": "2018-08-31",
  "fields": [
    "id",
    "created_time",
    "message",
    "author_id",
    "comments",
    "duration",
    "video_view_time",
    "published_time",
    "dislikes",
    "video_views",
    "likes",
    "interactions",
    "post_labels"
  ],
  "sort": [{
    "field": "created_time",
    "order": "desc"
  }],
  "filter": [{
    "match_any": [{
      "field": "post_labels",
      "value": [
        "fa14dde7e4f041e3a646",
        "890c135d9cee4cf89b42"
      ]
    }]
  }]
  "limit": 5
}

Example response

{
  "success": true,
  "data": {
    "posts": [
      {
        "id": "6Ol7dJtKcq0",
        "created_time": "2018-06-15T14:41:32.000Z",
        "message": "Get caught up on the most important social media news of the week!\nBeginner-friendly guide to Influencer Marketing: http://goo.gl/aTWHRV",
        "author_id": "UCA6AG33Zac0xi6f9VMTxkFQ",
        "comments": 0,
        "likes": 6,
        "duration": 114,
        "video_view_time": 41040,
        "published_time": "2018-06-15T14:41:32.000Z",
        "dislikes": 0,
        "video_views": 360,
        "interactions": 6,
        "post_labels": [{
          "id": "fa14dde7e4f041e3a646",
          "name": "Post Label 1"
        }]
      },
    ],
    "next": "eyJjdXJzb3IiOlt7ImZpZWxkIjoiY3JlYXRlZF90aW1lIiwidmFsdWUiOiIyMDE4LTA2LTI4VDEyOjM4OjM0KzAwOjAwIiwib3JkZXIiOiJkZXNjIn1dLCJpZHMiOlsiMTc4OTM5NTExNjIyMTY0NjRfNDkwNDAyMjIwIl19=",
    "remaining": 15
  }
}

Aggregated Post Metrics

Aggregated Post metrics display lifetime data from individual posts published during the selected time period of your analysis. All post data is aggregated and displayed for the day the post was published, regardless of when the engagement happened.

Parameters

Name Description
date_start, date_end string, the beginning / end of the period you want to get the data for in the format YYYY-MM-DD. The response uses a timezone assigned to a profile in Suite settings of the account. The last day will be also included in the response.
profiles array of objects, consists of profile IDs and platforms. You can get the profiles from the List of Connected Profiles section.
metric string, the list of available metrics is displayed below.
dimensions array of objects. The data of the metric can be split by a specific dimension. The most common dimension is time. See the list of available dimensions in the table of metrics below.
filter array of objects. You can filter the results using simple or advanced post filters. See the list of fields allowed for filtering.

Metrics

Metrics prefixed with insights_ can only be used for profiles from platforms that have insights enabled. Not all metrics are available for all platforms.

Aggregation is the type of calculation used for grouping values of a specific metric.

Name Dimensions Aggregation Metrics Description
engagement_rate
FBIGTWYTLIVK
date.day
date.month
date.quarter
date.week
date.year
platform
profile
post_labels
profile_label
content_type
media_type
published_status
avg Engagement Rate for a particular post displays the average number of Interactions per Fan. Engagement Rate is therefore calculated by dividing the number of Interactions of a post by the number of Fans on that day. No data available for FB pages that is part of the Global Page Structure and does not have insights connected.
insights_completion_rate
IGStories
date.day
date.month
date.quarter
date.week
date.year
platform
profile
post_labels
profile_label
media_type
avg The percentage of times a story impression was not interrupted by an exit, tap back, or tap forward.
insights_engagements
FBIGTW
date.day
date.month
date.quarter
date.week
date.year
platform
profile
post_labels
profile_label
media_type
content_type
sum Total number of posts engagement which includes likes, shares and comments.
insights_impressions
FBIGTW
date.day
date.month
date.quarter
date.week
date.year
platform
profile
post_labels
profile_label
content_type
media_type
published_status
sum Number of impressions for your posts.
insights_media_views
TW
date.day
date.month
date.quarter
date.week
date.year
platform
profile
post_labels
profile_label
media_type
content_type
sentiment_type
sum All views(autoplay and clicks) of the media which includes videos, gifs and images.
insights_post_clicks
FB
date.day
date.month
date.quarter
date.week
date.year
platform
profile
post_labels
profile_label
content_type
media_type
published_status
sum The number of times people clicked on anywhere in your posts without generating an activity.
insights_reach_engagement
FB
date.day
date.month
date.quarter
date.week
date.year
platform
profile
post_labels
profile_label
content_type
media_type
published_status
avg Number of people who engaged with your Post per Number of people who have seen any content associated with your Post. Engagement includes any click or activity created.
insights_reach_per_content
FBIG
date.day
date.month
date.quarter
date.week
date.year
platform
profile
post_labels
profile_label
content_type
media_type
published_status
avg Number of people who have seen any content associated with your Page. (Unique Users)
insights_story_exits
IGStories
date.day
date.month
date.quarter
date.week
date.year
platform
profile
post_labels
profile_label
media_type
sum The number of times users exited your story.
insights_story_taps_back
IGStories
date.day
date.month
date.quarter
date.week
date.year
platform
profile
post_labels
profile_label
media_type
sum The number of times users clicked back to return to the previous story.
insights_story_taps_forward
IGStories
date.day
date.month
date.quarter
date.week
date.year
platform
profile
post_labels
profile_label
media_type
sum The number of times users clicked forward to skip to the next story.
insights_video_views
FBIGTWYT
date.day
date.month
date.quarter
date.week
date.year
platform
profile
post_labels
profile_label
content_type
published_status
sum Number of times page's videos have been viewed for more than 3 seconds.
interactions
FBIGTWYTLIPIVK
date.day
date.month
date.quarter
date.week
date.year
platform
profile
post_labels
profile_label
content_type
media_type
published_status
interaction_type
sum Number of interactions on page posts.
interactions_per_1k_fans
FBIGTWYTLIVK
date.day
date.month
date.quarter
date.week
date.year
platform
profile
post_labels
profile_label
content_type
media_type
published_status
sum Number of interactions on page posts per 1k fans. No data available for FB pages that is part of the Global Page Structure and does not have insights connected.
likes
FBIGTWYT
date.day
date.month
date.quarter
date.week
date.year
platform
profile
post_labels
profile_label
media_type
sum Number of likes of profile posts.
number_of_comments
FBIGTWYTLIPIVK
date.day
date.month
date.quarter
date.week
date.year
platform
profile
post_labels
profile_label
content_type
media_type
published_status
sum Number of comments on page posts.
page_posts
FBIGTWYTLIPIVK
date.day
date.month
date.quarter
date.week
date.year
platform
profile
post_labels
profile_label
content_type
media_type
published_status
sum Number of page posts.
page_replies
TW
date.day
date.month
date.quarter
date.week
date.year
platform
profile
post_labels
profile_label
sum Number of replies by the Twitter profile.
page_shares
FBTWPI
date.day
date.month
date.quarter
date.week
date.year
platform
profile
post_labels
profile_label
sum Number of retweets or shares by the page/profile
profile_tweets
TW
date.day
date.month
date.quarter
date.week
date.year
platform
profile
post_labels
profile_label
media_type
sum Total number of tweets, excluding replies and retweets.
sentiment_manual_auto
FBIGTW
date.day
date.month
date.quarter
date.week
date.year
platform
profile
post_labels
profile_label
media_type
sentiment
sum The breakdown of sentiment – Positive, Negative, or Neutral – for all comments. This metric needs to be used with the sentiment dimension.
shares
FBTWPIVK
date.day
date.month
date.quarter
date.week
date.year
platform
profile
post_labels
profile_label
content_type
media_type
published_status
sum Number of interactions on page posts, filtered by content type shared.
user_posts
FBTW
date.day
date.month
date.quarter
date.week
date.year
platform
profile
post_labels
profile_label
content_type
media_type
sum Number of page posts, filtered by origin incoming.
user_posts_average_response_time
FBTW
date.day
date.month
date.quarter
date.week
date.year
platform
profile
post_labels
profile_label
content_type
media_type
avg Average response time of page posts, filtered by origin incoming
user_posts_responded
FBTW
date.day
date.month
date.quarter
date.week
date.year
platform
profile
post_labels
profile_label
content_type
media_type
response_time
sum Number of non-admin page posts that have been responed, filtered by origin incoming.
user_posts_response_rate
FBTW
date.day
date.month
date.quarter
date.week
date.year
platform
profile
post_labels
profile_label
content_type
media_type
avg Ratio of responded user posts to number of user posts
user_questions
FBTWVK
date.day
date.month
date.quarter
date.week
date.year
platform
profile
post_labels
profile_label
content_type
media_type
sum Number of page posts which are questions.
user_questions_average_response_time
FBTW
date.day
date.month
date.quarter
date.week
date.year
platform
profile
post_labels
profile_label
content_type
media_type
avg Average response time of page posts which are questions, filtered by origin incoming
user_questions_responded
FBTW
date.day
date.month
date.quarter
date.week
date.year
platform
profile
post_labels
profile_label
content_type
media_type
response_time
sum Number of non-admin page posts which are questions that have been responded.
user_questions_response_rate
FBTW
date.day
date.month
date.quarter
date.week
date.year
platform
profile
post_labels
profile_label
content_type
media_type
avg Ratio of responded user questions to user questions.
Fields that might be used to filter posts:
Basic Fields

Example request


POST /2/aggregated-metrics HTTPS
Host: api.socialbakers.com
Authorization: Basic base64_encoded_auth
Content-Type: application/json; charset=utf-8

{
  "profiles": [
    {
      "id": "564919357",
      "platform": "twitter",
    },
    {
      "id": "164929129743",
      "platform": "facebook"
    }
  ],
  "date_start": "2018-11-01",
  "date_end": "2018-11-12",
  "metric": "page_posts",
  "dimensions": [
    {
      "type": "profile"
    }
  ],
  "filter": [
    {
      "field": "post_labels",
      "value": [
        "e3af7de2d2274393b86b"
      ]
    }
  ]
}
    

Example response


{
  "success": true,
  "header": [
    {
      "type": "profile",
      "rows": [
        {
          "id": "564919357",
          "platform": "twitter",
        },
        {
          "id": "164929129743",
          "platform": "facebook"
        }
      ]
    },
    {
      "type": "metric",
      "rows": [
        "page_posts"
      ]
    }
  ],
  "data": [
    [
      3
    ],
    [
      6
    ]
  ]
}

Advanced Post Filters

Introduction

Some fields support advanced possibilities of filtering. It is possible to create filter rules as a combination of match_all and match_any clauses. A combination with simple filter definition is also possible. The filter consists of two types of clauses:

Simple filter clauses

Specifies particular field(s) and its values. Posts having these values will be part of the results.

    
    {
      "field": "type",
      "value": [
        "photo",
        "status"
      ]
    }
    
    
Advanced filter clauses

The advanced filter is used to combine multiple filters in a logical meaning as AND, and OR.

  • match_all - Represents logical AND. Items have to match in all criteria for each clause
  • match_any - Represents logical OR. The result of this filter has to match at least in one criterion of the clause.
    
    {
      "match_all": [
        {
          "field": "post_labels",
          "value": [
            "fa14dde7e4f041e3a646",
            "890c135d9cee4cf89b42"
          ]
        }
      ]
    }
    
    

Tableau Web Data Connector (WDC)

Introduction

Tableau is a business intelligence (BI) tool that can be used to create reports, charts, graphs and dashboards using different data sources.
Official documentation for Tableau Web Data Connector is available here: http://onlinehelp.tableau.com/current/pro/desktop/en-us/help.htm#examples_web_data_connector.html .

Socialbakers API is available as a data source for Tableau using a Web Data Connector.
The Socialbakers Web Data Connector is available at this address: https://api.socialbakers.com/tableau-wdc.

The same API authentication (token and secret) is used for the Tableau Web Data Connector, as described in Security and Authentication section.

Available metrics

Network Metrics
Facebook Metrics all metrics except metrics prefixed with "insights_"
Instagram Metrics all metrics except metrics prefixed with "insights_"
Twitter Metrics all metrics
YouTube Metrics all metrics
Pinterest Metrics all metrics

Google Data Studio Connector

Introduction

Google Data Studio is an analytics dashboard report service which turns your analytics data into informative reports which are easy to read, share and customizable.

Official Google Data Studio Connector description: https://support.google.com/datastudio/answer/6268208.

The connector allows you to access Socialbakers API and use it as a source of data for your reports.

To access the connector, please visit this address: Socialbakers GDS Connector

For authorization, you’ll need to input a User name and Token. These are linked to a specific user of a Socialbakers Suite account. Get in touch with our Support team at support@socialbakers.com to get yours.

(Please note that name convention slightly differs on Socialbakers’ side where ‘Token’ and ‘Secret’ is being used.
EXAMPLE of what you’ll use for input:
User Name: (called token on Socialbakers side)
NjE5MTA4XzE3OTAyMTVfMTU0NTMxNDUyOTA4OV82MTRlODkxODAzNDI0ZmU5MTQwY2VkZTY4NzI2NmI1OA== (example only, not functional)
Token: (called secret on Socialbakers side)
f0e2b4ca2fd76b8515265fd6b8bced5d (example only, not functional)

More info about authorization: Security and authentication

Available metrics

Network Metrics
Facebook Metrics all metrics
Instagram Metrics all metrics
Twitter Metrics all metrics
YouTube Metrics all metrics
Pinterest Metrics all metrics

Community

Currently only content labeling endpoints are available for Community.

Content Labeling

Add or remove labels to content in Community.

Requires labeling user permissions:

  • Edit Global Labels
  • Global Post Labeling

Currently supports the following networks: facebook, and twitter.

Caveats:

  • If the provided label does not exist, a global label will be created in the account.
  • Labeled content must exist in Community at the time of the API call.
  • The updates are immediately propagated into feeds.

Methods

PUT
Add labels to content
DELETE
Remove labels from content

Parameters

Name Description
content_ids array of network specific content IDs (status ID for Twitter, see below for Facebook content IDs). (required)
labels array of label names (strings) to add to content. (required)
Facebook Content IDs
Direct Messages
To label direct message conversation, prefix the conversation ID (e.g. t_100022491363476) with page ID and dash.
Example: Given page ID 558021681218098 and conversation ID t_100022491363476, the resulting content ID will be: 558021681218098-t_1200750755
Posts
To label specific page's post, prefix the post ID with page ID.
Example: Given page ID 164929129743 and post ID 10156439716079744, the resulting content ID is: 164929129743_10156439716079744
Post Comments
To label specific comment to a post, prefix the comment ID with post ID.
Example: Given post ID 10156439716079744 and comment ID 10156440099689744, the resulting content ID will be: 10156439716079744_10156440099689744.

Note: You can verify post and comment IDs by inserting them as path to Facebook URL. For example facebook.com/10156439716079744_10156440099689744 redirects to the comment. These composite IDs are compatible with Graph API too.

Response

Name Description
success Status of the response. Possible values are true or false.
data object containing the contents object of responses per individual contents.

Example request


PUT /2/community/{network}/labels HTTPS
Host: api.socialbakers.com
Authorization: Basic base64_encoded_auth
Content-Type: application/json; charset=utf-8

{
    "content_ids": [
      // Facebook conversation ID
      "754387418054186-t_100022491363476",
      // Facebook page post ID
      "849715935050458_1520511894637588",
    ],
    "labels": ["my label"],
}

Example response

{
    "success": true,
    "data": {
      "contents": {
        "754387418054186-t_100022491363476": {
            "status": "ok"
        },
        "849715935050458_1520511894637588": {
            "status": "ok"
        }
      }
    }
}

Changelog

v2.0

  • Added get connected profiles support for LinkedIn and Vkontakte.
  • Introduced new Profile level metrics with dimension support.
  • Added Profile level metrics for LinkedIn.
  • Facebook Post Metrics endpoint within the Aggregated Post Metric is removed.

v1.2

  • Introduced new Aggregated Post Metrics endpoint under the Aggregated Post Metrics section. This adds support to aggregate data across multiple social networks.
  • Introduced post level aggregated data for IG Story specific metrics.

v1.1

  • IG carousel typed posts now returns all image links (bugfix).

v1.0

2020/03/04

  • Fix community add and delete labels

2020/01/13

  • Add profile-level engagement_rate.

2020/01/08

  • Add post-level engagement_rate. Multiplication by 10 is needed for all values except for the FB one, as we already receive it multiplied by 10

2019/07/11

2019/06/22

2018/12/17

  • new endpoint /1/metrics to get aggregated data of a set of posts defined by profiles and filtering parameters
  • /1/facebook/page/posts now returns also unpublished posts.
  • new sort fields to sort Facebook posts by insights_impressions, insights_impressions_paid, insights_impressions_organic
  • new field url added to Instagram posts

2018/11/04

v0.9

2019/06/22

2018/12/17

  • new sort fields to sort Facebook posts by insights_impressions, insights_impressions_paid, insights_impressions_organic
  • new field url added to Instagram posts

2018/11/04

  • the timezone is (internally) applied to correspond with Suite data when using post level endpoints

2018/10/17

2018/09/10

2018/08/10

2018/02/22

2017/10/16

2017/08/16

2017/07/13

2017/05/04

  • new metrics insights_impressions_viral, insights_impressions_viral_frequency_distribution and insights_impressions_viral_unique added for Facebook metrics

2017/03/28

2016/11/23

2016/10/27

  • new metrics viewed_time_change and viewed_time_lifetime added for YouTube metrics