> ## Documentation Index
> Fetch the complete documentation index at: https://docs.scraper.creatorlookup.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Hashtag Posts

> Search Instagram posts by hashtag with tab filtering and pagination

## Request

### Headers

| Name        | Required | Description  |
| ----------- | -------- | ------------ |
| `x-api-key` | Yes      | Your API key |

### Query parameters

<ParamField query="hashtag" type="string" required>
  The hashtag to search for (without the # symbol).
</ParamField>

<ParamField query="tab" type="string" default="recent">
  Which tab to fetch. One of: `top`, `recent`, `clips`.
</ParamField>

<ParamField query="cursor" type="string">
  Pagination cursor from a previous response's `next_cursor` field.
</ParamField>

## Response

<ResponseField name="data" type="object">
  <Expandable title="properties">
    <ResponseField name="posts" type="InstagramPost[]">
      Array of post objects.

      <Expandable title="InstagramPost">
        <ResponseField name="id" type="string">Instagram numeric post ID</ResponseField>
        <ResponseField name="shortcode" type="string">Unique post identifier (used in URLs)</ResponseField>
        <ResponseField name="product_type" type="string">One of: `feed`, `clips`, `carousel_container`, `igtv`</ResponseField>
        <ResponseField name="caption" type="string | null">Post caption text</ResponseField>
        <ResponseField name="timestamp" type="number">Unix timestamp of when the post was created</ResponseField>
        <ResponseField name="like_count" type="number">Number of likes</ResponseField>
        <ResponseField name="comment_count" type="number">Number of comments</ResponseField>
        <ResponseField name="media_type" type="string">One of: `image`, `video`, `carousel`</ResponseField>
        <ResponseField name="media_url" type="string">URL of the primary media</ResponseField>
        <ResponseField name="thumbnail_url" type="string | null">Thumbnail URL (for videos)</ResponseField>
        <ResponseField name="video_url" type="string | null">Direct video URL (for videos)</ResponseField>
        <ResponseField name="is_video" type="boolean">Whether the post is a video</ResponseField>
        <ResponseField name="video_view_count" type="number | null">View count (videos only)</ResponseField>
        <ResponseField name="video_duration" type="number | null">Duration in seconds (videos only)</ResponseField>
        <ResponseField name="dimensions" type="object | null">Width and height of the media</ResponseField>
        <ResponseField name="location" type="string | null">Tagged location name</ResponseField>
        <ResponseField name="tagged_users" type="string[]">Usernames tagged in the post</ResponseField>
        <ResponseField name="hashtags" type="string[]">Hashtags extracted from the caption</ResponseField>
        <ResponseField name="music_info" type="object | null">Music/audio metadata for reels</ResponseField>

        <ResponseField name="author" type="object | null">
          Post author information.

          <Expandable title="PostAuthor">
            <ResponseField name="username" type="string">Author's username</ResponseField>
            <ResponseField name="full_name" type="string">Author's display name</ResponseField>
            <ResponseField name="profile_pic_url" type="string">Author's profile picture URL</ResponseField>
            <ResponseField name="is_verified" type="boolean">Whether the author is verified</ResponseField>
          </Expandable>
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="pagination" type="object">
      <Expandable title="properties">
        <ResponseField name="next_cursor" type="string | null">Cursor to pass for the next page</ResponseField>
        <ResponseField name="has_next_page" type="boolean">Whether more results are available</ResponseField>
        <ResponseField name="total_count" type="number | null">Always null for hashtag searches</ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="credits_used" type="number">Credits deducted (1)</ResponseField>
<ResponseField name="credits_remaining" type="number">Remaining credit balance</ResponseField>

**Cost:** 1 credit

## Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl -H "x-api-key: sk-your-api-key" \
    "https://api.scraper.creatorlookup.com/v1/instagram/hashtag/posts?hashtag=travel&tab=recent"
  ```

  ```javascript JavaScript theme={null}
  const res = await fetch(
    "https://api.scraper.creatorlookup.com/v1/instagram/hashtag/posts?hashtag=travel&tab=recent",
    { headers: { "x-api-key": "sk-your-api-key" } }
  );

  const { data, credits_used, credits_remaining } = await res.json();

  data.posts.forEach((post) => {
    console.log(`@${post.author?.username}: ${post.like_count} likes`);
  });

  // Paginate
  if (data.pagination.has_next_page) {
    const nextRes = await fetch(
      `https://api.scraper.creatorlookup.com/v1/instagram/hashtag/posts?hashtag=travel&tab=recent&cursor=${data.pagination.next_cursor}`,
      { headers: { "x-api-key": "sk-your-api-key" } }
    );
  }
  ```

  ```python Python theme={null}
  import requests

  res = requests.get(
      "https://api.scraper.creatorlookup.com/v1/instagram/hashtag/posts",
      params={"hashtag": "travel", "tab": "recent"},
      headers={"x-api-key": "sk-your-api-key"},
  )

  data = res.json()["data"]
  for post in data["posts"]:
      author = post.get("author") or {}
      print(f"@{author.get('username', '?')}: {post['like_count']} likes")
  ```
</CodeGroup>

### 200 — Success

```json theme={null}
{
  "data": {
    "posts": [
      {
        "id": "3456789012345678",
        "shortcode": "DAx1y2z3Ab",
        "product_type": "feed",
        "caption": "Beautiful sunset #travel #photography",
        "timestamp": 1707350400,
        "like_count": 12500,
        "comment_count": 340,
        "media_type": "image",
        "media_url": "https://scontent.cdninstagram.com/...",
        "thumbnail_url": null,
        "video_url": null,
        "is_video": false,
        "video_view_count": null,
        "video_duration": null,
        "dimensions": { "width": 1080, "height": 1350 },
        "location": "Bali, Indonesia",
        "tagged_users": [],
        "hashtags": ["travel", "photography"],
        "music_info": null,
        "author": {
          "username": "travelphotographer",
          "full_name": "Travel Photographer",
          "profile_pic_url": "https://scontent.cdninstagram.com/...",
          "is_verified": false
        }
      }
    ],
    "pagination": {
      "next_cursor": "eyJtYXhfaWQiOiIxMjM0NTY3ODkwIiwicGFnZSI6MSwibWVkaWFfaWRzIjpbXX0",
      "has_next_page": true,
      "total_count": null
    }
  },
  "credits_used": 1,
  "credits_remaining": 9999
}
```

### 402 — Insufficient credits

```json theme={null}
{
  "error": {
    "code": "INSUFFICIENT_CREDITS",
    "message": "This endpoint requires 1 credits, you have 0"
  }
}
```

### 502 — Scrape failed

```json theme={null}
{
  "error": {
    "code": "SCRAPE_FAILED",
    "message": "Hashtag not found or no results"
  }
}
```

### 504 — Timeout

```json theme={null}
{
  "error": {
    "code": "TIMEOUT",
    "message": "Scraping request timed out"
  }
}
```
