Portal Community
Algorithmic selection: Unlike hashtag/getRecentMedia which returns posts in chronological order, getTopMedia returns posts Instagram considers most engaging and relevant. Results change as Instagram's algorithm re-ranks posts. Use both together for comprehensive hashtag coverage.

When to Use

Configuration

Connection

FieldRequiredDescription
accessTokenRequiredLong-lived Instagram access token stored in BizFirst Credentials Manager.
igUserIdRequiredYour Instagram Business/Creator account ID. Required by the Graph API.

Operation

FieldRequiredDescription
resourceRequiredMust be ig-hashtag.
operationRequiredMust be get-top-media.
hashtagIdRequiredHashtag ID from hashtag/get.
limitOptionalItems per page. Default 25. Instagram returns at most 10 results per call regardless.
afterOptionalPagination cursor from previous page's paging.after.

Sample Configuration JSON

{
  "resource": "ig-hashtag",
  "operation": "get-top-media",
  "accessToken": "{{ $credential.instagram.accessToken }}",
  "igUserId": "17841400000000000",
  "hashtagId": "{{ $db.hashtagCache.where(name='sustainablefashion').hashtagId }}"
}

Validation Errors

ErrorCause
accessToken is requiredaccessToken field is missing or empty.
igUserId is requiredigUserId field is missing or empty.
hashtagId is requiredhashtagId field is missing or empty.

Output

Success Port

FieldTypeDescription
statusstring"success"
hashtagIdstringThe queried hashtag ID.
mediaarrayArray of top media objects. Max 10 per page.
paging.beforestringCursor for previous page.
paging.afterstringCursor for next page. Empty on last page.
paging.nextUrlstringFull Graph API URL for next page.
payloadstringRaw JSON response.

Error Port

FieldTypeDescription
statusstring"error"
errorCodestringGraph API error code.
errorMessagestringError description.
payloadstringRaw error response.

Sample Output JSON

{
  "status": "success",
  "hashtagId": "17843819102081146",
  "media": [
    {
      "id": "17855590000000030",
      "caption": "Our most engaged post this season! #sustainablefashion #ecolife",
      "media_type": "CAROUSEL_ALBUM",
      "permalink": "https://www.instagram.com/p/EFGH5678/"
    }
  ],
  "paging": {
    "before": "",
    "after": "QVFIUm...",
    "nextUrl": "https://graph.facebook.com/v18.0/..."
  }
}

Expression Reference

ExpressionValue
{{ $output.instagram.media }}Array of top media items
{{ $output.instagram.media[0].id }}Top post media ID
{{ $output.instagram.media[0].caption }}Top post caption
{{ $output.instagram.media[0].permalink }}Top post public URL

Node Policies & GuardRails

Examples

Weekly content inspiration digest

{
  "resource": "ig-hashtag",
  "operation": "get-top-media",
  "accessToken": "{{ $credential.instagram.accessToken }}",
  "igUserId": "{{ $env.IG_USER_ID }}",
  "hashtagId": "{{ $loop.current.hashtagId }}"
}

Run weekly, iterating over 5 industry hashtag IDs. Results from each hashtag are merged into a curated list and formatted into a Slack message or internal email digest for the content team.

Competitive top content benchmark

{
  "resource": "ig-hashtag",
  "operation": "get-top-media",
  "accessToken": "{{ $credential.instagram.accessToken }}",
  "igUserId": "17841400000000000",
  "hashtagId": "{{ $env.COMPETITOR_HASHTAG_ID }}"
}

Fetches the algorithmically top posts for a competitor's brand hashtag. The next node extracts permalink and caption from each item and stores them in a competitive intelligence database for trend analysis.