Use case

Track a brand or campaign hashtag on Instagram

Get Instagram hashtag posts and reels as JSON, with caption, likes, comments and author, to track a campaign, find user content and watch a niche.

Prepaid, no subscriptionREST or MCPOne key for models, data and agents
Instagramlovelyjsonitems[0]"caption": "Sunday ritual #espres…"likes": 812"comments": 27"author": "beanbrothers""media": "image""tag": "espresso"

You launched a campaign hashtag and want to know who is using it, how well those posts perform, and which ones you can reshare. Searching the tag in the app shows a few posts and no totals. Lovely Router pulls them in bulk. Send hashtag pages, get one JSON object per post, pay per post from a prepaid balance. Call it from a campaign report, a script or an AI agent with one API key. Profile and comment data can identify people, so you are responsible for using it lawfully, including privacy and anti-spam rules.

Hand it to your AI agent

Copy this prompt into Claude Code, Cursor, Codex or any coding agent. It tells the agent where the docs are and how to use your API key.

Track a brand or campaign hashtag on Instagram. Use the Lovely Router data tools: each returns JSON and is billed per result.

- Docs (read first): https://lovelyrouter.com/docs/tools/find.md and https://lovelyrouter.com/docs/tools/run.md
- Plan first: POST https://lovelyrouter.com/v1/tools/suggest with `{"task": "<my task in plain words>"}` (free). It returns the tools to run in order, each with an example `input`, the `input_required` fields, an estimated cost and a ready-made `run` request. Replace the example values with my task's; if a field is unclear, read the tool with GET https://lovelyrouter.com/v1/tools/<id>. To browse instead, POST https://lovelyrouter.com/v1/tools/discover searches the catalog.
- Show me the plan and its estimated cost (`total_est_cost_usd`) before running anything large.
- Run: POST https://lovelyrouter.com/v1/tools/<id>/run with `{"input": {...}, "max_results": N}`. A 200 has the finished run with `items`; a 202 means it is still running, so poll the `poll` path until `status` is `succeeded`, `failed`, `timed_out` or `stopped`.
- Only delivered results are billed. Keep max_results small on the first run, check the output, then scale up.
- If you support MCP, connect https://lovelyrouter.com/mcp instead (Streamable HTTP, same key; https://lovelyrouter.com/docs/tools/mcp.md) and use suggest_tools, get_tool and run_tool.
- Auth: read my API key from the LOVELY_API_KEY environment variable and send it as `Authorization: Bearer $LOVELY_API_KEY`. Never print or commit the key. If it is not set, ask me to create one at https://lovelyrouter.com/app/keys.
- Billing is prepaid: every call is charged to my balance, so test with a small request before running anything large.
- Every docs page is plain Markdown; the full index is https://lovelyrouter.com/llms.txt.

My task: <the inputs (links, keywords or accounts) and how many results you need>
01

How it works

010203
  1. List the hashtags

    Your campaign tag, your brand tag, and the tags of your niche.

  2. Run the tool with a cap

    Send hashtag page URLs in startUrls to POST /v1/tools/instagram-hashtag/run, with maxItems in input as the cap. Use until to keep posts newer than a date.

  3. Rank and follow up

    Sort by likes and comments, shortlist the best posts, and credit or ask permission before you reshare.

02

Get hashtag posts with one request

Instagram hashtag posts takes hashtag pages in startUrls, which return the newest posts. keywords searches words instead of a tag and returns popular reels, and getReels switches the hashtag run to reels only:

curl https://lovelyrouter.com/v1/tools/instagram-hashtag/run \
  -H "Authorization: Bearer $LOVELY_API_KEY" \
  -H "content-type: application/json" \
  -d '{
    "input": {
      "startUrls": [
        "https://www.instagram.com/explore/tags/espresso/"
      ],
      "until": "2026-10-01",
      "maxItems": 50
    },
    "max_results": 50
  }'

Each post carries its caption, likes, comments, author and media. A run still going after 60 seconds returns 202; Run a tool shows how to poll.

03

What each post holds

Field groupWhat you get
ContentCaption
EngagementLikes and comments
AuthorWho posted it
MediaImage or video of the post
04

Recipes

Report on a campaign

Pull the newest 200 posts under your tag every Monday. Count posts, sum likes and comments, and list the top five.

Find user-generated content

Sort tag posts by likes, then ask the authors for permission to reshare the best ones.

Spot who talks about your niche

Group results by author and list the accounts that post under your category tags most often.

Watch popular reels for a keyword

Pass keywords instead of a tag to see the popular reels for a topic you plan content around.

Read the language of a niche

Send captions to a model to pull out the phrases and hashtags that appear together.

Prefer plain words? Connect the MCP server and tell Claude Code or Cursor: "Pull the 100 newest Instagram posts for the hashtag #espresso, rank them by likes and list the top ten with author and caption. Set maxItems and max_results to 100."

06

What you pay

You pay per post: starting a run holds its maximum cost, the per-call fee plus the per-post fee times max_results, and the run settles to what it returned. The rest of the hold goes back to your balance. A run that fails or times out pays only for the posts it delivered, and a run refused at the start costs nothing.

Tracking 3 tags with 100 posts each is billed as 300 posts. There is no subscription and no monthly minimum: top up from $5, and one balance pays for tools and models. The card above shows today's price; pricing lists every tool.

07

Frequently asked questions

?
Do I get the newest or the top posts?+

A hashtag page returns the newest posts. Search words in keywords return popular reels instead.

Can I get only posts after a date?+

Yes. Set until and only newer posts are returned.

Can I get reels from a hashtag?+

Yes. Set getReels to true for reels only.

How many posts can one run return?+

Up to 500, set with maxItems in input.

Do I need a subscription?+

No. You add credit to a prepaid balance and each run draws it down. Failed runs pay only for the results they delivered, and nothing renews automatically.

Planning the whole campaign? See social listening, influencer research and the tool catalog.

One prepaid key for models, data and agents

No subscription. Top up, use what you need, see every charge in your logs.