Instagram API
Hashtag Search
Get top and recent posts for an Instagram hashtag.
POST
$0.01/call/v1/instagram/hashtagUsage
const res = await fetch('https://api.yepapi.com/v1/instagram/hashtag', {
method: 'POST',
headers: {
'x-api-key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({ hashtag: 'travelphotography' }),
});
const { data } = await res.json();
console.log(data);curl -X POST https://api.yepapi.com/v1/instagram/hashtag \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"hashtag": "travelphotography"}'Request Body
| Parameter | Type | Required | Description | Default |
|---|---|---|---|---|
hashtag | string | Yes | Hashtag name (without #) | — |
Response
{
"ok": true,
"data": {
"name": "travelphotography",
"media_count": 189000000,
"top_posts": [
{
"id": "3456789012345678901",
"shortcode": "C5xAbCdEfGh",
"type": "GraphImage",
"caption": "Sunset in Santorini #travelphotography",
"like_count": 890000,
"comment_count": 4500,
"taken_at": 1712345678,
"display_url": "https://scontent.cdninstagram.com/...",
"is_video": false,
"owner": {
"username": "travel_photographer",
"profile_pic_url": "https://scontent.cdninstagram.com/..."
}
}
],
"recent_posts": [
{
"id": "3456789012345678902",
"shortcode": "C5yBcDeFgHi",
"type": "GraphImage",
"like_count": 1200,
"comment_count": 45,
"taken_at": 1712678901,
"display_url": "https://scontent.cdninstagram.com/...",
"is_video": false
}
]
}
}Response Fields
| Field | Type | Description |
|---|---|---|
ok | boolean | Whether the request succeeded |
data.name | string | Hashtag name |
data.media_count | number | Total number of posts using this hashtag |
data.top_posts | object[] | Array of top/featured posts for this hashtag |
data.top_posts[].id | string | Unique post identifier |
data.top_posts[].shortcode | string | Post shortcode (used in URLs) |
data.top_posts[].type | string | Post type: GraphImage, GraphVideo, or GraphSidecar |
data.top_posts[].caption | string | Post caption text |
data.top_posts[].like_count | number | Number of likes |
data.top_posts[].comment_count | number | Number of comments |
data.top_posts[].taken_at | number | Unix timestamp of when the post was published |
data.top_posts[].display_url | string | Full-size image URL |
data.top_posts[].owner | object | Post author information |
data.recent_posts | object[] | Array of recent posts using this hashtag |