SheetMagicSheetMagic

Scrape Instagram Posts to Track Competitors in Google Sheets

Type =INSTAGRAM({"nasa","natgeo"}) to pull Instagram posts into Google Sheets with captions, likes, comments and hashtags, so you can see which competitor posts work without scrolling through five profiles. 9 scraping credits per post.

Phil Nguyen · 7 min read

To scrape Instagram posts into Google Sheets, type =INSTAGRAM({"nasa","natgeo"}) in an empty cell, or point it at a column of usernames. SheetMagic pulls the recent posts for those accounts and writes one row per post with the username, caption, hashtags, likes, comment count, post URL, post type, video views and timestamp.

With the posts in rows, you can sort a competitor's last 20 posts by likes and see what works for their audience before you spend a week producing your own.

Say you run social for a brand and watch five competitors. Opening each profile and noting the likes and comments on their last 20 posts, at about 30 seconds a post, is 100 posts and 50 minutes every week. One =INSTAGRAM(A2:A6, , 100) formula over the five usernames returns about 20 recent posts from each, 100 in total, for 900 scraping credits.

You can search a hashtag instead with =INSTAGRAM(, "travel"), and set how many posts come back with the third argument.

Formula

=INSTAGRAM({"nasa","natgeo"})

Usernames go in without the @. The cell shows a loading placeholder, then the posts land on their own results tab.

For the rest of the scraper family, see web scraping in Google Sheets and the Google Sheets web scraping guide.

How do I pull posts from several Instagram accounts at once?

Put the usernames in a column and pass the whole range:

Formula

=INSTAGRAM(A2:A6, , 50)

Five accounts, 50 posts in total. The blank second argument skips the hashtag search.

Three details matter here:

  • Plain usernames. Use nike, not @nike. If an @ slips in, it is stripped for you.
  • The count is a total. The third argument is the number of posts across every account combined, not per account. SheetMagic divides it between the accounts, so 50 posts over five accounts asks for about 10 from each.
  • Missing accounts cost nothing. A username that does not exist or is unavailable is dropped from the results and is not billed.

Can I scrape an Instagram hashtag into Sheets?

Yes. Leave the first argument blank and put the hashtag second, without the #:

Formula

=INSTAGRAM(, "travel", 30)

Recent posts tagged #travel, 30 in total.

Only one hashtag is searched per formula. If you pass several, only the first one is used, so write one formula per hashtag. There is no date filter either, so pull the posts and filter the Timestamp column in the sheet.

What columns does INSTAGRAM return?

Each post becomes one row:

ColumnWhat it holds
Username, Full NameThe account that posted
CaptionThe post text
Hashtags, MentionsTags and @mentions in the post, in one cell each
Likes, Comment CountEngagement counts
First Comment, Latest CommentsRecent comments, with the commenter and date
Tagged UsersAccounts tagged in the post
Post URL, Shortcode, Post IDLinks and IDs for the post
TypeThe post type, such as an image or video
Media URL, Alt Text, Height, WidthThe image and its description
Video ViewsViews for video posts
TimestampWhen it was posted
Pinned, Profile URLWhether it is pinned, and the profile it came from

INSTAGRAM returns post data only. It does not return profile details such as bio or follower count.

How long does it take, and why does the cell say Scraping first?

INSTAGRAM runs in the background, so the sheet stays usable while it works:

  1. The cell shows ⏳ Scraping... straight away.
  2. The posts are written to a new tab named Instagram Scraper Results. Its first column, Source, holds the address of the formula cell that asked for each row.
  3. With Keep Formula on, which is the default, the formula cell keeps your formula frozen as text. With Keep Formula off, it changes to a status such as ✅ 50 results → Instagram Scraper Results.

The worker waits up to nine minutes for a run. If it takes longer, the cell shows #ERROR: this scrape took too long, try a smaller maxResults, and a smaller count is the fix.

Because the rows arrive later on their own tab, keep INSTAGRAM in its own cell rather than inside another formula. The scraper functions announcement explains this pattern for the whole family.

How many scraping credits does an Instagram scrape cost?

INSTAGRAM costs 9 scraping credits per post delivered. With no count, a call returns 20 posts, which is 180 credits.

CallPostsCredits
=INSTAGRAM({"nasa","natgeo"})20 (default)180
=INSTAGRAM(A2:A6, , 50)50450
=INSTAGRAM(, "travel", 10)1090

Credits are held when the job starts and settled to what was actually delivered. A run that finds nothing is not charged. If your balance cannot cover the full count, the run is cut to what you can afford and a row says Limited to N results to fit your remaining credits.

Free comes with 100 scraping credits, enough for 11 posts. Solo includes 10,000 scraping credits a month.

What can you do with the scraped posts?

  • Copy what already works. Sort the results tab by Likes. A competitor's top five posts show the topics and formats their audience responds to, which is cheaper to learn from their feed than from your own failed posts.
  • Pick hashtags with evidence. Read the Hashtags column on the best posts to see which tags they lean on.
  • Match their posting rhythm. The Timestamp column shows how often each account posts and on which days.
  • Decide between video and images. Compare the Type column with Likes and Video Views to see which format earns more engagement for that audience.

Example: a competitor post tracker

Set up one sheet with two tabs.

Accounts tab. List competitor usernames in A2:A6. In C1, add:

Formula

=INSTAGRAM(A2:A6, , 100)

About 20 recent posts per account, 900 credits.

Summary. Once Instagram Scraper Results fills in, the Username column is B, Likes is G and Comment Count is H. Average engagement per account in one formula:

=QUERY('Instagram Scraper Results'!B:H, "select B, count(B), avg(G), avg(H) where B is not null group by B label count(B) 'Posts', avg(G) 'Avg likes', avg(H) 'Avg comments'", 1)

Sort the results tab by Likes to see each competitor's best posts, and read the Hashtags column to see which tags they lean on. When you want fresh numbers, enter the formula again later to pull a new set of posts.

FAQ

Do I need an Instagram login?

No. INSTAGRAM takes only usernames, a hashtag and a post count. There is nothing to sign in to.

Can I wrap INSTAGRAM in another formula?

No. The formula returns a placeholder and writes the real rows to a results tab later. Put it in its own cell and point your other formulas at the results tab.

Does it work on the Free plan?

Yes. Free comes with 100 scraping credits, which covers 11 posts at 9 credits each. Ask for more and the run is cut to what your balance covers.

How do I limit the cost?

Set the third argument. =INSTAGRAM(A2:A6, , 25) caps the run at 25 posts, which is 225 credits, however many accounts are in the range.

How much time does this save?

In a five-competitor example with 20 posts each at about 30 seconds per post, checking engagement by hand takes 50 minutes a week. One =INSTAGRAM() formula returns those 100 posts for 900 scraping credits at 9 credits per post.

Text and scraping formulas run on the free allowance. Install from the Google Workspace Marketplace, no card, no expiry.

Install free for Google Sheets

About the author

Phil NguyenPhil builds SheetMagic, the Google Sheets add-on that brings AI and web scraping into the spreadsheet, used by 6,300+ people. He writes these guides from the formulas he runs on his own sheets.