YepAPI
Instagram API

Hashtag Search

Get top and recent posts for an Instagram hashtag.

POST/v1/instagram/hashtag
$0.01/call

Usage

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

ParameterTypeRequiredDescriptionDefault
hashtagstringYesHashtag 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

FieldTypeDescription
okbooleanWhether the request succeeded
data.namestringHashtag name
data.media_countnumberTotal number of posts using this hashtag
data.top_postsobject[]Array of top/featured posts for this hashtag
data.top_posts[].idstringUnique post identifier
data.top_posts[].shortcodestringPost shortcode (used in URLs)
data.top_posts[].typestringPost type: GraphImage, GraphVideo, or GraphSidecar
data.top_posts[].captionstringPost caption text
data.top_posts[].like_countnumberNumber of likes
data.top_posts[].comment_countnumberNumber of comments
data.top_posts[].taken_atnumberUnix timestamp of when the post was published
data.top_posts[].display_urlstringFull-size image URL
data.top_posts[].ownerobjectPost author information
data.recent_postsobject[]Array of recent posts using this hashtag

On this page