---
title: "Search Instagram for the posts under a hashtag"
method: GET
path: "/search/instagram-hashtag"
tags: ["Search"]
---

# Search Instagram for the posts under a hashtag

`GET /search/instagram-hashtag`

## Request

- Base URL: `https://api.socially.run/v1`
- URL: `https://api.socially.run/v1/search/instagram-hashtag`
- Auth: HTTP bearer

What Instagram lists under a hashtag, read through a paid reader: shortcode, author, caption, exact likes, comments and plays, the date and the cover. `sort: top` (the default) is Instagram's own mix of popular and recent posts, in its order, not a ranking by likes, and it can reach back months. `sort: recent` lists the newest posts first. A page lists 24 to 33 posts: pass `nextCursor` back as `cursor` for the next one, which is another read. A like count the owner hid reads `null`. A tag with no posts answers an empty page and costs nothing. A deployment with no Instagram reader configured answers 503 before it charges. Cached for fifteen minutes.

## Query parameters

- `q` string, required: A hashtag, with or without its # ("padaria" or "#padaria"). Letters, digits and underscores only.
- `limit` integer: Posts to return, 1–40. One page is one read: a smaller `limit` on the same tag is served from it, and then no `nextCursor` comes with it.
- `sort` 'top' | 'recent': `top` (the default) is Instagram's own mix of popular and recent posts, in its order. `recent` lists the newest posts first.
- `cursor` string: The `nextCursor` of the page before. Each page is another read and another charge, and a cursor only works with the source and the `sort` that made it.
- `refresh` boolean: Read the page again instead of serving the fifteen-minute cache. Charged like any read, and the fresh answer replaces the cached one.

## Response `200`

Search Instagram for the posts under a hashtag

- object
  - `data` unknown, required

## Other responses

- `400`: VALIDATION_ERROR / INVALID_TARGET / SSRF_BLOCKED: the issues, never the values.
- `401`: UNAUTHORIZED / INVALID_TOKEN: the key is missing or wrong.
- `402`: PAYMENT_REQUIRED / PLAN_GATE: clears by upgrading or buying credits, never by waiting.
- `429`: RATE_LIMIT_EXCEEDED / QUOTA_EXCEEDED: Retry-After says when it clears.
- `default`: Any other failure.

---

[API](https://skmtc.dev/socially/apis/socially-run-send-a-profile-link-get-its-public-data-as-json.md) · [All operations](https://skmtc.dev/socially/apis/socially-run-send-a-profile-link-get-its-public-data-as-json/llms.txt) · [OpenAPI document](https://skmtc.dev/socially/apis/socially-run-send-a-profile-link-get-its-public-data-as-json/revisions/5a0b24534b90?raw)
