Workflow

Export Instagram Hashtag Posts to a Spreadsheet

Scrape all posts tagged with a specific hashtag on Instagram. Paste a fetch() from DevTools to extract post authors, captions, likes, comments, and media URLs with automatic pagination.

Jan HeimesJan Heimes

Last updated

February 18, 2026

Connectors used

Google Sheets

Tags

InstagramHashtag ScraperSocial MediaContent ResearchGoogle SheetsTrend Analysis

Key Takeaways

  • Works with any hashtag - Scrape posts tagged with any hashtag you can search on Instagram
  • Automatic pagination - Loops through all result pages using the SERP API's next_max_id cursor
  • Rich post data - Author username, caption, like count, comment count, media type, and post URL
  • Exports to Google Sheets - Saves each batch of posts to your spreadsheet as it scrapes
  • Requires a browser session - You copy a fetch() request from DevTools to authenticate

What This Workflow Does

This workflow scrapes all posts tagged with a specific hashtag on Instagram and exports them to Google Sheets. You search for a hashtag in Instagram's explore page, copy the API request from DevTools, paste it into the manual trigger, and the workflow pages through all results extracting post and author data.

Use cases:

  • Research trending content for a specific hashtag or niche
  • Find active creators posting about a topic for outreach or partnerships
  • Analyze engagement patterns across posts in a hashtag
  • Monitor competitor or industry hashtags for content strategy

How It Works

StepWhat Happens
1. Manual triggerYou paste a fetch() request copied from Instagram's hashtag search API
2. Parse fetchCode node extracts the URL, headers, hashtag name, and rank token
3. Loop through pagesFetches result pages using next_max_id pagination with an 8-second delay
4. Extract post dataPulls author info, caption, engagement metrics, media type, and post URL
5. Save to Google SheetsAI node writes each batch of posts to your spreadsheet

Setup Instructions

  1. Click "Use template" on this page
  2. Go to instagram.com and log into your account
  3. Navigate to instagram.com/explore/search/keyword/?q=%23YOUR_HASHTAG (replace YOUR_HASHTAG)
  4. Open DevTools (F12), go to the Network tab
  5. Scroll down to load more posts
  6. Filter by top_serp in the Network tab
  7. Find the fbsearch/web/top_serp GET request
  8. Right-click the request, select Copy > Copy as fetch
  9. Paste the fetch() into the Manual Trigger node
  10. Connect your Google Sheets connector and update the sheet URL in the AI node
  11. Run the workflow

Customization

What You Can ChangeHow
Target hashtagPaste a different fetch() request from another hashtag search
Google SheetUpdate the spreadsheet URL in the AI node prompt
Page limitChange the max page count in the loop node condition (default: 100)
Delay between pagesAdjust the wait node duration (default: 8s) to avoid rate limits

FAQ

Q: How do I find the right request in DevTools? A: After scrolling the hashtag search page, filter the Network tab by top_serp. You should see a GET request to fbsearch/web/top_serp — that's the one to copy.

Q: How many posts can I scrape? A: The workflow fetches posts in batches per page with a max of 100 pages. The exact number of posts per page varies but is typically 20-30.

Q: Does this work for any hashtag? A: Yes, as long as the hashtag has results and isn't blocked by Instagram.

Q: Why is the delay 8 seconds instead of 5? A: The hashtag search API is more sensitive to rate limiting than other endpoints. A longer delay helps avoid session blocks.

Q: What if I get errors partway through? A: Your Instagram session may have expired. Re-copy the fetch() request from DevTools and try again.

Q: Can I track multiple hashtags at once? A: Run the workflow separately for each hashtag. Each run needs its own fetch() request from the corresponding hashtag search page.

Want to showcase your own workflows?

Become a Needle workflow partner and turn your expertise into recurring revenue.

Try Needle today

Streamline AI productivity at your company today

Join thousands of people who have transformed their workflows.

Agentic workflowsAutomations, meet AI agents
AI SearchAll your data, searchable
Chat widgetsDrop-in widget for your website
Developer APIMake your app talk to Needle
    Needle LogoNeedle
    Like many websites, we use cookies to enhance your experience, analyze site traffic and deliver personalized content while you are here. By clicking "Accept", you are giving us your consent to use cookies in this way. Read our more on our cookie policy .