Hashtag API

Instagram Hashtag API

Search Instagram hashtags programmatically, then retrieve top public media for a selected hashtag through an Instagram-specific API.

Get Free API Key →

Get Instagram Hashtag Data in One API Call

Pass a query to find matching hashtags, then use a hashtag name to retrieve top public posts tagged with it.

Code Examples

# 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());

Example API Response

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://..."
  }
]

What You Can Do with Hashtag Data

Hashtag Fields Returned

id

Numeric hashtag ID

name

Hashtag name (without #)

media_count

Total posts using this hashtag

profile_pic_url

Hashtag image URL when supplied

Simple, Credit-Based Pricing

API usage is charged in credits, and endpoint costs are listed in the API docs. Credits never expire.

Free
100 credits
$29
15,400 credits
$300
320,000 credits

Frequently Asked Questions

How do I search Instagram hashtags via API?

Use GramScraper's /v1/search/hashtags endpoint. Pass a query parameter and receive matching hashtag data in JSON.

What data does the hashtag API return?

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.

Can I get top posts for a hashtag?

Yes. Use /v1/hashtag/medias/top/chunk with the hashtag name to retrieve top publicly available posts.

Start Analyzing Instagram Hashtags

Start with 100 free credits. Standard adds 15,400 credits for $29.

Get Free API Key →