Instagram Data Model
- Instagram Tables
- Instagram Views
- AccountContactButtonType
- AccountFollowersNonfollowers
- AccountInsights
- AccountMediaProductType
- AccountTimeSeriesFollowType
- AccountTimeSeriesMediaProductType
- AccountTimeSeriesWithoutBreakdown
- AccountWithoutBreakdown
- AudienceInsights
- IGMedia
- InstagramBusinessProfile
- InstagramPages
- Media
- MediaInsightReels
- MediaInsights
- MediaInsightsPost
- MediaInsightsStory
- OnlineFollowers
- Pages
- Permissions
- Stories
- Tags
In this article
- Instagram Tables
- Instagram Views
- AccountContactButtonType
- AccountFollowersNonfollowers
- AccountInsights
- AccountMediaProductType
- AccountTimeSeriesFollowType
- AccountTimeSeriesMediaProductType
- AccountTimeSeriesWithoutBreakdown
- AccountWithoutBreakdown
- AudienceInsights
- IGMedia
- InstagramBusinessProfile
- InstagramPages
- Media
- MediaInsightReels
- MediaInsights
- MediaInsightsPost
- MediaInsightsStory
- OnlineFollowers
- Pages
- Permissions
- Stories
- Tags
Instagram is a social media platform where users share photos and videos, connect with others, and discover new content.
Instagram Tables
The Instagram connector models the data in Instagram as a list of tables in a relational database that can be queried using standard SQL statements.
Comments
Create, delete, and query Comments on a media object. Requires the instagram_basic and instagram_manage_comments scopes.
Only the select, delete, and insert operations are supported.
Select
The connector will use the Instagram APIs to filter results by MediaId and will execute other filters client-side within itself.
The following query returns all comments on all media in your account. UserId will be null if the comment is from an account that is not a business account.
SELECT * FROM Comments
To query comments for a specific media object, MediaId is required. The MediaId column supports the = operator. For example:
SELECT * FROM Comments WHERE MediaId = '1501471279105199430_5380790872'
Insert
Create a comment on a media object with the following rules:
MediaId and Text are the only available and required fields.
The total length of the comment cannot exceed 300 characters.
The comment cannot contain more than 4 hashtags.
The comment cannot contain more than 1 URL.
The comment cannot consist of all capital letters.
Example:
INSERT INTO Comments (MediaId, Text) VALUES ('1501471279105199430_5380790872', 'My comment text #instadevelopers')
Columns
Name | Type | ReadOnly | Description |
---|---|---|---|
Id [KEY] | String | True | The unique identifier for the comment. |
Text | String | False | The text of the comment. |
MediaId | String | False | The unique identifier for the media. |
Created | Datetime | True | The time when the media was created. |
UserId | String | True | The unique identifier for the user. |
Username | String | True | The username for the user. |
Likes | String | True | The number of likes. |
Hidden | Boolean | True | The boolean that shows if the comment is hidden. |
InstagramBusinessAccountId | String | True | The unique identifier for the Instagram business account Id. |
Replies
Query and insert replies on a media object. Requires the instagram_basic and instagram_manage_comments scopes.
Only the select and insert operations are supported.
Select
The connector will process a filter on CommentId server side and will execute other filters client-side within itself.
The following query returns replies from all comments in your account. UserId will be null if the reply is from an account that is not a business account.
SELECT * FROM Replies
To query replies for a specific comment, CommentId is required. The supported operator for the CommentId column is =.
Example:
SELECT * FROM Replies WHERE CommentId = '1501471279105199430_5380790872'
Insert
Create a reply on a comment object with the following rules:
CommentId and Text are the only available and required fields.
The total length of the comment cannot exceed 300 characters.
The reply cannot contain more than 4 hashtags.
The reply cannot contain more than 1 URL.
The reply cannot consist of all capital letters.
Example:
INSERT INTO Replies (CommentId, Text) VALUES ('1501471279105199430_5380790872', 'My reply #instadevelopers')
Columns
Name | Type | ReadOnly | Description |
---|---|---|---|
Id [KEY] | String | True | The unique identifier for the reply. |
Username | String | True | The username for the user. |
CommentId | String | False | The unique identifier for the comment. |
Created | Datetime | True | The time when the reply was created. |
UserId | String | True | The unique identifier for the user. |
MediaId | String | True | The unique identifier for the associated media. |
Text | String | False | The comment. |
LikeCount | Int | True | The number of likes. |
InstagramBusinessAccountId | String | True | The unique identifier for the Instagram business account Id. |
Instagram Views
Views are similar to tables in the way that data is represented; however, views are read-only.
Queries can be executed against a view as if it were a normal table.
AccountContactButtonType
It returns the number of taps on the DIRECTION, CALLs and EMAILs button during the selected time period.
For this view, the Metric Type is total_value and Breakdown(dimension) is contact_button_type. Requires the instagram_basic and instagram_manage_insights scopes.
Select
The connector will use the Instagram APIs to process filters that refer to a date range or InstagramBusinessAccountId and will process other filters client-side within itself.
Metric supports the ‘=’ operator.
The default query returns results for the ‘profile_links_taps’ metric.
SELECT * FROM AccountContactButtonType
SELECT * FROM AccountContactButtonType WHERE FromDateTime='2023-07-02T00:00:00Z' AND ToDateTime='2023-07-24T00:00:00Z'
Columns
Name | Type | Description |
---|---|---|
InstagramBusinessAccountId | String | The unique identifier for the Instagram business account Id. |
Metric | String | Metric Type. Default value is profile_links_taps. The allowed values are profile_links_taps. |
DIRECTION | Int | Number of taps on DIRECTION button. |
CALL | Int | Number of taps on Calls button. |
Int | Number of taps on Emails button. |
Pseudo-Columns
Pseudo column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source.
Name | Type | Description |
---|---|---|
FromDateTime | Datetime | The earliest time for insight data to have been collected. |
ToDateTime | Datetime | The latest time for insight data to have been collected. |
AccountFollowersNonfollowers
The number of accounts that followed and the number of accounts that unfollowed or stopped using Instagram during the selected time period.
For this view, the Metric Type is total_value and Breakdown(dimension) is follow_type. Requires the instagram_basic and instagram_manage_insights scopes.
Select
The connector will use the Instagram APIs to process filters that refer to a date range or InstagramBusinessAccountId and will process other filters client-side within itself.
Metric supports the ‘=,IN’ operator.
The default query returns results for the ‘follows_and_unfollows’ metric.
SELECT * FROM AccountFollowersNonfollowers
SELECT * FROM AccountFollowersNonfollowers WHERE FromDateTime='2023-06-20T00:00:00Z' AND ToDateTime='2023-07-12T00:00:00Z'
To retrieve the result for other metrics, then explicitly specify the Metric in where clause. For example:
SELECT * FROM AccountFollowersNonfollowers WHERE Metric = 'reach'
SELECT * FROM AccountFollowersNonfollowers WHERE Metric IN ('follows\_and\_unfollows', 'reach')
Columns
Name | Type | Description |
---|---|---|
InstagramBusinessAccountId | String | The unique identifier for the Instagram business account Id. |
Metric | String | Metric Type. Default value is follows_and_unfollows. The allowed values are follows_and_unfollows, reach. |
Follower | Int | The number of accounts that followed the Instagram business account |
Nonfollower | Int | The number of accounts that unfollowed the Instagram business account |
Pseudo-Columns
Pseudo column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source.
Name | Type | Description |
---|---|---|
FromDateTime | Datetime | The earliest time for insight data to have been collected. |
ToDateTime | Datetime | The latest time for insight data to have been collected. |
AccountInsights
Allows you to get insights for an Instagram business account. Requires the instagram_basic and instagram_manage_insights scopes.
Select
You can query the following metrics given a date range. The default date range is the last 7 days.
Impressions (accepts time periods of day, week, and days_28)
Reach (accepts time periods of day, week, and days_28)
FollowerCount (only accepts the day period)
EmailContacts (only accepts the day period)
PhoneCallClicks (only accepts the day period)
TextMessageClicks (only accepts the day period)
GetDirectionsClicks (only accepts the day period)
WebsiteClicks (only accepts the day period)
ProfileViews (only accepts the day period)
Specify a date range with the FromDateTime and ToDateTime columns. Specify the intervals of the date range by setting the Period column in the WHERE clause.
Note that you cannot use a period on a metric that does not support it.
For example, you cannot use Impressions AND FollowerCount with period days_28 because FollowerCount only supports the day period.
The connector will use the Instagram APIs to process filters that refer to a date range or Id.
The following examples show how to retrieve metrics over a given date range:
The default query returns results for the following metrics during the last seven days: Impressions, Reach, FollowerCount, EmailContacts, PhoneCallClicks, TextMessageClicks, GetDirectionsClicks, WebsiteClicks, and ProfileViews.
SELECT * FROM AccountInsights
Filter on FromDateTime and ToDateTime to explicitly specify a different date range. The max date range cannot be more than 30 days (2592000 s).
SELECT * FROM AccountInsights WHERE FromDateTime = '2018/01/01' AND ToDateTime = '2018/01/30' AND period = 'day'
Return results over a period of 7 days.
SELECT * FROM AccountInsights WHERE FromDateTime = '2018/01/01' AND period = 'day'
Return results from 2018/01/01 to 2018/01/08.
SELECT * FROM AccountInsights WHERE ToDateTime = '2018/01/08' AND period = 'day'
Return a custom projection on account insights for the date range from 2018/01/01 to 2018/01/08.
SELECT Impressions, FollowerCount, EmailContacts FROM AccountInsights WHERE FromDateTime = '2018/01/01' AND ToDateTime = '2018/01/30' AND period = 'day'
Columns
Name | Type | Description |
---|---|---|
InstagramBusinessAccountId | String | The unique identifier of the Instagram business account Id. |
EndTime | Date | The most recent date this insight data is relevant for. |
Impressions | Integer | Total number of times this profile has been seen. |
Reach | Integer | Total number of unique accounts that have seen this profile. |
ProfileViews | Integer | Total number of unique accounts that have viewed this profile within the specified period. |
FollowerCount | Integer | Total number of unique accounts following this profile. |
EmailContacts | Integer | Total number of taps on the email link in this profile. |
PhoneCallClicks | Integer | Total number of taps on the call link in this profile. |
TextMessageClicks | Integer | Total number of taps on the text message link in this profile. |
GetDirectionsClicks | Integer | Total number of taps on the directions link in this profile. |
Websiteclicks | Integer | Total number of taps on the website link in this profile. |
Period | String | The period for the insight. This controls how rows will be broken up (by day, week, 28 days, or lifetime). This must always be specified. |
Pseudo-Columns
Pseudo column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source.
Name | Type | Description |
---|---|---|
FromDateTime | Datetime | The earliest time for insight data to have been collected. |
ToDateTime | Datetime | The latest time for insight data to have been collected. |
AccountMediaProductType
It returns the number of POSTs and IGTVs during the selected time period.
For this view, the Metric Type is total_value and Breakdown(dimension) is media_product_type. Requires the instagram_basic and instagram_manage_insights scopes.
Select
The connector will use the Instagram APIs to process filters that refer to a date range or InstagramBusinessAccountId and will process other filters client-side within itself.
Metric supports the ‘=,IN’ operator.
The default query returns results for the ‘reach’ metric.
SELECT * FROM AccountMediaProductType
SELECT * FROM AccountMediaProductType WHERE FromDateTime='2023-06-20T00:00:00Z' AND ToDateTime='2023-07-12T00:00:00Z'
To retrieve the result for other available metric, then explicitly specify the Metric in where clause.
Example:
SELECT * FROM AccountMediaProductType WHERE Metric = 'total_interactions'
SELECT * FROM AccountMediaProductType WHERE Metric = 'likes'
SELECT * FROM AccountMediaProductType WHERE Metric = 'comments'
SELECT * FROM AccountMediaProductType WHERE Metric = 'saves'
SELECT * FROM AccountMediaProductType WHERE Metric = 'shares'
SELECT * FROM AccountMediaProductType WHERE Metric IN ('total_interactions', 'likes', 'comments', 'saves', 'shares')
Columns
Name | Type | Description |
---|---|---|
InstagramBusinessAccountId | String | The unique identifier for the Instagram business account Id. |
Metric | String | Metric Type. Default value is reach. The allowed values are reach, total_interactions, likes, comments, saves, shares. |
POST | Int | Number of POSTs. |
IGTV | Int | Number of IGTVs. |
Pseudo-Columns
Pseudo column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source.
Name | Type | Description |
---|---|---|
FromDateTime | Datetime | The earliest time for insight data to have been collected. |
ToDateTime | Datetime | The latest time for insight data to have been collected. |
AccountTimeSeriesFollowType
It returns the metric endtime and the value. For this view, the Metric type is time_series and breakdown is follow_type. Requires the instagram_basic and instagram_manage_insights scopes.
Select
The connector will use the Instagram APIs to process filters that refer to a date range or InstagramBusinessAccountId and will process other filters client-side within itself.
Metric supports the ‘=’ operator.
The default query returns results for the ‘reach’ metric.
SELECT * FROM AccountTimeSeriesFollowType
SELECT * FROM AccountTimeSeriesFollowType WHERE FromDateTime='2023-06-20T00:00:00Z' AND ToDateTime='2023-07-12T00:00:00Z'
Columns
Name | Type | Description |
---|---|---|
InstagramBusinessAccountId | String | The unique identifier for the Instagram business account Id. |
Metric | String | Metric Type. The supported Metric types are reach, impressions, website_clicks, profile_views. The default metric type is reach. |
EndTime | Datetime | End time. |
Value | Integer | Total values of the metrics. |
Pseudo-Columns
Pseudo column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source.
Name | Type | Description |
---|---|---|
FromDateTime | Datetime | The earliest time for insight data to have been collected. |
ToDateTime | Datetime | The latest time for insight data to have been collected. |
AccountTimeSeriesMediaProductType
It returns the metric endtime and the value. For this view, the Metric type is time_series and breakdown is media_product_type. Requires the instagram_basic and instagram_manage_insights scopes.
Select
The connector will use the Instagram APIs to process filters that refer to a date range or InstagramBusinessAccountId and will process other filters client-side within itself.
Metric supports the ‘=’ operator.
The default query returns results for the ‘reach’ metric.
SELECT * FROM AccountTimeSeriesMediaProductType
SELECT * FROM AccountTimeSeriesMediaProductType WHERE FromDateTime='2023-06-20T00:00:00Z' AND ToDateTime='2023-07-12T00:00:00Z'
Columns
Name | Type | Description |
---|---|---|
InstagramBusinessAccountId | String | The unique identifier for the Instagram business account Id. |
Metric | String | Metric Type. The supported Metric types are reach, impressions website_clicks, profile_views. The default metric type is reach. |
EndTime | Datetime | End time. |
Value | Integer | Total values of the metrics. |
Pseudo-Columns
Pseudo column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source.
Name | Type | Description |
---|---|---|
FromDateTime | Datetime | The earliest time for insight data to have been collected. |
ToDateTime | Datetime | The latest time for insight data to have been collected. |
AccountTimeSeriesWithoutBreakdown
It returns the metric endtime and the value. For this view, the Metric type is time_series. Requires the instagram_basic and instagram_manage_insights scopes.
Select
The connector will use the Instagram APIs to process filters that refer to a date range or InstagramBusinessAccountId and will process other filters client-side within itself.
Metric supports the ‘=’ operator.
The default query returns results for the ‘impressions’ metric.
SELECT * FROM AccountTimeSeriesWithoutBreakdown
SELECT * FROM AccountTimeSeriesWithoutBreakdown WHERE FromDateTime='2023-06-20T00:00:00Z' AND ToDateTime='2023-07-12T00:00:00Z'
Columns
Name | Type | Description |
---|---|---|
InstagramBusinessAccountId | String | The unique identifier for the Instagram business account Id. |
Metric | String | Metric Type. The supported Metric types are impressions, website_clicks, profile_views, reach. The default metric type is impressions. |
EndTime | Datetime | End time. |
Value | Integer | Total values of the metrics. |
Pseudo-Columns
Pseudo column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source.
Name | Type | Description |
---|---|---|
FromDateTime | Datetime | The earliest time for insight data to have been collected. |
ToDateTime | Datetime | The latest time for insight data to have been collected. |
AccountWithoutBreakdown
It returns the total values of the metric type in Instagram. For example, if the metric type is impressions, it will return the number of times your posts, stories, reels, videos and live videos were on screen, including in ads.
For this view, the Metric Type is total_value. Requires the instagram_basic and instagram_manage_insights scopes.
Select
The connector will use the Instagram APIs to process filters that refer to a date range or InstagramBusinessAccountId and will process other filters client-side within itself.
Metric supports the ‘=,IN’ operator.
The default query returns results for the ‘impressions’ metric.
SELECT * FROM AccountWithoutBreakdown
SELECT * FROM AccountWithoutBreakdown WHERE FromDateTime='2023-06-20T00:00:00Z' AND ToDateTime='2023-07-12T00:00:00Z'
To retrieve the result for other available metric, then explicitly specify the Metric in where clause.
Example:
SELECT * FROM AccountWithoutBreakdown WHERE Metric = 'accounts_engaged'
SELECT * FROM AccountWithoutBreakdown WHERE Metric = 'replies'
SELECT * FROM AccountWithoutBreakdown WHERE Metric = 'website_clicks'
SELECT * FROM AccountWithoutBreakdown WHERE Metric = 'profile_views'
SELECT * FROM AccountWithoutBreakdown WHERE Metric IN ('accounts\_engaged', 'replies', 'website\_clicks', 'profile_views')
Columns
Name | Type | Description |
---|---|---|
InstagramBusinessAccountId | String | The unique identifier for the Instagram business account Id. |
TotalValue | Int | Total values of the metrics. |
Metric | String | Metric Type. The supported Metric types are impressions, accounts_engaged, replies, website_clicks, profile_views, total_interactions, reach, likes, comments, saves, shares, follows_and_unfollows, profile_links_taps. The default metric type is impressions. |
Pseudo-Columns
Pseudo column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source.
Name | Type | Description |
---|---|---|
FromDateTime | Datetime | The earliest time for insight data to have been collected. |
ToDateTime | Datetime | The latest time for insight data to have been collected. |
AudienceInsights
Retrieve follower insights for an Instagram business account.
Select
By default this table returns the following:
- The countries of this profile’s followers.
To return any of the below demographic information about your followers:
The gender and age distribution of this profile’s followers.
The locales of this profile’s followers, by country code.
The cities of this profile’s followers.
you will need to filter on the AudienceType column:
SELECT * FROM AudienceInsights WHERE AudienceType='country'
SELECT * FROM AudienceInsights WHERE AudienceType IN ('city','country','genderandage')
The above query will return follower counts broken down by city, follower counts broken down by country, and follower counts broken down by gender and age.
Valid values for the AudienceType column are:
city
country
gender
age
genderandage
Columns
Name | Type | Description |
---|---|---|
InstagramBusinessAccountId | String | The unique identifier for the Instagram business account Id. |
AudienceType | String | The type of followers breakdown. Possible values: city, country, gender, age, genderandage. |
AudienceGroup | String | The breakdown value for followers. |
TotalAudience | Integer | The total number of followers. |
Description | String | The total number of the followers for this profile who were online during the specified period. |
Timeframe | String | The earliest time for insight data to have been collected. Possible values: last_14_days, last_30_days, last_90_days, prev_month, this_month, this_week. |
IGMedia
This View Represents an Instagram Photo, Video, Story, Album, or IGTV media.
Select
The connector will use the Instagram API to process WHERE clause conditions built with the following columns and operators. The rest of the filter is executed client side within the connector.
- Id supports the ‘=’ operator.
For example, the following query is processed server side:
SELECT * FROM IGMedia WHERE Id = '1234'
Columns
Name | Type | Description |
---|---|---|
Id [KEY] | String | Media ID. |
IGId | String | Instagram media ID. |
Caption | String | Caption for the IGMedia. |
CommentsCount | Integer | Count of comments on the media. |
IsCommentEnabled | Boolean | Indicates if comments are enabled or disabled. Excludes album children. |
LikeCount | Integer | Count of likes on the media. |
MediaProductType | String | Surface where the media is published. |
MediaType | String | Media type. |
MediaUrl | String | Media URL. |
Owner | String | ID of Instagram user who created the media. |
PermanentURL | String | Permanent URL to the media. |
ShortCode | String | Shortcode to the media. |
ThumbnailUrl | String | Media thumbnail URL. |
Timestamp | Datetime | ISO 8601 formatted creation date in UTC. |
Username | String | Username of user who created the media. |
InstagramBusinessAccountId | String | The unique identifier for the Instagram business account Id. |
InstagramBusinessProfile
Get information about the Instagram Business account. Requires the instagram_basic scope, business_management, manage_pages .
Select
The connector will process all filters on this table client-side within itself.
Columns
Name | Type | Description |
---|---|---|
InstagramBusinessAccountId [KEY] | String | The unique identifier of the Instagram business account |
UserName | String | The username of the person. |
FullName | String | The full name of the person. |
ProfilePictureUrl | String | The profile picture of the person. |
Bio | String | The bio of the person. |
Website | String | The website of the person. |
MediaCount | Integer | The media count of the profile. |
FollowsCount | Integer | The follows count of the profile. |
FollowersCount | Integer | The followers count of the profile. |
InstagramPages
Query information about pages connected to the Facebook account. Requires the instagram_basic scope.
Select
The connector will process all filters client-side within itself. You can use this table to obtain the value of the BusinessAccountId connection property:
SELECT Name, InstagramBusinessAccountId FROM Pages
Columns
Name | Type | Description |
---|---|---|
Id [KEY] | String | The unique identifier for the pages. |
Name | String | The unique identifier for the instagram. |
InstagramBusinessAccountId | String | The unique identifier for the instagram. |
AccessToken | String | Access Token |
Media
Query media objects. Requires the instagram_basic and instagram_content_publish scopes.
Select
The connector will use the Instagram APIs to process filters by Id and will process other filters client-side within itself.
The following query gets all media published by the authenticated user:
SELECT * FROM Media
To retrieve a single media object, the Id is required. The Id column supports the = operator. For example:
SELECT * FROM Media WHERE Id = '1501471279105199430_5380790872'
Columns
Name | Type | Description |
---|---|---|
Id [KEY] | String | The unique identifier for the media object. |
InstagramBusinessAccountId | String | The unique identifier of the Instagram business account Id. |
Username | String | The username. |
MediaType | String | The type of media (image or video or reels or carousel). |
MediaProductType | String | The Surface where the media is published Can be AD, FEED, STORY or REELS. |
Caption | String | The caption for the media. Excludes carousel children. |
CommentsCount | Integer | The number of comments. |
LikesCount | Integer | The number of likes. |
Mediaurl | String | The video URL of the media. |
Link | String | The link of the media. |
Created | Datetime | The time when the media was created. |
MediaInsightReels
Allows you to get insights for reel media object. Requires the instagram_basic and instagram_manage_insights scopes.
Select
You can query the following metrics using server-side processing:
Reach
Comments
Likes
Saved
Plays
Shares
TotalInteractions
The connector will use the Instagram APIs to process filters by a MediaId and will process filters on other columns client-side within itself.
MediaInsightReels will only return the result of reels object.
Return results for the following metrics, saved for all the reels objects: Reach, Saved, Comments, Likes, Plays, Shares and TotalInteractions.
SELECT * FROM MediaInsightReels WHERE MediaId = 17905513811523370"
SELECT Reach, Saved, Comments, Likes, Plays, Shares, TotalInteractions FROM MediaInsightReels WHERE MediaId = 17905513811523370
Columns
Name | Type | Description |
---|---|---|
MediaId | String | The unique identifier of the insight. |
Reach | Integer | Total number of unique accounts that have seen the media object. |
Saved | Integer | Total number of unique accounts that have saved the media object. |
Comments | Integer | Total number of unique accounts that have Comments on the media object. |
Likes | Integer | Total number of unique accounts that have likes the media object. |
Plays | Integer | Total number of unique accounts that have plays the media object. |
Shares | Integer | Total number of unique accounts that have Shared the media object. |
TotalInteractions | Integer | Total number of unique accounts that involved in the media object. |
InstagramBusinessAccountId | String | The unique identifier for the Instagram business account Id. |
MediaInsights
Allows you to get insights for an individual media object. Requires the instagram_basic and instagram_manage_insights scopes.
Select
You can query the following metrics using server-side processing:
Impressions
Engagement (likes, comments, and saves)
Reach
Saved
Videoviews (only on a video object)
TapsForward (only on a story object)
TapsBack (only on a story object)
Exits (only on a story object)
Replies (only on a story object)
The connector will use the Instagram APIs to process filters by a MediaId and will process filters on other columns client-side within itself.
MediaInsights will return result of all media objects except reels object.
Return results for the following metrics, saved for all the image and carousel objects: impressions, engagement, and reach.
SELECT * FROM MediaInsights
Query the MediaInsights view using a different object, for example, stories.
SELECT TapsForward, TapsBack FROM MediaInsights WHERE MediaId = "132155564886465"
Query the MediaInsights view using a different object, for example, videos.
SELECT Impressions, Engagement, Reach, Saved, VideoViews FROM MediaInsights WHERE MediaId = "1321555648546465"
Columns
Name | Type | Description |
---|---|---|
MediaId | String | The unique identifier of the insight. |
Impressions | Integer | Total number of times the media object has been seen. |
Engagement | Integer | Total number of likes and comments on the media object. Only available when Version< 18.0 |
TotalInteractions | Integer | Total number of likes, comments, saves, and shares on the media object. Only available when Version >= 18.0 |
Reach | Integer | Total number of unique accounts that have seen the media object. |
Saved | Integer | Total number of unique accounts that have saved the media object. |
VideoViews | Integer | Total number of unique accounts that have viewed the video. |
TapsForward | Integer | Total number of unique accounts that have tapped forward. |
TapsBack | Integer | Total number of unique accounts that have tapped backwards. |
Exits | Integer | Total number of exits from unique accounts. |
Replies | Integer | Total number of unique accounts that have replied. |
InstagramBusinessAccountId | String | The unique identifier for the Instagram business account Id. |
MediaInsightsPost
Allows you to get insights for an individual media object for POSTs. Requires the instagram_basic and instagram_manage_insights scopes.
Select
You can query the following metrics using server-side processing:
Comments
Follows
Likes
ProfileActivity
ProfileVisits
Shares
TotalInteractions
The connector will use the Instagram APIs to process filters by a MediaId and will process filters on other columns client-side within itself.
Return results for the following metrics, saved for all the POSTs objects: Comments, Follows, Likes, ProfileActivity, ProfileVisits, Shares and TotalInteractions.
SELECT * FROM MediaInsightsPost WHERE MediaId = 17945732813652602"
SELECT Comments, Follows, Likes, ProfileActivity, ProfileVisits, Shares, TotalInteractions FROM MediaInsightsPost WHERE MediaId = 17945732813652602
Columns
Name | Type | Description |
---|---|---|
MediaId | String | The unique identifier of the insight. |
Comments | Integer | The number of comments on your post. |
Follows | Integer | The number of accounts that started following you. |
Likes | Integer | The number of likes on your post. |
ProfileActivity | Integer | The number of actions people take when they visit your profile after engaging with your post. |
ProfileVisits | Integer | The number of times your profile was visited. |
Shares | Integer | The number of shares of your post. |
TotalInteractions | Integer | The number of likes, saves, comments and shares on your post minus the number of unlikes, unsaves and deleted comments. |
MediaInsightsStory
Allows you to get insights for an individual media object for Story. Requires the instagram_basic and instagram_manage_insights scopes.
Select
You can query the following metrics using server-side processing:
Follows
ProfileActivity
ProfileVisits
Shares
TotalInteractions
The connector will use the Instagram APIs to process filters by a MediaId and will process filters on other columns client-side within itself.
Return results for the following metrics, saved for all the Story objects: Follows, ProfileActivity, ProfileVisits, Shares and TotalInteractions.
SELECT * FROM MediaInsightsStory WHERE MediaId = 17945732813652602"
SELECT Comments, Follows, Likes, ProfileActivity, ProfileVisits, Shares, TotalInteractions FROM MediaInsightsStory WHERE MediaId = 17945732813652602
Columns
Name | Type | Description |
---|---|---|
MediaId | String | The unique identifier of the insight. |
Follows | Integer | The number of accounts that started following you. |
ProfileActivity | Integer | The number of actions people take when they visit your profile after engaging with your story. |
ProfileVisits | Integer | The number of times your profile was visited. |
Shares | Integer | The number of times your profile was visited. |
TotalInteractions | Integer | The number of replies and shares for your story. |
OnlineFollowers
Query Online Followers insights as hourly totals. Requires the instagram_basic and instagram_manage_insights scopes.
Select
You can use the FromDateTime and ToDateTime columns to filter the results by a timeframe. The connector uses the Instagram API to process filters that refer to a timeframe or Id and will process other filters client-side within itself.
The default query returns results as hourly totals during the last 7 days.
SELECT * FROM OnlineFollowers
The maximum timeframe you can specify with the FromDateTime and ToDateTime columns is 30 days (2592000 s).
SELECT * FROM OnlineFollowers WHERE FromDateTime = '2018/01/01' AND ToDateTime = '2018/01/30'
Columns
Name | Type | Description |
---|---|---|
InstagramBusinessAccountId | String | The unique identifier for the business account. |
StartTime | Datetime | The start datetime of the insight. |
EndTime | Datetime | The end datetime of the insight. |
Onlinefollowers | Integer | The number of the online followers at the specific time. |
Pseudo-Columns
Pseudo column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source.
Name | Type | Description |
---|---|---|
FromDateTime | Datetime | The earliest time for insight data to have been collected. |
ToDateTime | Datetime | The latest time for insight data to have been collected. |
Pages
Get details of Pages. Requires ‘pages_read_engagement’ permission or the ‘Page Public Content Access’ feature or the ‘Page Public Metadata Access’ feature.
Select
The connector will use the Instagram API to process WHERE clause conditions built with the following column and operator. The SearchTerms is required to make a request and the rest of the filter is executed client side within the connector.
SearchTerms supports the ‘=’ comparison.
Example:
SELECT * FROM Pages WHERE SearchTerms = 'facebook'
Columns
Name | Type | Description |
---|---|---|
Id [KEY] | String | The ID of the Facebook Page. |
EligibleForBrandedContent | Boolean | Display whether the Facebook Page is eligible to post branded content. |
IsUnclaimed | Boolean | Display whether a Facebook Page that was automatically generated has been claimed by the business it represents. |
Link | String | The link to the Facebook Page. |
City | String | The city where the business represented by the Facebook Page is located. |
Country | String | The country where the business represented by the Facebook Page is located. |
Latitude | Double | The latitude of the business represented by the Facebook Page. |
Longitude | Double | The longitude of the business represented by the Facebook Page. |
State | String | The state where the business represented by the Facebook Page is located. |
Street | String | The street on which the business represented by the Facebook Page is located. |
Zip | Integer | The postal code of the business represented by the Facebook Page. |
Name | String | The name of the Facebook Page. |
VerificationStatus | String | The verification status of the Facebook Page that represents a business. |
Pseudo-Columns
Pseudo column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source.
Name | Type | Description |
---|---|---|
SearchTerms | String | The term that is to be searched. |
Permissions
Query the Permissions the User has granted the current application.
Select
To query the Permissions view.
SELECT * FROM Permissions
Columns
Name | Type | Description |
---|---|---|
PermissionName [KEY] | String | The name of the permission. |
Status | String | The status of the requested permission. |
Stories
Query Stories. Requires the instagram_basic and instagram_manage_insights scopes.
Select
The connector process all filters on this table client-side within itself.
Columns
Name | Type | Description |
---|---|---|
Id [KEY] | String | The unique identifier for the story. |
InstagramBusinessAccountId | String | The unique identifier of the Instagram business account Id. |
Tags
Query tags. Requires the instagram_basic and instagram_manage_comments scopes.
Select
The connector processes all filters on this table client-side within itself.
Columns
Name | Type | Description |
---|---|---|
Id [KEY] | String | The unique identifier for the tag. |
Username | String | The unique identifier for the user. |
Caption | String | The caption for the tag. |
ComentsCount | Int | The number of coments. |
LikeCount | Int | The number of likes. |
MediType | String | The type of media (image or video). |
MediUrl | String | The media URL. |
UserId | String | The Id of the user. |
Timestamp | Datetime | Time the media was created. |
InstagramBusinessAccountId | String | The unique identifier for the Instagram business account. |
If you have any feedback on Gathr documentation, please email us!