GET /v1/instagram/popular_search
Instagram keyword search API: top posts and related keywords
Returns Instagram's search page for one keyword as Keyword: a description with its sources, related keywords and the top posts. Send the keyword; media_count and related_keywords_count ask for more. Page through more posts with the keyword posts API.
- Price
- $0.0005 per call
- Batch
- Yes, through /v1/batch
- Failed calls
- Not charged
Example request
curl
curl 'https://api.virev.ai/v1/instagram/popular_search?keyword=holafly&media_count=24&related_keywords_count=100' \
-H "Authorization: Bearer $VIREV_API_KEY"python
import os
import requests
response = requests.request(
"GET",
"https://api.virev.ai/v1/instagram/popular_search",
params={
"keyword": "holafly",
"media_count": "24",
"related_keywords_count": "100",
},
headers={"Authorization": f"Bearer {os.environ['VIREV_API_KEY']}"},
timeout=60,
)
response.raise_for_status()
print(response.json())Parameters
| Name | In | Type | Description |
|---|---|---|---|
keyword required | query | string | Search keyword. |
media_count | query | integer | Native list size, a positive integer. Instagram controls the returned count. Defaults to 24 when omitted; omission is forwarded unchanged. |
related_keywords_count | query | integer | Native list size, a positive integer. Instagram controls the returned count. Defaults to 100 when omitted; omission is forwarded unchanged. |
cached | query | auto | cache_only | live | auto (default) serves a read saved within the last 24 hours for these exact arguments, otherwise fetches. cache_only never contacts Instagram (404 not_cached when nothing is saved, whatever its age). live always fetches. Anything else is a 400. A saved read is an earlier answer of this operation for the same arguments; an account in the profile library (/v1/instagram/profile) is not one until this operation has read it. |
get_raw | query | boolean | true returns the upstream JSON exactly as Instagram answered it instead of the normalized Keyword. |
Example response
The example response of the API reference.
json
{
"data": {
"keyword": "holafly",
"description": "Holafly is an eSIM provider.",
"description_sources": [
"https://holafly.com"
],
"related": [
"esim",
"travel sim"
],
"posts": [
{
"id": "3700000000000000021",
"shortcode": "DpS1",
"taken_at": null,
"kind": "video",
"product_type": null,
"caption": "holafly esim",
"hashtags": [],
"mentions": [],
"accessibility_caption": null,
"likes": null,
"comments": null,
"views": 4321,
"counts_hidden": null,
"comments_disabled": null,
"is_pinned": null,
"is_paid_partnership": null,
"owner": {
"id": "555",
"username": "traveler",
"full_name": null,
"is_verified": false,
"is_private": null,
"avatar_url": "https://scontent.cdninstagram.com/t.jpg",
"latest_story_at": null,
"extra": {}
},
"coauthors": [],
"sponsors": [],
"tagged": [],
"location": null,
"audio": null,
"thumbnail_url": "https://scontent.cdninstagram.com/p1.jpg",
"video_duration": null,
"media": [
{
"kind": "video",
"url": "https://scontent.cdninstagram.com/p1.mp4",
"width": null,
"height": null,
"duration": null
}
],
"media_urls": [
"https://scontent.cdninstagram.com/p1.mp4"
],
"extra": {}
}
]
},
"meta": {
"source": "live",
"fetched_at": "2026-09-09T03:10:22Z",
"cost": "$0.0005",
"balance": "$0.3777",
"request_id": "req_f1abb41157ca15c565d48a90bacef554"
}
}How it works
Wraps doc_id PolarisLoggedOutPopularSearchPageQuery (media_count, related_keywords_count). Returns Keyword under data; with get_raw=true returns the upstream JSON.
Unknown, unsupported, and repeated query parameters return 400 before acquisition or billing.
The example response is the crawler's own projection of a synthetic upstream document into Keyword, not a live capture.
Errors
| Status | When |
|---|---|
400 | The request parameters are invalid. |
401 | Missing, malformed, or revoked API key. |
402 | Balance is too low for this request. |
403 | Instagram does not show this account to logged-out readers: it is private, hidden or restricted, or it no longer exists. Retrying will not change the answer until the account changes. You are not charged. |
404 | cached=cache_only found nothing saved for these arguments (not_cached; call again with cached=auto to fetch it), or the account, post, highlight, or location does not exist (not_found). |
429 | Over the per-minute limit. The limit belongs to your organization and all its API keys share it: 100 requests per minute unless an increase was granted. Wait for the Retry-After seconds, then retry. On a live read, code rate_limited means the platform itself rate-limited this read; retry after the Retry-After seconds. You are not charged. |
502 | The upstream fetch failed. You are not charged. |
503 | Billing could not be confirmed, so no upstream data was returned. |
504 | The upstream request timed out. You are not charged. |