Skip to main content

Social::Instagram::Tag - Instagram Tag Post Scraper

Social::Instagram::Tag

Overview of the scraper

Social::Instagram::TagSocial::Instagram::Tag – scrapes posts by tags from Instagram. Automated collection of all data: post type, text, publication date, number of comments, number of likes, and much more. Along with the comment text, it also collects the author's profile link, the number of likes on it, and the time it was created.

You can use automatic query replication, substitution of subqueries from files, iteration of alphanumeric combinations and lists to get the maximum possible number of results. Using result filtering you can immediately clean the result, removing all unnecessary junk (using minus words).

A-Parser functionality allows you to save Social::Instagram::Tag scraper settings for further use (presets), set scraping schedules, and much more.

Results can be saved in the form and structure you need, thanks to the built-in powerful templating engine Template Toolkit which allows you to apply additional logic to the results and output data in various formats, including JSON, SQL and CSV.

note

The scraper uses data from an authorized account. To run the scraper, you must specify a value for the cookie option.

Scraper use cases

Collecting all posts by tags

Use case
  1. Override option Count of pages with posts, select 100.
  2. Override option Result format, set value to $posts.format('$link\n').
  3. Specify tags as queries.
Download example

How to import the example into A-Parser

eJx1U01v2zAM/S9CgK5AEKSHXXxLAwTokNVdk56SHAibNrTIoibJWQvD/72U7NhJ
P24i+fj4KJKN8OCO7smiQ+9EsmuEiW+RiBwLqJUXU2HAOrQhvBMbyiSoJHnQzkNp
oUqSLZQMGuCN8G8GmYBOaK3MkYMyZ9tAiRnVOlCeQNWMuZvP2+8TCrIVeNbTyehz
xMSQ827WRX/cTJTUx/1e39yK9nCYig7vVjEc4XezvqkhuIETbimUkApH94qtR6hi
kRw8hui5zu3MvwYGyHPpJWlQXYXwLWPVFy3/RZGaGMtPK9GtLFXs8hgJgvPtrG4n
JtEWTFHH3D9djkgKUA6nwrHUFbCQ/GNEerTgyaYm6GF/I0gvlFrjCdUIi/z3tVQ5
z3BRcNJDn/g1JP3E0Q7tXZbiYf23rGFgidZ9+nvMymlN5fkzlKykZ9st4w4kYs7O
I6IZ/uwxwCqyOJTpmfvqvKYGddiMcWQLM7qu2rgay7UzI13IMu237Yys9ZZvIdVL
qozC0JeuleKxOHwe12Ph+jEEYxT4MXkZS1xdkSdS7temk2qs5PX7GQRW/JOXVXvK
DJR6eV5fRsS4Umxkpt5rZ8gG8oy3tSTeI+6lPQwnOxx2893hJk3Lg/rrnrqE0FWA
s4+/x/EU+Ejbd0hbdis=

Collected Data

Two arrays with regular posts and top posts:

  • Post type
  • Link to post
  • Text
  • Publication date (in Unix format)
  • Number of comments
  • Number of likes
  • Link to icon
  • Image width and height
  • Link to avatar
  • Number of posts

Use Cases

  • Collecting posts by tags

Setup

Obtaining the required option for authorization

Spoiler: how to find cookie?

Go to any profile, having first opened the debug mode by pressing F12. Debug Using the string graphql/query ( (json type), look for the necessary request that stores the values for the scraper. Search Go to the request and copy the value from the cookie parameter. Values

Queries

Tags must be specified as queries, for example:

sport  
cpu

Result Output Options

A-Parser supports flexible results formatting thanks to the built-in templating engine Template Toolkit, which allows it to output results in arbitrary form, as well as in structured form, such as CSV or JSON

Default Output

Result format:

$query:\nPosts:\n$posts.format('$link\n')

Result example:

Posts:  
https://www.instagram.com/p/B0FtUJboZC0/
https://www.instagram.com/p/B0Fs7maCIvq/
https://www.instagram.com/p/B0FszBRgOoS/
https://www.instagram.com/p/B0FrgVTBgFI/
https://www.instagram.com/p/B0FqeKvBSjC/
https://www.instagram.com/p/B0FogPGnOIG/
https://www.instagram.com/p/B0FoHSuCSUr/
https://www.instagram.com/p/B0Fl5JWgWts/
https://www.instagram.com/p/B0Fj_P0ji83/
https://www.instagram.com/p/B0Fgn5YHCiC/
https://www.instagram.com/p/B0Fd4uvAOyf/
https://www.instagram.com/p/B0FdfGjnVVs/
https://www.instagram.com/p/B0FdLEDgrTe/
https://www.instagram.com/p/B0FdEORCa0Z/

Links to Top Posts

Result format:

$top.format('$link\n')

Result example:

https://www.instagram.com/p/CMMKTr4pi3o/
https://www.instagram.com/p/CMMKTCGHZ1c/
https://www.instagram.com/p/CMMKStkF59q/
https://www.instagram.com/p/CMMKRNun5Jg/
https://www.instagram.com/p/CMMKRI-JTp8/
https://www.instagram.com/p/CMMKQmfBD9O/
https://www.instagram.com/p/CMMKHsiF5GT/
https://www.instagram.com/p/CMMKQUpHXy4/
https://www.instagram.com/p/CMMKPL1HxTx/
https://www.instagram.com/p/CMMKOAkn1mP/

Possible Settings

ParameterDefault valueDescription
Count of pages with posts10Number of pages with posts
Treat disconnect as IP banTreat connection loss as IP ban