Search Instagram hashtags programmatically, then retrieve top public media for a selected hashtag through an Instagram-specific API.
Get Free API Key →Pass a query to find matching hashtags, then use a hashtag name to retrieve top public posts tagged with it.
# Search for a hashtag and get metadata curl -H 'Authorization: Bearer gs_your_api_key' \ 'https://gramscraper.com/api/instagram/v1/search/hashtags?query=travel'
import requests url = "https://gramscraper.com/api/instagram/v1/search/hashtags" headers = {"Authorization": "Bearer gs_your_api_key"} params = {"query": "travel"} response = requests.get(url, headers=headers, params=params) response.raise_for_status() print(response.json())
const response = await fetch( 'https://gramscraper.com/api/instagram/v1/search/hashtags?query=travel', { headers: { 'Authorization': 'Bearer gs_your_api_key' } } ); if (!response.ok) throw new Error(`HTTP ${response.status}`); console.log(await response.json());
The search endpoint returns a JSON array of matching hashtags. This abbreviated example shows the documented field structure; values depend on the query.
[
{
"id": "...",
"name": "travel",
"media_count": 123456,
"allow_following": true,
"profile_pic_url": "https://..."
}
]
id
Numeric hashtag ID
name
Hashtag name (without #)
media_count
Total posts using this hashtag
profile_pic_url
Hashtag image URL when supplied
Use GramScraper's /v1/search/hashtags endpoint. Pass a query parameter and receive matching hashtag data in JSON.
The search response includes fields supplied for matching hashtags, such as names and identifiers. See the API docs and inspect the live response for the current schema.
Yes. Use /v1/hashtag/medias/top/chunk with the hashtag name to retrieve top publicly available posts.
Start with 100 free credits. Standard adds 15,400 credits for $29.
Get Free API Key →