> ## Documentation Index
> Fetch the complete documentation index at: https://scrapebadger-feat-flights-booking-options.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Search the Ad Library

> Search TikTok's EU Commercial Content (ad transparency) Library by keyword or advertiser id.

<Note>
  The TikTok Ad Library is **EU-only** (EU Digital Services Act ad transparency). Use an EU `region` such as `DE`, `FR`, `IE`, or `NL`. Pass `advertiser_id` to scope to a single advertiser, or `query` for a keyword search.
</Note>

<Note>
  Each request costs **5 credits**. Failed requests are not charged.
</Note>


## OpenAPI

````yaml GET /v1/tiktok/ads/search
openapi: 3.1.0
info:
  title: ScrapeBadger TikTok API
  version: 1.0.0
  description: >-
    TikTok scraping API for user profiles, videos, comments, transcripts,
    hashtags, music/sounds, search, trending, and the EU Commercial Content (ad
    transparency) library. Returns clean structured JSON; handles signing,
    anti-bot bypass, and regional proxy routing automatically.
servers:
  - url: https://scrapebadger.com
    description: Production
security:
  - apiKeyAuth: []
paths:
  /v1/tiktok/ads/search:
    get:
      tags:
        - TikTok Ads
      summary: Search the TikTok Ad Library
      description: >-
        Search TikTok's Commercial Content Library (EU Digital Services Act ad
        transparency) by keyword or advertiser id. EU regions only.
      operationId: searchTikTokAds
      parameters:
        - name: query
          in: query
          schema:
            type: string
            default: ''
          description: Keyword to search ads by. Ignored when advertiser_id is set.
        - name: advertiser_id
          in: query
          schema:
            type: string
            default: ''
          description: >-
            Advertiser business id(s) to scope the search to a specific
            advertiser.
        - name: region
          in: query
          schema:
            type: string
            default: DE
          description: EU region code — the Ad Library is EU-only (e.g. DE, FR, IE, NL).
        - name: days
          in: query
          schema:
            type: integer
            default: 30
            minimum: 1
            maximum: 365
          description: Look-back window in days for ads shown.
        - name: sort
          in: query
          schema:
            type: string
            default: last_shown_date,desc
          description: Sort order, '<field>,<direction>' (e.g. last_shown_date,desc).
        - name: offset
          in: query
          schema:
            type: integer
            default: 0
            minimum: 0
          description: Result offset for pagination.
        - name: search_id
          in: query
          schema:
            type: string
            default: ''
          description: >-
            Opaque search id from a prior page's `pagination.search_id`, to
            chain pages.
        - name: count
          in: query
          schema:
            type: integer
            default: 20
            minimum: 1
            maximum: 50
          description: Maximum number of items to return (1-50).
      responses:
        '200':
          description: Ad Library results
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AdLibrarySearchResponse'
              example:
                ads:
                  - id: '172000000000000'
                    name: Acme GmbH
                    audit_status: approved
                    type: video
                    first_shown_date: 1699999999000
                    last_shown_date: 1700999999000
                    videos:
                      - video_url: https://library.tiktok.com/ad-video.mp4
                        cover_img: https://library.tiktok.com/ad-cover.jpeg
                pagination:
                  has_more: true
                  total: 240
                  search_id: 20231114...
                  offset: 0
                region: DE
components:
  schemas:
    AdLibrarySearchResponse:
      type: object
      properties:
        ads:
          type: array
          items:
            $ref: '#/components/schemas/TikTokAd'
        pagination:
          $ref: '#/components/schemas/AdLibraryPage'
        region:
          type: string
      required:
        - pagination
        - region
    TikTokAd:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
          description: Advertiser name.
        audit_status:
          type: string
        type:
          type: string
        first_shown_date:
          type: integer
          description: Epoch milliseconds.
        last_shown_date:
          type: integer
          description: Epoch milliseconds.
        videos:
          type: array
          items:
            $ref: '#/components/schemas/TikTokAdVideo'
      required:
        - id
      description: An ad from the Commercial Content Library.
    AdLibraryPage:
      type: object
      properties:
        has_more:
          type: boolean
        total:
          type: integer
        search_id:
          type: string
          description: Pass to the next page request.
        offset:
          type: integer
      description: Pagination metadata for Ad Library search.
    TikTokAdVideo:
      type: object
      properties:
        video_url:
          type: string
        cover_img:
          type: string
      description: A creative asset attached to an ad.
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````