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

# Scrape a TikTok hashtag - totals and top videos

> Fetches a TikTok hashtag page for `hashtag` and returns it as JSON: `hashtag`, `id`, `url`, `stats` (total views and videos under the tag) and a `videos` array of its top posts (up to 10). With `video_details=true` (default) every listed video carries the full `/social/tiktok-video` shape - exact plays, likes, comments, shares, saves, hashtags, author with follower counts, music, media URLs and timestamps - which makes the response a ready trend / creator discovery sample. `hashtag` accepts a bare name, `#name` or a tag URL. No login or cookies.



## OpenAPI

````yaml /api-reference/openapi.json post /social/tiktok-hashtag
openapi: 3.1.0
info:
  title: ScrapeUnblocker API
  description: >-
    Public API for the ScrapeUnblocker proxy/anti-bot service. Authenticate
    every request with the `x-scrapeunblocker-key` header. Three endpoints are
    documented here: page-source extraction, Google SERP scraping, and image
    fetch. All other paths exist for internal operations and are intentionally
    hidden from this spec.
  version: 3.0.0
servers:
  - url: https://api.scrapeunblocker.com
    description: Production
security: []
paths:
  /social/tiktok-hashtag:
    post:
      tags:
        - Plugins
      summary: Scrape a TikTok hashtag - totals and top videos
      description: >-
        Fetches a TikTok hashtag page for `hashtag` and returns it as JSON:
        `hashtag`, `id`, `url`, `stats` (total views and videos under the tag)
        and a `videos` array of its top posts (up to 10). With
        `video_details=true` (default) every listed video carries the full
        `/social/tiktok-video` shape - exact plays, likes, comments, shares,
        saves, hashtags, author with follower counts, music, media URLs and
        timestamps - which makes the response a ready trend / creator discovery
        sample. `hashtag` accepts a bare name, `#name` or a tag URL. No login or
        cookies.
      operationId: tiktok_hashtag_social_tiktok_hashtag_post
      parameters:
        - name: hashtag
          in: query
          required: true
          schema:
            type: string
            description: >-
              Hashtag name ('nasa' or '#nasa') or a hashtag URL like
              'https://www.tiktok.com/tag/nasa'.
            title: Hashtag
          description: >-
            Hashtag name ('nasa' or '#nasa') or a hashtag URL like
            'https://www.tiktok.com/tag/nasa'.
        - name: max_videos
          in: query
          required: false
          schema:
            type: integer
            maximum: 200
            minimum: 0
            description: >-
              How many of the hashtag's videos to include (0-200). 0 = totals
              only. Up to 10 top videos come from TikTok's server-rendered
              widget in a couple of seconds; asking for more opens the hashtag
              page in a browser and scrolls the real grid (about 30 videos a
              batch, 10-30 s), all with full details.
            default: 10
            title: Max Videos
          description: >-
            How many of the hashtag's videos to include (0-200). 0 = totals
            only. Up to 10 top videos come from TikTok's server-rendered widget
            in a couple of seconds; asking for more opens the hashtag page in a
            browser and scrolls the real grid (about 30 videos a batch, 10-30
            s), all with full details.
        - name: video_details
          in: query
          required: false
          schema:
            type: boolean
            description: >-
              Fetch each listed video's own page for full engagement, hashtags,
              author stats, music and media URLs. false = only id, caption,
              cover, author handle and play count.
            default: true
            title: Video Details
          description: >-
            Fetch each listed video's own page for full engagement, hashtags,
            author stats, music and media URLs. false = only id, caption, cover,
            author handle and play count.
        - name: proxy_country
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Exit-IP country (ISO-2, e.g. 'US', 'DE'). Optional - TikTok's
              public pages are the same worldwide; set it only for
              region-restricted items.
            title: Proxy Country
          description: >-
            Exit-IP country (ISO-2, e.g. 'US', 'DE'). Optional - TikTok's public
            pages are the same worldwide; set it only for region-restricted
            items.
      responses:
        '200':
          description: >-
            JSON hashtag object with a `videos` array (`videosCollected` gives
            its length).
          content:
            application/json:
              schema: {}
        '400':
          description: Missing or malformed hashtag / proxy_country.
        '404':
          description: Hashtag has no page on TikTok.
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '502':
          description: Blocked by TikTok or no hashtag returned.
        '504':
          description: Fetch timed out.
      security:
        - ScrapeUnblockerKey: []
components:
  schemas:
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    ScrapeUnblockerKey:
      type: apiKey
      in: header
      name: x-scrapeunblocker-key
      description: Your ScrapeUnblocker API key. Apply on every request.

````