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

# Search hashtags

> Instagram hashtag search endpoint, returns matching hashtag results.

<div className="inline-flex items-center gap-2 px-4 py-2 bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg">
  <span className="text-base">🪙</span>
  <span className="text-sm font-medium text-yellow-900 dark:text-yellow-100"><span className="font-semibold">2 credits</span><span className="text-yellow-700 dark:text-yellow-300 ml-1">per request</span></span>
</div>

## Copy for AI

<div className="my-6 rounded-xl border border-gray-200 bg-gray-50 p-5 dark:border-gray-800 dark:bg-gray-900/40">
  <div className="min-w-0">
    <p className="text-base font-semibold text-gray-900 dark:text-gray-100">🤖 Why Code When AI Can Do It For You?</p>
    <p className="mt-1 text-sm text-gray-700 dark:text-gray-300">Stop writing code like it's 1970! Let AI do the heavy lifting - click the sparkles to copy a perfectly formatted prompt for ChatGPT, Claude, or your favorite AI assistant.</p>
  </div>

  <div className="mt-4">
    <button
      type="button"
      className="inline-flex items-center gap-2 rounded-md border border-emerald-300 bg-emerald-50 px-3 py-2 text-sm font-medium text-emerald-800 hover:bg-emerald-100 dark:border-emerald-700 dark:bg-emerald-900/30 dark:text-emerald-100 dark:hover:bg-emerald-900/50"
      onClick={() => navigator.clipboard.writeText(`I want to make an API call to https://api.keyapi.ai/v1/instagram/search_hashtags.

Please help me write code to make this API call and handle the response appropriately. Include error handling and best practices.

Here are the details:

Endpoint: GET https://api.keyapi.ai/v1/instagram/search_hashtags

Description: Instagram hashtag search endpoint, returns matching hashtag results.

Required Headers:
--header 'Authorization: Bearer <YOUR_API_KEY>'

Parameters:
- query (Required): Search keyword. Example: fashion

Example Response:
{
"code": 0,
"message": "success",
"data": {
"hashtags": [
  {
    "position": 0,
    "hashtag": {
      "name": "fashions",
      "media_count": 5494328,
      "search_result_subtitle": "549 万 篇帖子",
      "id": "17843890609015954"
    }
  },
  {
    "position": 1,
    "hashtag": {
      "name": "fashionkilla",
      "media_count": 3611489,
      "search_result_subtitle": "361 万 篇帖子",
      "id": "17842863376036285"
    }
  },
  {
    "position": 2,
    "hashtag": {
      "name": "fashionforward",
      "media_count": 5779589,
      "search_result_subtitle": "577 万 篇帖子",
      "id": "17843708950011046"
    }
  },
  {
    "position": 3,
    "hashtag": {
      "name": "fashionshoes",
      "media_count": 3438590,
      "search_result_subtitle": "343 万 篇帖子",
      "id": "17841561742086062"
    }
  },
  {
    "position": 4,
    "hashtag": {
      "name": "fashionlook",
      "media_count": 5737987,
      "search_result_subtitle": "573 万 篇帖子",
      "id": "17841545722111695"
    }
  },
  {
    "position": 5,
    "hashtag": {
      "name": "fashioneditorial",
      "media_count": 5323830,
      "search_result_subtitle": "532 万 篇帖子",
      "id": "17841562828089230"
    }
  },
  {
    "position": 6,
    "hashtag": {
      "name": "fashion",
 
... (truncated)`)}
    >
      <span>✨</span>
      <span>Copy for AI</span>
    </button>
  </div>
</div>


## OpenAPI

````yaml en/instagram.openapi.json GET /v1/instagram/search_hashtags
openapi: 3.0.1
info:
  title: Instagram API english documentation
  description: >-
    The english reference documentation of the Instagram API includes the
    interface's purpose, parameter description, response status, and sample
    structure.
  version: 1.0.0
servers:
  - url: https://api.keyapi.ai
    description: Production
security:
  - JWT Bearer: []
tags: []
paths:
  /v1/instagram/search_hashtags:
    get:
      tags: []
      summary: Search hashtags
      description: Instagram hashtag search endpoint, returns matching hashtag results.
      parameters:
        - name: query
          in: query
          description: Search keyword
          required: true
          example: fashion
          schema:
            type: string
            example: fashion
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties: {}
              example:
                code: 0
                message: success
                data:
                  hashtags:
                    - position: 0
                      hashtag:
                        name: fashions
                        media_count: 5494328
                        search_result_subtitle: 549 万 篇帖子
                        id: '17843890609015954'
                    - position: 1
                      hashtag:
                        name: fashionkilla
                        media_count: 3611489
                        search_result_subtitle: 361 万 篇帖子
                        id: '17842863376036285'
                    - position: 2
                      hashtag:
                        name: fashionforward
                        media_count: 5779589
                        search_result_subtitle: 577 万 篇帖子
                        id: '17843708950011046'
                    - position: 3
                      hashtag:
                        name: fashionshoes
                        media_count: 3438590
                        search_result_subtitle: 343 万 篇帖子
                        id: '17841561742086062'
                    - position: 4
                      hashtag:
                        name: fashionlook
                        media_count: 5737987
                        search_result_subtitle: 573 万 篇帖子
                        id: '17841545722111695'
                    - position: 5
                      hashtag:
                        name: fashioneditorial
                        media_count: 5323830
                        search_result_subtitle: 532 万 篇帖子
                        id: '17841562828089230'
                    - position: 6
                      hashtag:
                        name: fashion
                        media_count: 1236174534
                        search_result_subtitle: 12.3 亿 篇帖子
                        id: '17841592771073334'
                    - position: 7
                      hashtag:
                        name: fashionshoot
                        media_count: 5173233
                        search_result_subtitle: 517 万 篇帖子
                        id: '17841563230121302'
                    - position: 8
                      hashtag:
                        name: fashioninfluencer
                        media_count: 5093918
                        search_result_subtitle: 509 万 篇帖子
                        id: '17843487982058247'
                    - position: 9
                      hashtag:
                        name: fashionaccessories
                        media_count: 4949009
                        search_result_subtitle: 494 万 篇帖子
                        id: '17841563500103910'
                    - position: 10
                      hashtag:
                        name: fashiongoals
                        media_count: 4576907
                        search_result_subtitle: 457 万 篇帖子
                        id: '17841563479095635'
                    - position: 11
                      hashtag:
                        name: fashionart
                        media_count: 4453419
                        search_result_subtitle: 445 万 篇帖子
                        id: '17841562813095925'
                    - position: 12
                      hashtag:
                        name: fashionmagazine
                        media_count: 4387302
                        search_result_subtitle: 438 万 篇帖子
                        id: '17841562738087974'
                    - position: 13
                      hashtag:
                        name: fashionmen
                        media_count: 4308329
                        search_result_subtitle: 430 万 篇帖子
                        id: '17841561193124928'
                    - position: 14
                      hashtag:
                        name: fashionbaby
                        media_count: 3651045
                        search_result_subtitle: 365 万 篇帖子
                        id: '17841563560104789'
                    - position: 15
                      hashtag:
                        name: fashionbrand
                        media_count: 3551364
                        search_result_subtitle: 355 万 篇帖子
                        id: '17841604633076458'
                    - position: 16
                      hashtag:
                        name: fashionstore
                        media_count: 3539723
                        search_result_subtitle: 353 万 篇帖子
                        id: '17843883961018424'
                    - position: 17
                      hashtag:
                        name: fashionbag
                        media_count: 3516108
                        search_result_subtitle: 351 万 篇帖子
                        id: '17843806024054065'
                    - position: 18
                      hashtag:
                        name: fashionreels
                        media_count: 3507659
                        search_result_subtitle: 350 万 篇帖子
                        id: '17843722585009462'
                    - position: 19
                      hashtag:
                        name: fashionmuslim
                        media_count: 3196680
                        search_result_subtitle: 319 万 篇帖子
                        id: '17841570991072379'
                    - position: 20
                      hashtag:
                        name: fashionicon
                        media_count: 3159284
                        search_result_subtitle: 315 万 篇帖子
                        id: '17841563332110955'
                    - position: 21
                      hashtag:
                        name: fashionlove
                        media_count: 3118246
                        search_result_subtitle: 311 万 篇帖子
                        id: '17841562990101786'
                    - position: 22
                      hashtag:
                        name: fashionist
                        media_count: 3113192
                        search_result_subtitle: 311 万 篇帖子
                        id: '17843794417010137'
                    - position: 23
                      hashtag:
                        name: fashionmurah
                        media_count: 3043535
                        search_result_subtitle: 304 万 篇帖子
                        id: '17842273804032251'
                    - position: 24
                      hashtag:
                        name: fashionistas
                        media_count: 7845869
                        search_result_subtitle: 784 万 篇帖子
                        id: '17841563251122648'
                    - position: 25
                      hashtag:
                        name: fashionformen
                        media_count: 3124292
                        search_result_subtitle: 312 万 篇帖子
                        id: '17842191385033633'
                    - position: 26
                      hashtag:
                        name: fashionkenya
                        media_count: 2523302
                        search_result_subtitle: 252 万 篇帖子
                        id: '17843754259041403'
                    - position: 27
                      hashtag:
                        name: fashionworld
                        media_count: 2816200
                        search_result_subtitle: 281 万 篇帖子
                        id: '17843791546061686'
                    - position: 28
                      hashtag:
                        name: fashionph
                        media_count: 2816005
                        search_result_subtitle: 281 万 篇帖子
                        id: '17841548983106323'
                    - position: 29
                      hashtag:
                        name: fashionstatement
                        media_count: 2726059
                        search_result_subtitle: 272 万 篇帖子
                        id: '17843677360017355'
                    - position: 30
                      hashtag:
                        name: fashionphoto
                        media_count: 2352481
                        search_result_subtitle: 235 万 篇帖子
                        id: '17843769031010236'
                    - position: 31
                      hashtag:
                        name: fashionpria
                        media_count: 2268325
                        search_result_subtitle: 226 万 篇帖子
                        id: '17841552571090862'
                    - position: 32
                      hashtag:
                        name: fashiontips
                        media_count: 2235020
                        search_result_subtitle: 223 万 篇帖子
                        id: '17843796214036223'
                    - position: 33
                      hashtag:
                        name: fashionrevolution
                        media_count: 2217458
                        search_result_subtitle: 221 万 篇帖子
                        id: '17843414335044579'
                    - position: 34
                      hashtag:
                        name: fashionsketch
                        media_count: 2167383
                        search_result_subtitle: 216 万 篇帖子
                        id: '17841593524079214'
                    - position: 35
                      hashtag:
                        name: fashiongirls
                        media_count: 2104428
                        search_result_subtitle: 210 万 篇帖子
                        id: '17841561628121372'
                    - position: 36
                      hashtag:
                        name: fashionmodels
                        media_count: 2084696
                        search_result_subtitle: 208 万 篇帖子
                        id: '17843884057050407'
                    - position: 37
                      hashtag:
                        name: fashiondiary
                        media_count: 1836857
                        search_result_subtitle: 183 万 篇帖子
                        id: '17843874223011166'
                    - position: 38
                      hashtag:
                        name: fashionoftheday
                        media_count: 2736229
                        search_result_subtitle: 273 万 篇帖子
                        id: '17841562336094561'
                    - position: 39
                      hashtag:
                        name: fashiontrend
                        media_count: 2458407
                        search_result_subtitle: 245 万 篇帖子
                        id: '17843631457016347'
                    - position: 40
                      hashtag:
                        name: fashionmuslimah
                        media_count: 2390476
                        search_result_subtitle: 239 万 篇帖子
                        id: '17841524647106896'
                    - position: 41
                      hashtag:
                        name: fashionblogger
                        media_count: 174560761
                        search_result_subtitle: 1.7 亿 篇帖子
                        id: '17843830906017148'
                    - position: 42
                      hashtag:
                        name: fashionjewellery
                        media_count: 3912354
                        search_result_subtitle: 391 万 篇帖子
                        id: '17843824045053589'
                    - position: 43
                      hashtag:
                        name: fashionista
                        media_count: 142900669
                        search_result_subtitle: 1.4 亿 篇帖子
                        id: '17843742502017651'
                    - position: 44
                      hashtag:
                        name: boutiquefashion
                        media_count: 5450757
                        search_result_subtitle: 545 万 篇帖子
                        id: '17843642725039397'
                    - position: 45
                      hashtag:
                        name: girlsfashion
                        media_count: 5266158
                        search_result_subtitle: 526 万 篇帖子
                        id: '17841563527124896'
                    - position: 46
                      hashtag:
                        name: instafashionista
                        media_count: 2140660
                        search_result_subtitle: 214 万 篇帖子
                        id: '17841511849117443'
                    - position: 47
                      hashtag:
                        name: oldfashioned
                        media_count: 2067629
                        search_result_subtitle: 206 万 篇帖子
                        id: '17841564205095240'
                    - position: 48
                      hashtag:
                        name: ankarafashion
                        media_count: 5012064
                        search_result_subtitle: 501 万 篇帖子
                        id: '17841509599093429'
                    - position: 49
                      hashtag:
                        name: ladiesfashion
                        media_count: 4937457
                        search_result_subtitle: 493 万 篇帖子
                        id: '17843618602030634'
                    - position: 50
                      hashtag:
                        name: thriftedfashion
                        media_count: 5801815
                        search_result_subtitle: 580 万 篇帖子
                        id: '17843649820023278'
                    - position: 51
                      hashtag:
                        name: mensfashionpost
                        media_count: 5305315
                        search_result_subtitle: 530 万 篇帖子
                        id: '17843748391046661'
                    - position: 52
                      hashtag:
                        name: bridalfashion
                        media_count: 4490768
                        search_result_subtitle: 449 万 篇帖子
                        id: '17841512164089653'
                    - position: 53
                      hashtag:
                        name: minifashionista
                        media_count: 3866562
                        search_result_subtitle: 386 万 篇帖子
                        id: '17842329166066355'
                    - position: 54
                      hashtag:
                        name: fashionable
                        media_count: 42992705
                        search_result_subtitle: 4,299 万 篇帖子
                        id: '17843860726042365'
                  rank_token: >-
                    1773124366682|af8bc45cba3e8a7acd62e6fbeb8feeace7a0425fb64afabbcee9506cbc15bfbe
                  see_more: null
                  inform_module: null
                requestId: 4029615f-3687-4eca-bac3-fff56d0a870d
          headers: {}
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                example:
                  code: 400
                  data: null
                  message: 'Missing required parameter: handle'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                example:
                  code: 401
                  data: null
                  message: apiKey is null
        '402':
          description: Payment Required
          content:
            application/json:
              schema:
                type: object
                example:
                  code: 402
                  data: null
                  message: apiKey quota is not enough
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                type: object
                example:
                  code: 429
                  data: null
                  message: qps limit exceeded
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                example:
                  code: 500
                  data: null
                  message: Internal server error
      deprecated: false
      security:
        - JWT Bearer: []
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl --request GET \
              --url 'https://api.keyapi.ai/v1/instagram/search_hashtags?query=fashion' \
              --header 'Authorization: Bearer <YOUR_API_KEY>'
        - lang: python
          label: Python
          source: |-
            import requests

            response = requests.get(
                'https://api.keyapi.ai/v1/instagram/search_hashtags',
                params={"query": "fashion"},
                headers={'Authorization': 'Bearer <YOUR_API_KEY>'}
            )
            print(response.json())
        - lang: javascript
          label: JavaScript
          source: >-
            const params = new URLSearchParams({"query": "fashion"});


            const response = await
            fetch(`https://api.keyapi.ai/v1/instagram/search_hashtags?${params}`,
            {
              method: 'GET',
              headers: { 'Authorization': 'Bearer <YOUR_API_KEY>' }
            });

            const data = await response.json();

            console.log(data);
components:
  securitySchemes:
    JWT Bearer:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: |-
        API key for authentication. Format: `sk_live_xxxxxxxxxxxxx`
        Get your API key from the [Dashboard](http://keyapi.ai/app/dashboard).

````