See llms.txt for all machine-readable content.

Back to Templates

Scrape Instagram profiles with Apify and log results to Google Sheets

Created by

Created by: Dr. Firas || drfiras
Dr. Firas

Last update

Last update 4 days ago

Categories

Share


Quick overview

This workflow collects public Instagram usernames through an n8n form, scrapes profile and recent post metrics using Apify’s Instagram Profile Scraper, then upserts the results (including engagement rate and a high-profile flag) into a Google Sheets table.

How it works

  1. Receives Instagram usernames submitted through an n8n form (comma- or newline-separated).
  2. Normalizes the input into a clean username list and sets run parameters like the Apify actor and how many recent posts to analyze.
  3. Sends a single batched request to the Apify Instagram Profile Scraper API to retrieve profile details and latest post stats.
  4. Detects whether each returned item contains valid profile data and formats records into a consistent schema for scraped vs. private/not-found outcomes.
  5. Captures Apify request failures and formats an error record with a clear status and timestamp.
  6. Merges all outcomes and appends or updates rows in Google Sheets so reruns update existing usernames instead of creating duplicates.

Setup

  1. Add an Apify API token as an HTTP Header Auth credential (Authorization: Bearer <token>) and select it in the Apify request step.
  2. Connect a Google Sheets OAuth2 credential, then select the target spreadsheet and the “Profiles” sheet (or create them).
  3. Ensure the sheet has columns matching the logged fields (for example: username, fullName, followersCount, followsCount, biography, profilePicUrl, externalUrl, isPrivate, isVerified, postsCount, latestPostCaption, latestPostLikes, latestPostComments, engagementRatePercent, isHighProfile, status, scrapedAt).
  4. Review the configuration values (Apify actor slug, resultsLimit/max posts, and the follower threshold used to flag high-profile accounts) to match your needs.

Additional info

Scrape Instagram profiles and log them to Google Sheets

📥 Open full documentation on Notion

Need help customizing?

Contact me for consulting and support : Linkedin

MY NEW YOUTUBE CHANNEL

👉 Subscribe to my new YouTube channel. Here I'll share videos and Shorts with practical tutorials and FREE templates for n8n.

The AI Doctor