Social media5 min readBy Purrkey teamUpdated

How to find top Instagram posts for a hashtag

Find the top engagement-ranked Instagram posts for a hashtag with likes, comments, views, captions, and permalinks

On this page

You have 10 shortlist slots to fill from the top engagement-ranked Instagram posts on #skincare before a content sprint. Pull the top posts for the tag, read likes, comments, views and captions, then choose 10 returned posts to study. The table below is the deliverable: one row per returned post with username, caption, likes, comments, views, createdUtc and url. No run has been executed for this article, so the table is a design and the values are placeholders showing the shape

Example input and shortlist table

The tool takes one required field, hashtag, and the value goes in without the # at the start. The Example value is skincare, taken from the brief for a content sprint. Replace it with the tag from your campaign brief

FieldExample valueNote
hashtagskincareNo # at the start
cursoromittedComes from data.nextCursor when paging
requireFieldsomittedOmit for cheapest routing

The shortlist table has one row per post. Values here are placeholders showing the shape

usernamecaptionlikescommentsviewscreatedUtcurl
(post username)(caption text)(count or empty)(count)(count or empty)(Unix seconds)(permalink)

createdUtc is a UTC epoch timestamp in seconds; multiply it by 1000 for a JS Date in milliseconds

Pull the top posts for one hashtag

Call anyapi.instagram.hashtag_top_posts with hashtag set to skincare. Agents call it through POST /v1/runs with toolId anyapi.instagram.hashtag_top_posts. Omit requireFields for cheapest routing. Naming fields can raise the price when the cheapest source cannot return a named field, because a dearer source serves and you are quoted and charged its price

Top-ranked posts are ordered by Instagram's engagement model rather than by time. To continue, pass data.nextCursor back as cursor; nextCursor is null when the lane has no more posts. For a chronological feed, see the latest Instagram posts for a hashtag

The catalog describes the result as Reels-heavy and engagement-ranked, so it answers what is performing on a tag right now. It reads Instagram's own top-ranked posts from its live hashtag feed rather than from a web search index. That makes it a format and creator shortlist input, not a date-ordered archive

Read the fields that drive the shortlist

Check found first. When found is false, reason is not_found; the contract calls that a successful call, not an error. When found is true, read data.posts and data.nextCursor

Use these fields for the shortlist:

  • username: the account that posted
  • caption: the caption text, including its hashtags
  • likes: like count, absent when the account hides it
  • comments: comment count
  • views: play count, present on video posts
  • createdUtc: UTC epoch seconds
  • url: canonical permalink to the post

The format check uses fields outside the seven-column table. media items have type as photo or video, with url as the image or cover frame and videoUrl for a video item. durationSeconds appears on video posts. productType gives Instagram's surface label such as feed, clips or carousel_container. soundTitle names the sound, and Original audio means the creator's own audio rather than a licensed track. paidPartnership marks a paid partnership when the source reports it

A missing likes or views value does not mean zero. It means the field is absent, so leave the cell empty and shortlist from the fields that are present

The agent prompt

Agent prompt
Set up https://purrkey.app/SKILL.md, then use Purrkey to pull top Instagram posts for the hashtag skincare and return a shortlist table. Check the current inputs and price of anyapi.instagram.hashtag_top_posts before running anything. Pass hashtag as skincare without the # at the start. Omit requireFields. Start with one call. If you have fewer than 10 posts and data.nextCursor is not null, pass it as cursor and call again until you have 10 rows or the cursor is null. Return a table with username, caption, likes, comments, views, createdUtc and url. Leave a cell empty where likes or views are absent. Do not invent posts.

The prompt asks for 10 rows because the shortlist has 10 slots. If the first page fills 10 rows, stop. If it does not, page with data.nextCursor. The example hashtag is a stand-in; swap in your campaign tag before the run

Estimated tool cost

Prices from the Purrkey catalog, read November 13, 2026. The catalog lists the unit as max_call: Maximum per call. Successful runs settle at the actual AnyAPI charge

StepFormulaUnit pricePlanned quantityTotal
Single hashtag pullcalls x max priceup to $0.018 per call1 callup to $0.018
Three-page scancalls x max priceup to $0.018 per call3 callsup to $0.054

The totals are ceilings, not settled charges. Model fees for the agent are not counted

Run the hashtag pull

Open the Instagram hashtag top posts tool and run anyapi.instagram.hashtag_top_posts with your campaign hashtag. Start with one call, then page with data.nextCursor if the shortlist needs more rows

Get started by giving this to your agent

  • Claude Code
  • Codex
  • Gemini CLI
  • Cursor
  • GitHub Copilot
Set up https://purrkey.app/SKILL.md, then use Purrkey to show me what I can do with Instagram.
Explore Instagram tools and pricing

FAQ

How do I find the top Instagram posts for a hashtag?

Call anyapi.instagram.hashtag_top_posts with the hashtag and no # at the start. The response returns Instagram's top-ranked posts for that hashtag in data.posts.

What input does anyapi.instagram.hashtag_top_posts take?

It requires hashtag without the # at the start. cursor is optional and comes from data.nextCursor, and requireFields is optional and omitted for cheapest routing.

Which output fields should I use to compare posts?

Use username, caption, likes, comments, views, createdUtc and url for the shortlist table. The response also has media type, productType, durationSeconds, soundTitle and paidPartnership for format checks.

How does paging work for top hashtag posts?

Top-ranked posts are ordered by Instagram's engagement model rather than by time. Pass data.nextCursor back as cursor to continue to the next page.

How much does it cost to pull top posts for one hashtag?

The catalog lists anyapi.instagram.hashtag_top_posts at up to $0.018 per call. A single pull is 1 call and a three-page scan is 3 calls, at most $0.018 and $0.054 before model fees.

What happens when the hashtag has no result?

The response has found false and reason not_found. That is a successful call, not an error.

Why are likes or views missing from a hashtag post?

likes is absent when the account hides it, and views appears on video posts. Leave the cell empty in the shortlist table when a field is absent.

Next step

Try this with Instagram

The tool directory lists every endpoint with its current price. Inspect the inputs there, then let your agent run a small batch before scaling up.

See Instagram tools

Share this article