Instagram popular search API
Instagram’s own topic page: top posts, summary and related searches.
GET /v1/instagram/search/popularBeta1 credit per callRefunded on failureimport os, requests
res = requests.get(
"https://api.groundsocial.dev/v1/instagram/search/popular?query=basketball",
headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"},
)
res.raise_for_status()
data = res.json()Response
200 · 1 credit{ "query": "basketball", "slug": "basketball", "description": "Basketball is a team sport played by two teams of five players on a rectangular court. The goal is to shoot the ball thr…", "related_keywords": [ "the tallest basketball player", "dylan schmidt illinois basketball", "… 8 more" ], "items": [ { "pk": "3738278218404085157", "id": "3738278218404085157_59411821286", "code": "DPhCDu_jj2l", "url": "https://www.instagram.com/p/DPhCDu_jj2l/", "taken_at": 1759857516, "media_type": 1, "product_type": null, "caption": { "text": "These moves will make you SHIFTY. 🤝🎒 #basketball #sports #athlete #nba #hooper #trending #reels #viral #explore #explore…" }, "like_count": null, "comment_count": null, "like_and_view_counts_disabled": false, "user": { "pk": "59411821286", "username": "woahhelijah", "profile_pic_url": "https://scontent-lax3-1.cdninstagram.com/v/t51.82787-19/610894561_17974982900981287_5001518987003621074_n.jpg?stp=dst-jp…", "is_verified": true }, "play_count": 714888, "image_versions2": { "candidates": [ { "url": "https://scontent-lax7-1.cdninstagram.com/v/t51.82787-15/561460207_17965312502981287_577210961086174914_n.jpg?stp=dst-jpg…", "width": null, "height": null } ] }, "video_versions": [ { "url": "https://scontent-lax3-2.cdninstagram.com/o1/v/t2/f2/m86/AQOL5CzApQ4By69Qu9wJuwXCS4kObfMwME4ecezKH0gC6Yg5MQjOpO8oXtg2SYFU…", "width": null, "height": null }, { "url": "https://scontent-lax3-2.cdninstagram.com/o1/v/t2/f2/m86/AQOL5CzApQ4By69Qu9wJuwXCS4kObfMwME4ecezKH0gC6Yg5MQjOpO8oXtg2SYFU…", "width": null, "height": null }, "… 1 more" ] }, { "pk": "3983670629257431716", "id": "3983670629257431716_61085633952", "code": "DdI11S3C8qk", "url": "https://www.instagram.com/p/DdI11S3C8qk/", "taken_at": 1789110607, "media_type": 1, "product_type": null, "caption": { "text": "The kind of peace you can’t buy ♱\n\nHooping my way through life, follow my journey, same court tomorrow ♱\n\n#hoops #hooper…" }, "like_count": null, "comment_count": null, "like_and_view_counts_disabled": false, "user": { "pk": "61085633952", "username": "jmilyone", "profile_pic_url": "https://scontent-lax3-1.cdninstagram.com/v/t51.82787-19/837858166_17997172263033953_8502340270251305704_n.jpg?stp=dst-jp…", "is_verified": false }, "play_count": 837519, "image_versions2": { "candidates": [ { "url": "https://scontent-lax3-2.cdninstagram.com/v/t51.82787-15/930123953_18004943484033953_4777618756943601532_n.jpg?stp=dst-jp…", "width": null, "height": null } ] }, "video_versions": [ { "url": "https://scontent-lax3-2.cdninstagram.com/o1/v/t2/f2/m86/AQMEEWQBr8hl9Qvxj2Vph7WrM4f2Pu9c5_wW-Plfs1q7JtUOxtQBK-NP5E7IDysL…", "width": null, "height": null }, { "url": "https://scontent-lax3-2.cdninstagram.com/o1/v/t2/f2/m86/AQMEEWQBr8hl9Qvxj2Vph7WrM4f2Pu9c5_wW-Plfs1q7JtUOxtQBK-NP5E7IDysL…", "width": null, "height": null }, "… 1 more" ] }, "… 22 more" ]}Parameters
| Name | Type | Description |
|---|---|---|
queryquery · required | string | Topic. Example: basketball. |
Response fields
200 with a InstagramPopularSearch, in the shape of Instagram’s own media and user objects.
| Field | Type | Description |
|---|---|---|
query | string | |
slug | string | The keyword page: instagram.com/popular/<slug>/. |
description | string | null | The summary Instagram shows on the keyword page, when it has one. |
related_keywords | string[] | |
items | InstagramMedia[] |
Status codes
| Status | Meaning |
|---|---|
200 | The topic page. |
400 | Invalid input. Nothing was charged. |
401 | Missing or invalid API key. |
402 | Not enough credits, a spend cap was reached, or payment is required. |
403 | The target is private, or the account is suspended. |
404 | The account or post does not exist, or was removed. |
429 | Too many requests. Wait for Retry-After seconds. |
503 | Instagram is temporarily unavailable. Retryable; nothing was charged. |
Every error has code, message, hint and retryable. All error codes
Instagram is a trademark of Instagram, LLC (Meta Platforms, Inc.). We are not affiliated with or endorsed by Instagram or Meta.