# Instagram Hashtag Search (`instagram.search_hashtag`)

Posts under a hashtag from a web search index, filterable by date window and media type.

Docs: https://primaryapi.com/docs/api-reference/instagram/search_hashtag

> **Planned.** This API is on the roadmap and cannot be called yet: `POST /v1/run/instagram.search_hashtag` answers `404 not_found`. Ask for it with `POST https://api.primaryapi.com/v1/api-requests` or the MCP tool `send_feedback`.

- Endpoint: `POST https://api.primaryapi.com/v1/run/instagram.search_hashtag`
- Category: Social · Platform: `instagram` · Kind: search · Status: planned
- Price: Not priced yet: this API is planned and cannot be called.
- Billing unit: per successful call
- Reliability: routed to a healthy upstream and retried automatically when an attempt fails; live 30-day status: `GET https://api.primaryapi.com/v1/status/apis?sku=instagram.search_hashtag`
- Execution: synchronous (answers 202 only if it outlives the wait window)

## Input

| Field | Type | Required | Default | Constraints | Description |
|---|---|---|---|---|---|
| `hashtag` | string | yes |  | max 100 chars | Hashtag to search, without the leading #. |
| `datePosted` | enum | no |  | one of: last-hour, last-day, last-week, last-month, last-year | Only posts published within this window. |
| `mediaType` | enum | no |  | one of: all, reel | All media or reels only. |
| `cursor` | string | no |  |  | Opaque pagination cursor: pass the previous response's nextCursor. |

Unknown fields are rejected with `400 invalid_input`. The routing controls `preferLatencyUnderMs` and `maxCredits` may be sent in the same JSON body.

## Output

When `output.found` is `true`, `output.data` has this shape:

`output.data` is free-form JSON.

When the thing you asked about does not exist (or a search matches nothing) the call still succeeds: `output.found` is `false`, `output.data` is `null` and `output.reason` says why (`not_found`, `private`, `no_results`, …). Misses are free unless the notes below say misses are billed.

## Example request

_Input values are placeholders built from the schema._

```bash
curl -sS -X POST "https://api.primaryapi.com/v1/run/instagram.search_hashtag" \
  -H "Authorization: Bearer $PRIMARYAPI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"hashtag":"string"}'
```

## Errors to handle

`invalid_input`, `unauthorized`, `insufficient_balance`, `key_limit_reached`, `trial_cap_reached`, `forbidden`, `not_found`, `idempotency_conflict`, `rate_limited`, `all_sources_failed`, `service_unavailable`, `timeout`. See https://primaryapi.com/docs/errors.

## Notes

p2 alias: the research routes it as a delegate to instagram.hashtag_top_posts (no datePosted) or instagram.hashtag_recent_posts (datePosted set, paging until posts leave the window).

