Instagram Hashtag Collector

Extract the most recent posts for any hashtags or locations on Instagram

Table of Contents

Monitor Instagram data

So you need to get data from Instagram? Just define which hashtags or locations you're interested in. This API will collect everything you need from IG's search result page and produce a neat CSV/Excel file.

This is perfect to monitor what's happening around your #brand or city. Get a detailed report of everything that has been said on these topics and discover new profiles and hashtags to monitor / follow.

What will you need? ⚙️

  • Instagram hashtag, location or Spreadsheet URL: Choose a specific hashtag beginning with # (like #phantombuster) or a location (like New York, New York) or enter a spreadsheet URL containing many hashtags
  • Session cookie (sessionid): Your Instagram sessionid session cookie (more info below)

Which steps to follow?

1. Create an account on 💻

If you haven't already, create a FREE account on Phantombuster. Our service will browse the web for you. It’s a website automator which runs in the cloud. Once done we'll follow up.

2. Use this API on your account.👌

Now that you're connected to Phantombuster, Click on the following button (it will open a new tab).

3. Click on Configure me!

You'll now see the 3 configuration dots blinking. Click on them.

4. Aim for a specific hashtag or several at a time

In the 1st configuration field "Instagram Hashtag or Spreadsheet URL" you have the choice to use this API for 1 hashtag/location at a time or several in one go:

  • One at a time: Just fill the form with a hashtag beginning with # (example: #phantombuster) or a location (example: New York, New York)
  • Several at a time: Paste the URL of a Google Spreadsheet filled with Instagram hashtags (beginning with #) and/or locations

5. Get your Instagram session cookie

The session cookie you'll need to make this API work is called "sessionid",
Here's how you can get yours:

  • Using Chrome, go to your Instagram homepage and open the inspector
    → Right click anywhere on the page and select “Inspect”
    CMD+OPT+i on macOS
    F12 or CTRL+MAJ+i on Windows

  • Locate the “Application” tab

  • Select “Cookies” > “” on the left menu.

  • Locate the “sessionid” cookie.

  • Copy what’s under “Value” (Double click on it then Ctrl+C) and paste it into your script configuration

// How to access your cookies with Firefox and Safari //

Click on Launch & Enjoy!

It’s done! All that is left to do is to click on "launch" to try your script!


This API will output CSV and/or JSON containing the following fields:

  • profileUrl (Profile URL of post author)
  • profileName (Username of post author (only if available))
  • ownerId (Instagram unique ID of post author)
  • postUrl (Instagram post URL)
  • description (Post description)
  • pubDate (Post publication date)
  • likeCount (Number of likes the post received)
  • commentCount (Number of comments the post received)
  • views (Number of views, if the post contains a video)
  • location (Where the photo was taken (only if available))
  • query (Hashtag (or location) that lead to the post)
  • postVideo (Link to raw video file, if available, can contains more than one link if the data is available)
  • videoThumbnail (Link to raw video thumbnail, can contains more than one link if the data is available)
  • postImage (Link to raw post image, can contains more than one link if the data is available)

Share this API

Your friends & colleagues need to know about this!