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

# Recommend Hashtags

> Get recommended hashtags from TikTok based on a single keyword, with data and view counts for each suggestion. Spaces in the keyword will be removed.

Get suggestions for hashtags based on a keyword. Data and view counts are generated from TikTok.

## Header Parameters

**Authorization** `string` *required*

[API Key](https://www.ayrshare.com/docs/apis/overview.md#authorization) of the Primary Profile.

Format: `Authorization: Bearer API_KEY`

## Query Parameters

**keyword** `string` *required*

A single keyword to get recommended hashtags from TikTok. Spaces in the keyword will be removed.

```bash cURL theme={"system"}
curl \
-H "Authorization: Bearer API_KEY" \
-X GET https://api.ayrshare.com/api/hashtags/recommend?keyword=apple
```

```javascript JavaScript theme={"system"}
const API_KEY = "API_KEY";
fetch("https://api.ayrshare.com/api/hashtags/recommend?keyword=apple", {
      method: "GET",
      headers: {
        "Authorization": `Bearer ${API_KEY}`
      }
    })
      .then((res) => res.json())
      .then((json) => console.log(json))
      .catch(console.error);
```

```python Python theme={"system"}
import requests

headers = {'Authorization': 'Bearer API_KEY'}

r = requests.get('https://api.ayrshare.com/api/hashtags/recommend?keyword=apple', headers=headers)

print(r.json())
```

```php PHP theme={"system"}
<?php
require 'vendor/autoload.php';// Composer auto-loader using Guzzle. See .../guzzlephp.org/en/stable/overview.html

$client = new GuzzleHttp\Client();
$res = $client->request(
    'GET',
    'https://api.ayrshare.com/api/hashtags/recommend?keyword=apple',
    [
        'headers' => [
            'Content-Type'      => 'application/json',
            'Authorization'     => 'Bearer API_KEY'
        ]
    ]
);

echo json_encode(json_decode($res->getBody()), JSON_PRETTY_PRINT);
```

```csharp C# theme={"system"}
using System;
using System.Net.Http;
using System.Threading.Tasks;

namespace HashtagsRecommendGETRequest_csharp
{
    class HashtagsRecommend
    {
        static async Task Main(string[] args)
        {
            string API_KEY = "API_KEY";
            string url = "https://api.ayrshare.com/api/hashtags/recommend?keyword=apple";

            using (var client = new HttpClient())
            {
                client.DefaultRequestHeaders.Add("Authorization", "Bearer " + API_KEY);
                
                try
                {
                    var response = await client.GetStringAsync(url);
                    Console.WriteLine(response);
                }
                catch (HttpRequestException ex)
                {
                    Console.WriteLine($"Error: {ex.Message}");
                }
            }
        }
    }
}
```

```json 200: Success theme={"system"}
{
    "keyword": "apple",
    "recommendations": [
        {
            "viewCount": 71950998550, // The number of views that the recommended hashtag has received.
            "name": "apple"           // Suggested hashtag
        },
        {
            "viewCount": 6318280101,
            "name": "applewatch"
        },
        {
            "viewCount": 2486358394,
            "name": "applepencil"
        },
        {
            "viewCount": 2142842131,
            "name": "applemusic"
        },
        {
            "viewCount": 1506224079,
            "name": "applesquad"
        },
        {
            "viewCount": 1307287255,
            "name": "apples"
        },
        {
            "viewCount": 1008293028,
            "name": "applepie"
        },
        {
            "viewCount": 788388838,
            "name": "applejuice"
        },
        {
            "viewCount": 1024901638,
            "name": "appletv"
        },
        {
            "viewCount": 679033194,
            "name": "applechallenge"
        }
    ]
}
```

```json 400: Bad Request Missing keyword theme={"system"}
{
  "action": "request",
  "status": "error",
  "code": 101,
  "message": "Missing or incorrect parameters. Please verify with the docs. .../ayrshare.com/rest-api/endpoints"
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.