Include vetric_instagram_post_comments

Include comments found on user posts

Similar to previous examples on fetching Instagram user posts, it is possible to include comments found on each of the user posts fetched.

Data Collection Job Example

This job query will fetch up to 10 Instagram Posts for user id '787132', then include up to 5 Comments from each of the 10 posts found.

📘

You could provide an additional 'max_documents' value for included subsequent queries to better control volume

curl --location 'https: //api.platform.datastreamer.io/api/pipelines/{PIPELINE_ID}/components/{COMPONENT_ID}/jobs?ready=true' \
      --header 'apikey: <your-api-key>' \
      --header 'Content-Type: application/json' \
      --data \
        '{
	"job_name": "my instagram data collection",
	"data_source": "vetric_instagram_user_feed",
	"max_documents": 10,
	"query": {
		"query": "787132",
		"include": [
			{
				"data_source": "vetric_instagram_post_comments",
				"max_documents": 5
			}
		]
	},
	"job_type": "oneTime"
}'

Make sure to replace ‘PIPELINE_ID’ and ‘COMPONENT_ID’ variables to the ones associated with your pipeline.

Data Collection Job Results

The initial query run would first fetch up to 10 documents from vetric_instagram_user_feed data source

{
  "documents": [
    {
      "data_source": "vetric_instagram_user_feed",
      "id": "3465979734695597050_787132",
      "doc_date": "2024-09-27T00:30:11Z",
      "content": {
        "published": "2024-09-27T00:30:11Z",
        "body": "For the first time, scientists observed the brain of one woman throughout pregnancy—from pre-conception to postpartum—scanning her brain 26 times. \n\nThe study found that gray matter in the brain decreased by more than 4 percent during pregnancy while white matter strengthened—changes that could impact cognition, sensation, learning, and interaction with newborns.\n\nWith more than 85 percent of women experiencing pregnancy in their lifetime, understanding its effects on mental health and thinking is essential. Learn more at the link in bio.\n\nPhotograph by greg801n, Getty Images",
        "media_id": "3463427961463821516",
        "comments_count": 646,
        "likes_count": 57155
      },
      "author": {
        "handle": "natgeo",
        "profile_image_source": "https://scontent-dfw5-1.cdninstagram.com/v/t51.2885-19/441272846_3660325754227424_608588627427268733_n.jpg?stp=dst-jpg_e0_s150x150&_nc_ht=scontent-dfw5-1.cdninstagram.com&_nc_cat=1&_nc_ohc=cyKc1c_W14wQ7kNvgErANms&_nc_gid=d71ef15ffaf044b99c4737b0cf3e7074&edm=ABmJApABAAAA&ccb=7-5&oh=00_AYDON588sTVK88A-Mq9vMzk0onqsirPXMXGJToPjTepPFw&oe=66FC8D77&_nc_sid=b41fef",
        "verified": true,
        "protected": false,
        "name": "National Geographic",
        "userid": "787132",
        "url": "https://instagram.com/natgeo/"
      },
      "facebook": {
        "userid": "18005809307466248"
      },
      "source": {
        "link": "https://instagram.com/p/DAZojSFO9P6/"
      }
    }
  ]
}

Partial Response example of collecting Instagram User Feed.

🚧

Only single 'include' object can be requested


Subsequent queries then would start based on fetched user posts, where each user post, would fetch up to 5 documents from vetric_instagram_post_comments source, by matching the user post.

{
  "documents": [
    {
      "data_source": "vetric_instagram_post_comments",
      "id": "18019083575265676",
      "author": {
        "userid": "28569666463",
        "handle": "qbangrl13",
        "name": "ɐɯıəʎ",
        "profile_image_source": "https://scontent-dfw5-1.cdninstagram.com/v/t51.2885-19/460686175_1555771215366982_2989984919338633558_n.jpg?stp=dst-jpg_e0_s150x150&_nc_ht=scontent-dfw5-1.cdninstagram.com&_nc_cat=110&_nc_ohc=pMblR8AEHKQQ7kNvgH7Gvtv&edm=AId3EpQBAAAA&ccb=7-5&oh=00_AYBjMp-YqZZNWAiucGjQbOk6p5Y3SctYV8jCv4PBtn910Q&oe=66FC88F0&_nc_sid=f5838a",
        "verified": false,
        "is_mentionable": false,
        "url": "https://www.instagram.com/qbangrl13"
      },
      "doc_date": "2024-09-23T12:37:44.000Z",
      "content": {
        "published": "2024-09-23T12:37:44.000Z",
        "body": "I have four.. been keeping them since I was a teenager. I love these lil guys ❤️",
        "likes_count": 1,
        "child_comments_count": 0,
        "related_post_id": "3463427961463821516"
      },
      "instagram": {
        "content_type": "comment"
      }
    }
  ]
}

Partial Response example of collecting Instagram Post Comments.