Instagram API: find posts by hashtag and read comments
To work from an Instagram hashtag to the conversation under a post, use three calls: list the newest posts for a hashtag and take a post's shortcode or link, read that post's detail, then read its first-level comments. Every step below is a real endpoint with real parameters.
A new account gets 50 trial calls; after that, successful calls are billed from a prepaid balance. See pricing.
From a hashtag to the comments in three calls
Replace travel in the examples with your hashtag, without the #. The shortcode in steps 2 and 3 is a placeholder: use a shortcode from the step 1 results, or from an Instagram share link. You need an API key, and a new account has 50 trial calls; once the trial calls are used, the Instagram endpoints are billed from your balance.
Find the newest posts for a hashtag
hashtag is given without the #. You get the newest posts carrying it, about 30 a page; each post's extra.shortcode and extra.url feed the later steps. To turn pages, pass back the previous page's cursor unchanged and stop when has_more is false. A hashtag nobody used answers empty.
Instagram hashtag posts
GET /v1/raw/instagram/hashtag_postscurl 'https://api.qovia.ai/v1/raw/instagram/hashtag_posts?hashtag=travel' \ -H "Authorization: Bearer $QOVIA_KEY"
import os import requests resp = requests.get( "https://api.qovia.ai/v1/raw/instagram/hashtag_posts", params={"hashtag": "travel"}, headers={"Authorization": f"Bearer {os.environ['QOVIA_KEY']}"}, timeout=30, ) resp.raise_for_status() body = resp.json() print(body["meta"]["charged_usd"], body["data"])
The data in the response. The sample comes from the endpoint catalog, not live data; lists are cut to their first two entries and picture links are left out:
{ "data": { "items": [ { "id": "soc_ins_e553866650de", "src": "social", "platform": "instagram", "lang": null, "text": "A operação começará em 15 de dezembro de 2027, com três voos semanais ✨. Confira mais no link da bio 🔗. #qatarairways✈️ #travel #explorepage #viagens #informaçao", "author": { "uid_hash": "b0d64510d3d2", "followers": null, "nickname": null, "uid": "70000000003", "username": null }, "metrics": { "likes": 0, "comments": 0 }, "extra": { "source_id": "4013029541808673639", "shortcode": "DexJRs4p5Nn", "published_at": "2026-10-21T19:22:27+00:00", "content_type": "image_post", "topic": "#qatarairways", "topics": [ "qatarairways", "travel", "explorepage", "viagens", "informaçao" ], "images": [ "https://scontent-cdg4-3.cdninstagram.com/v/t51.82787-15/862325060_17969227299194626_1865856716945445925_n.jpg?stp=dst-jpg_e35_p1080x1080_sh2.08_tt6&_nc_ht=scontent-cdg4-3.cdninstagram.com&_nc_cat=110&_nc_oc=Q6cZ2gFu66BjcgkXs06g_kLZSs1VgZr9JgkAe58tT7iSkO83az2T6VlkE9mvU1e4irp8-eY&_nc_ohc=pVziCq2jNiYQ7kNvwGHAGs9&_nc_gid=NpyjTo1tYiCXYX7t_Ah8HQ&edm=AA0rjkIBAAAA&ccb=7-5&ig_cache_key=NDAxMzAyOTU0MTgwODY3MzYzOQ%3D%3D.3-ccb7-5&oh=00_AQMFcTm3HBQhDIK992wWP88uVgF9WF7n3W1qBSoOqCCrjA&oe=6ADEEB6C&_nc_sid=49ed71" ], "video_dur_s": null, "location": null, "url": "https://www.instagram.com/p/DexJRs4p5Nn/" }, "prov": { "hash": "0x69439966f886432e", "ts": "2026-10-22T03:30:00+08:00", "source": "live" } }, { "id": "soc_ins_9e233058428f", "src": "social", "platform": "instagram", "lang": null, "text": "Ho Chi Minh City 🇻🇳\n\n#vietnam #travel #travelgram #traveling #asia", "author": { "uid_hash": "48f38f8bd1b9", "followers": null, "nickname": null, "uid": "70000000004", "username": null }, "metrics": { "likes": 0, "comments": 0 }, "extra": { "source_id": "4013029633108641592", "shortcode": "DexJTB6joc4", "published_at": "2026-10-21T19:20:33+00:00", "content_type": "carousel", "topic": "#vietnam", "topics": [ "vietnam", "travel", "travelgram", "traveling", "asia" ], "images": [], "video_dur_s": null, "location": null, "url": "https://www.instagram.com/p/DexJTB6joc4/" }, "prov": { "hash": "0xa5fd1bf8ffbdf901", "ts": "2026-10-22T03:30:00+08:00", "source": "live" } } ], "cursor": "QVFDOFBiU2ptS3k0bUVqMy1WR29XWjkxbzlpemx3ZjBtMjdF", "has_more": true, "total": 798248141, "prov": { "hash": "0x63da10b488f692b2", "ts": "2026-10-22T03:30:00+08:00", "source": "live" } } }Read the post detail
post takes the post's link (instagram.com/p/, /reel/ or /tv/) or the shortcode in it, which you can take from the previous step. You get caption, author, likes, comment count, video plays and more. EXAMPLE_shortcode in the example is only a placeholder; a post that does not exist or was deleted answers 404.
Instagram post detail
GET /v1/raw/instagram/postcurl 'https://api.qovia.ai/v1/raw/instagram/post?post=EXAMPLE_shortcode' \ -H "Authorization: Bearer $QOVIA_KEY"
Read the post's first-level comments
It takes the same post parameter; the shortcode in the example is still a placeholder. Comments come in Instagram's ranked order, about 15 a page; pass back the previous page's cursor unchanged to continue and stop when has_more is false. A post without comments answers empty. Replies to a comment come from raw.instagram.comment_replies.
Instagram post comments
GET /v1/raw/instagram/commentscurl 'https://api.qovia.ai/v1/raw/instagram/comments?post=EXAMPLE_shortcode' \ -H "Authorization: Bearer $QOVIA_KEY"
More endpoints for this
FAQ
Where does the shortcode come from?
From extra.shortcode in the hashtag results (raw.instagram.hashtag_posts); it is the part of a post link, instagram.com/p/<shortcode>/. You can also pass an Instagram share link as post directly.
How do I read replies to a comment?
The comments endpoint returns first-level comments only. Pass a comment's cid together with the post to raw.instagram.comment_replies; replies come about 8 a page and use the same cursor paging.
Can I start from a profile instead?
Yes. raw.instagram.user reads a profile by username and raw.instagram.user_posts lists that user's posts (pass either username or user_id); take a shortcode from there, then read the detail and comments.
How is it billed?
A new account gets 50 trial calls; after that, calls are billed from a prepaid balance, and only successful calls that return data are charged. Empty results and errors are not, and meta.charged_usd in each response says what the call cost. Each endpoint's price is in the API reference, and the plans are on the pricing page.
Your agent only knows what you give it
Give it Douyin, Xiaohongshu (RedNote), WeChat and product reviews: structured, per call, nothing charged for failures.