Instagram posts by hashtag API
  1. Docs
  2. Instagram
  3. Instagram posts by hashtag API

Instagram posts by hashtag API

Public posts and reels for an exact hashtag that a web search has indexed (DuckDuckGo's results, not Google's), best effort and not a complete hashtag f...

GET /v1/instagram/search/hashtag

GET /v1/instagram/search/hashtag

Public posts and reels for an exact hashtag that a web search has indexed (DuckDuckGo's results, not Google's), best effort and not a complete hashtag feed. The cursor is the next results page and cannot go past 11. Each result is read through the Instagram post endpoint for caption, author, media and counts (enrich, on by default; a post that no longer exists is dropped). date_posted takes day, week, month or year. When the search provider asks for human verification on every try the call fails and can be retried.

  • Cost: 1 credit
  • Cache: Results are kept up to 30 days; send max_age_days to reuse them for free.
  • Timeout: A request still running after about 25 seconds answers 202 with a job to poll (Batch and jobs).

Parameters#

NameTypeRequiredDescription
hashtagstringyesThe hashtag, with or without #.
date_postedstringnoOnly posts found in this window. One of day, week, month, year. Also accepted values: last-hour for hour, last-day for day, last-week for week, last-month for month, last-year for year.
media_typestringnoPosts and reels, or reels only. One of all, reels.
enrichbooleannoRead each post for its full caption, author, media and counts (on by default). Off returns only what the search result states, much cheaper and faster. Default true.

Every request also accepts:

  • cursor: the cursor from the previous page (Pagination).
  • trim: true for a smaller response without null fields and extra.
  • raw: true to also get the platform's original object as raw.
  • max_age_days: accept a cached result up to this many days old, for 0 credits (Caching).

Example request#

Set your key in the environment first (see Authentication).

1curl -G "https://api.socialscrape.dev/v1/instagram/search/hashtag" \2  -H "x-api-key: $SOCIALSCRAPE_API_KEY" \3  --data-urlencode "hashtag=baking" \4  --data-urlencode "enrich=false"

Example response#

This is a sample from a recorded response, lists and long text are shortened. Status 200.

200 OKSample response
1{2  "ok": true,3  "credits_charged": 1,4  "credits_remaining": 4999,5  "cached": false,6  "cached_at": null,7  "request_id": "req_99548bd2a3acef13ccfc047c",8  "data": {9    "object": "list",10    "items": [11      {12        "object": "post",13        "platform": "instagram",14        "id": "De1XqvcOC4p",15        "url": "https://www.instagram.com/reel/De1XqvcOC4p/",16        "type": "reel",17        "author": {18          "id": null,19          "handle": "sweetcrumbl.co",20          "name": "SweetCrumbl",21          "url": "https://www.instagram.com/sweetcrumbl.co/",22          "avatar_url": null,23          "verified": null24        },25        "title": null,26        "text": "Reappearing on your feed, mine's on the reel cover😭 #baking #handmade #aesthetic #pinterest",27        "published_at": "2026-10-23T00:00:00Z",28        "duration_seconds": null,29        "language": null,30        "hashtags": null,31        "mentions": null,32        "stats": {33          "views": null,34          "likes": 153000,35          "comments": 1974,36          "shares": null,37          "saves": null,38          "dislikes": null39        },40        "media": {41          "thumbnail_url": null,42          "video_url": null,43          "audio_url": null,44          "image_urls": null,45          "width": null,46          "height": null47        },48        "song": null,49        "location": null,50        "is_pinned": null,51        "is_sponsored": null,52        "extra": {53          "enriched": false,54          "hashtag": "baking",55          "search_position": 1,56          "source": "duckduckgo",57          "stats_approximate": [58            "likes"59          ]60        }61      },62      {63        "object": "post",64        "platform": "instagram",65        "id": "Da0e-5GSRVi",66        "url": "https://www.instagram.com/reel/Da0e-5GSRVi/",67        "type": "reel",68        "author": {69          "id": null,70          "handle": "craftsbyreemm",71          "name": null,72          "url": "https://www.instagram.com/craftsbyreemm/",73          "avatar_url": null,74          "verified": null75        },76        "title": null,77        "text": "Biggest supporters lol #foryou #foryoupage #baking",78        "published_at": "2026-07-15T00:00:00Z",79        "duration_seconds": null,80        "language": null,81        "hashtags": null,82        "mentions": null,83        "stats": {84          "views": null,85          "likes": 242000,86          "comments": 778,87          "shares": null,88          "saves": null,89          "dislikes": null90        },91        "media": {92          "thumbnail_url": null,93          "video_url": null,94          "audio_url": null,95          "image_urls": null,96          "width": null,97          "height": null98        },99        "song": null,100        "location": null,101        "is_pinned": null,102        "is_sponsored": null,103        "extra": {104          "enriched": false,105          "hashtag": "baking",106          "search_position": 2,107          "source": "duckduckgo",108          "stats_approximate": [109            "likes"110          ]111        }112      }113    ],114    "cursor": "eyJwIjoyLCJmIjp7InEiOiIoc2l0ZTppbnN0YWdyYW0uY29tL3AgT1Igc2l0ZTppbnN0YWdyYW0uY29tL3JlZWwpIFwiI2Jha2luZ1wiIiwicyI6IjEwIiwibmV4dFBhcmFtcyI6IiIsInYiOiJsIiwibyI6Impzb24iLCJkYyI6IjEwIiwiYXBpIjoiZC5qcyIsInZxZCI6IjQtMjY4Mzc1NDQ2NzYzMzkxMjgzMDA0ODgy...",115    "has_more": true,116    "parent": null117  },118  "cursor": "eyJwIjoyLCJmIjp7InEiOiIoc2l0ZTppbnN0YWdyYW0uY29tL3AgT1Igc2l0ZTppbnN0YWdyYW0uY29tL3JlZWwpIFwiI2Jha2luZ1wiIiwicyI6IjEwIiwibmV4dFBhcmFtcyI6IiIsInYiOiJsIiwibyI6Impzb24iLCJkYyI6IjEwIiwiYXBpIjoiZC5qcyIsInZxZCI6IjQtMjY4Mzc1NDQ2NzYzMzkxMjgzMDA0ODgy...",119  "has_more": true120}

Response#

A list of Post objects in data.items, with data.cursor and data.has_more.

See Data models for every field. The envelope around data is described in Responses.

Errors#

Failures are free: credits_charged is 0. Branch on error.code, never on the message.

CodeHTTPRetryMeaning
invalid_params400noA parameter is missing, unknown or has the wrong type.
not_found404noThe platform says this profile, post or item does not exist.
upstream_blocked503yesThe platform blocked this fetch; retry (a fresh exit is used).

Every request can also fail with the account and platform errors listed on the Errors page.

Example error:

1{2  "ok": false,3  "error": {4    "code": "upstream_blocked",5    "message": "The platform blocked this fetch; retry (a fresh exit is used).",6    "retryable": true7  },8  "credits_charged": 0,9  "request_id": "req_c29449962a4e626f2ece60ba"10}