Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Source Instagram: updating media and mediainsights fields #53214

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,16 @@
}
}
},
"boost_eligibility_info": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TY for regenerating ERDs too!

"description": "The field provides information about boosting eligibility of a Instagram instagram media as an ad and additional details if not eligible.",
"type": ["null", "object"],
"properties": {
"eligible_to_boost": {
"description": "The field indicates eligibility to boost.",
"type": ["null", "boolean"]
}
}
},
"permalink": {
"description": "The permanent link to the media item on Instagram.",
"type": ["null", "string"]
Expand Down Expand Up @@ -226,6 +236,10 @@
"profile_visits": {
"description": "The number of times the profile has been visited.",
"type": ["null", "integer"]
},
"views": {
"description": "Total number of times the video IG Media has been seen.",
"type": ["null", "integer"]
}
},
"required": ["id"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Table "media" {
"timestamp" string
"username" string
"children" array
"boost_eligibility_info" object
}

Table "media_insights" {
Expand All @@ -38,6 +39,7 @@ Table "media_insights" {
"clips_replays_count" integer
"follows" integer
"profile_visits" integer
"views" integer
}

Table "users" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ data:
connectorSubtype: api
connectorType: source
definitionId: 6acf6b55-4f1e-4fca-944e-1a3caef8aba8
dockerImageTag: 3.1.6
dockerImageTag: 3.1.7
dockerRepository: airbyte/source-instagram
githubIssueLabel: source-instagram
icon: instagram.svg
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ requires = [ "poetry-core>=1.0.0",]
build-backend = "poetry.core.masonry.api"

[tool.poetry]
version = "3.1.6"
version = "3.1.7"
name = "source-instagram"
description = "Source implementation for Instagram."
authors = [ "Airbyte <contact@airbyte.io>",]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ definitions:
http_method: GET
request_parameters:
fields: >-
caption,comments_count,id,ig_id,is_comment_enabled,like_count,media_type,media_product_type,media_url,owner,permalink,shortcode,thumbnail_url,timestamp,username,children
caption,comments_count,id,ig_id,is_comment_enabled,like_count,media_type,media_product_type,media_url,owner,permalink,shortcode,thumbnail_url,timestamp,username,children,boost_eligibility_info
error_handler:
type: CompositeErrorHandler
error_handlers:
Expand Down Expand Up @@ -119,11 +119,11 @@ definitions:
metric: >-
{% if stream_partition.media_insights_info.media_product_type ==
"REELS" %}{{
'comments,ig_reels_avg_watch_time,ig_reels_video_view_total_time,likes,plays,reach,saved,shares,ig_reels_aggregated_all_plays_count,clips_replays_count'
'comments,ig_reels_avg_watch_time,ig_reels_video_view_total_time,likes,plays,reach,saved,shares,ig_reels_aggregated_all_plays_count,clips_replays_count,views,total_interactions'
}}{% elif stream_partition.media_insights_info.media_type ==
"VIDEO" and
stream_partition.media_insights_info.media_product_type == "FEED"
%}{{ 'impressions,reach,saved'}}{% elif
%}{{ 'impressions,reach,saved,views,total_interactions'}}{% elif
stream_partition.media_insights_info.media_type == "VIDEO" %}{{
'impressions,reach,saved,likes,comments,shares,follows,profile_visits'
}}{%elif stream_partition.media_insights_info.media_type ==
Expand Down Expand Up @@ -683,6 +683,17 @@ schemas:
type:
- "null"
- string
boost_eligibility_info:
description: The field provides information about boosting eligibility of a Instagram instagram media as an ad and additional details if not eligible.
type:
- "null"
- object
properties:
eligible_to_boost:
description: A boolean value which indicates eligibility boost.
type:
- "null"
- boolean
permalink:
description: The permanent link to the media item on Instagram.
type:
Expand Down Expand Up @@ -814,6 +825,11 @@ schemas:
type:
- "null"
- integer
views:
description: Total number of times the video IG Media has been seen..
type:
- "null"
- integer
reach:
description: The number of unique users who have seen the media.
type:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@
"profile_visits": {
"description": "The number of times the profile has been visited.",
"type": ["null", "integer"]
},
"views": {
"description": "Total number of times the video IG Media has been seen.",
"type": ["null", "integer"]
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"timestamp",
"username",
"children",
"boost_eligibility_info",
]

_CHILDREN_FIELDS = ["id", "ig_id", "media_type", "media_url", "owner", "permalink", "shortcode", "thumbnail_url", "timestamp", "username"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"timestamp",
"username",
"children",
"boost_eligibility_info",
]
_PARENT_STREAM_NAME = "media"
_STREAM_NAME = "media_insights"
Expand Down Expand Up @@ -88,8 +89,10 @@
"shares",
"ig_reels_aggregated_all_plays_count",
"clips_replays_count",
"views",
"total_interactions",
],
MEDIA_ID_VIDEO_FEED: ["impressions", "reach", "saved"],
MEDIA_ID_VIDEO_FEED: ["impressions", "reach", "saved", "views", "total_interactions"],
MEDIA_ID_VIDEO: ["impressions", "reach", "saved", "likes", "comments", "shares", "follows", "profile_visits"],
MEDIA_ID_CAROUSEL_ALBUM: ["impressions", "reach", "saved", "shares", "follows", "profile_visits"],
MEDIA_ID_GENERAL_MEDIA: METRICS_GENERAL_MEDIA,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@
"shortcode": "HGagdsy38",
"thumbnail_url": "https://fakecontent.cdninstagram.com/v/somepath/",
"timestamp": "2023-06-12T19:20:02+0000",
"username": "username"
"username": "username",
"boost_eligibility_info": {
"eligible_to_boost": true
}
},
{
"caption": "a caption",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@
"shortcode": "HGagdsy38",
"thumbnail_url": "https://fakecontent.cdninstagram.com/v/somepath/",
"timestamp": "2023-06-12T19:20:02+0000",
"username": "username"
"username": "username",
"boost_eligibility_info": {
"eligible_to_boost": true
}
},
{
"caption": "a caption",
Expand All @@ -36,7 +39,10 @@
"shortcode": "HGagdsy38",
"thumbnail_url": "https://fakecontent.cdninstagram.com/v/somepath/",
"timestamp": "2022-09-15T11:33:25+0000",
"username": "username"
"username": "username",
"boost_eligibility_info": {
"eligible_to_boost": true
}
},
{
"caption": "a caption",
Expand All @@ -55,7 +61,10 @@
"shortcode": "HGagdsy38",
"thumbnail_url": "https://fakecontent.cdninstagram.com/v/somepath/",
"timestamp": "2023-04-28T20:32:08+0000",
"username": "username"
"username": "username",
"boost_eligibility_info": {
"eligible_to_boost": true
}
},
{
"caption": "a caption",
Expand Down Expand Up @@ -107,7 +116,10 @@
"permalink": "https://instagram.com/permalink/123",
"shortcode": "HGagdsy38",
"timestamp": "2019-05-02T11:42:01+0000",
"username": "username"
"username": "username",
"boost_eligibility_info": {
"eligible_to_boost": true
}
}
],
"paging": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,30 @@
"title": "Clip Replays Count title",
"description": "Clip Replays Count description.",
"id": "84386203808767123/insights/clips_replays_count/lifetime"
},
{
"name": "views",
"period": "lifetime",
"values": [
{
"value": 10
}
],
"title": "views title",
"description": "Total number of times the video IG Media has been seen.",
"id": "84386203808767123/insights/views/lifetime"
},
{
"name": "total_interactions",
"period": "lifetime",
"values": [
{
"value": 10
}
],
"title": "total interactions",
"description": "Number of likes, saves, comments, and shares on the reel, minus the number of unlikes, unsaves, and deleted comments. Metric in development.",
"id": "84386203808767123/insights/total_interactions/lifetime"
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,30 @@
"title": "Video Views",
"description": "The number of times your video was viewed.",
"id": "90014330517797123/insights/video_views/lifetime"
},
{
"name": "views",
"period": "lifetime",
"values": [
{
"value": 10
}
],
"title": "views title",
"description": "Total number of times the video IG Media has been seen.",
"id": "84386203808767123/insights/views/lifetime"
},
{
"name": "total_interactions",
"period": "lifetime",
"values": [
{
"value": 10
}
],
"title": "total interactions",
"description": "Number of likes, saves, comments, and shares on the reel, minus the number of unlikes, unsaves, and deleted comments. Metric in development.",
"id": "84386203808767123/insights/total_interactions/lifetime"
}
]
}
1 change: 1 addition & 0 deletions docs/integrations/sources/instagram.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ for more information.

| Version | Date | Pull Request | Subject |
|:--------|:-----------|:---------------------------------------------------------|:--------------------------------------------------------------------------------------------------------------------------|
| 3.1.7 | 2025-02-12 | [53214](https://github.com/airbytehq/airbyte/pull/53214) | New fields in media and mediainsights |
| 3.1.6 | 2025-02-08 | [53291](https://github.com/airbytehq/airbyte/pull/53291) | Update dependencies |
| 3.1.5 | 2025-02-06 | [53171](https://github.com/airbytehq/airbyte/pull/53171) | Fix missing OAuth fields |
| 3.1.4 | 2025-02-01 | [52260](https://github.com/airbytehq/airbyte/pull/52260) | Update dependencies |
Expand Down
Loading