> ## 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.

# Trending Hashtag Detail

> Retrieve detailed data for a trending TikTok hashtag, including video count, view trends, and top associated content.

<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/tiktok/trending/hashtag/detail.

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/tiktok/trending/hashtag/detail

Description: Retrieve detailed data for a trending TikTok hashtag, including video count, view trends, and top associated content.

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

Parameters:
- period (Optional): The time range for querying data, with valid options: 7 (last 7 days), 30 (last 30 days), 120 (last 120 days), 365 (last 12 months), 1095 (last 3 years). Example: 7
- region (Optional): Country/region code, the default value "all_regions" represents all regions. Example: US. Example: all_regions
- hashtag_name (Optional): Names taken from the list of popular topic Hashtags. Example: ufc324

Example Response:
{
"code": 0,
"message": "success",
"data": {
"info": {
  "hashtag_id": "7357697982441422880",
  "hashtag_name": "ufc324",
  "video_url": "https://www.tiktok.com/tag/ufc324",
  "country_info": {
    "id": "ALL",
    "value": "ALL",
    "label": "ALL"
  },
  "industry_info": {
    "id": 28000000000,
    "value": "Sports & Outdoor",
    "label": "label_28000000000"
  },
  "is_promoted": false,
  "trend": [
    {
      "time": 1769472000,
      "value": 1
    },
    {
      "time": 1769558400,
      "value": 0.7
    },
    {
      "time": 1769644800,
      "value": 0.48
    },
    {
      "time": 1769731200,
      "value": 0.31
    },
    {
      "time": 1769817600,
      "value": 0.26
    },
    {
      "time": 1769904000,
      "value": 0.25
    },
    {
      "time": 1769990400,
      "value": 0.3
    }
  ],
  "publish_cnt": 12142,
  "video_views": 506402059,
  "publish_cnt_all": 34146,
  "video_views_all": 1289245188,
  "longevity": {
    "popular_days": 0,
    "current_popularity": 0
  },
  "audience_ages": [
    {
      "age_level": 3,
      "score": 65
    },
    {
      "age_level": 4,
      "score": 23
    },
    {
      "age_level": 5,
      "score": 12
    }
  ],
  "audience_interests": [
    {

... (truncated)`)}
    >
      <span>✨</span>
      <span>Copy for AI</span>
    </button>
  </div>
</div>


## OpenAPI

````yaml en/tiktok.openapi.json GET /v1/tiktok/trending/hashtag/detail
openapi: 3.0.1
info:
  title: Tiktok API english documentation
  description: >-
    The english reference documentation of the Tiktok 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: []
tags:
  - name: TikTok Influencer
  - name: TikTok Shop
  - name: TikTok Content
  - name: TikTok Intelligence
paths:
  /v1/tiktok/trending/hashtag/detail:
    get:
      tags:
        - TikTok Intelligence
      summary: Trending Hashtag Detail
      description: >-
        Retrieve detailed data for a trending TikTok hashtag, including video
        count, view trends, and top associated content.
      operationId: get_api_v3_realtime_trending_popular_hashtag_detail
      parameters:
        - name: period
          in: query
          description: >-
            The time range for querying data, with valid options: 7 (last 7
            days), 30 (last 30 days), 120 (last 120 days), 365 (last 12 months),
            1095 (last 3 years)
          required: false
          schema:
            type: string
            example: '7'
            default: '7'
          example: '7'
        - name: region
          in: query
          description: >-
            Country/region code, the default value "all_regions" represents all
            regions. Example: US
          required: false
          schema:
            type: string
            example: all_regions
            default: all_regions
          example: all_regions
        - name: hashtag_name
          in: query
          description: Names taken from the list of popular topic Hashtags
          required: false
          schema:
            type: string
            example: ufc324
            default: ufc324
          example: ufc324
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties: {}
                example:
                  code: 0
                  message: success
                  data:
                    info:
                      hashtag_id: '7357697982441422880'
                      hashtag_name: ufc324
                      video_url: https://www.tiktok.com/tag/ufc324
                      country_info:
                        id: ALL
                        value: ALL
                        label: ALL
                      industry_info:
                        id: 28000000000
                        value: Sports & Outdoor
                        label: label_28000000000
                      is_promoted: false
                      trend:
                        - time: 1769472000
                          value: 1
                        - time: 1769558400
                          value: 0.7
                        - time: 1769644800
                          value: 0.48
                        - time: 1769731200
                          value: 0.31
                        - time: 1769817600
                          value: 0.26
                        - time: 1769904000
                          value: 0.25
                        - time: 1769990400
                          value: 0.3
                      publish_cnt: 12142
                      video_views: 506402059
                      publish_cnt_all: 34146
                      video_views_all: 1289245188
                      longevity:
                        popular_days: 0
                        current_popularity: 0
                      audience_ages:
                        - age_level: 3
                          score: 65
                        - age_level: 4
                          score: 23
                        - age_level: 5
                          score: 12
                      audience_interests:
                        - interest_info:
                            id: '10058'
                            label: diversify_10058
                            value: Extreme Sports
                          score: 263
                        - interest_info:
                            id: '10060'
                            label: diversify_10060
                            value: Sports News
                          score: 254
                        - interest_info:
                            id: '10064'
                            label: diversify_10064
                            value: Fishing, Hunting & Camping
                          score: 144
                        - interest_info:
                            id: '10059'
                            label: diversify_10059
                            value: Traditional Sports
                          score: 121
                        - interest_info:
                            id: '10061'
                            label: diversify_10061
                            value: Fitness
                          score: 121
                      audience_countries:
                        - country_info:
                            id: '1821275'
                            label: MO
                            value: Macao
                          score: 780
                        - country_info:
                            id: '630336'
                            label: BY
                            value: Belarus
                          score: 617
                        - country_info:
                            id: '2963597'
                            label: IE
                            value: Ireland
                          score: 471
                        - country_info:
                            id: '1522867'
                            label: KZ
                            value: Kazakhstan
                          score: 408
                        - country_info:
                            id: '2186224'
                            label: NZ
                            value: New Zealand
                          score: 395
                        - country_info:
                            id: '660013'
                            label: FI
                            value: Finland
                          score: 356
                        - country_info:
                            id: '597427'
                            label: LT
                            value: Lithuania
                          score: 353
                        - country_info:
                            id: '2077456'
                            label: AU
                            value: Australia
                          score: 346
                        - country_info:
                            id: '458258'
                            label: LV
                            value: Latvia
                          score: 340
                        - country_info:
                            id: '3202326'
                            label: HR
                            value: Croatia
                          score: 314
                        - country_info:
                            id: '2782113'
                            label: AT
                            value: Austria
                          score: 308
                      related_hashtags:
                        - hashtag_id: '1664180092709893'
                          hashtag_name: paddypimblett
                          video_url: https://www.tiktok.com/tag/paddypimblett
                        - hashtag_id: '1624672392451077'
                          hashtag_name: justingaethje
                          video_url: https://www.tiktok.com/tag/justingaethje
                        - hashtag_id: '1651468147224581'
                          hashtag_name: seanomalley
                          video_url: https://www.tiktok.com/tag/seanomalley
                        - hashtag_id: '1661965843527686'
                          hashtag_name: paddythebaddy
                          video_url: https://www.tiktok.com/tag/paddythebaddy
                        - hashtag_id: '1644658357349381'
                          hashtag_name: gaethje
                          video_url: https://www.tiktok.com/tag/gaethje
                  requestId: 1cacc4ca-a154-44d4-82de-e994bda411b9
        '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/tiktok/trending/hashtag/detail?period=7&region=all_regions&hashtag_name=ufc324' \
              --header 'Authorization: Bearer <YOUR_API_KEY>'
        - lang: python
          label: Python
          source: |-
            import requests

            response = requests.get(
                'https://api.keyapi.ai/v1/tiktok/trending/hashtag/detail',
                params={"period": "7", "region": "all_regions", "hashtag_name": "ufc324"},
                headers={'Authorization': 'Bearer <YOUR_API_KEY>'}
            )
            print(response.json())
        - lang: javascript
          label: JavaScript
          source: >-
            const params = new URLSearchParams({"period": "7", "region":
            "all_regions", "hashtag_name": "ufc324"});


            const response = await
            fetch(`https://api.keyapi.ai/v1/tiktok/trending/hashtag/detail?${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).

````