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

# TikTok Search

> Search public TikTok videos with portable filters.

# TikTok Search

Search public videos using stable filters.

```json theme={"system"}
{
  "query": "python tutorial",
  "results_limit": 50,
  "sort_by": "relevance",
  "published_within": "month"
}
```

## Use with MCP

| Interface      | Value                                           |
| -------------- | ----------------------------------------------- |
| REST           | `POST /v1/tiktok/search`                        |
| Compact MCP    | `socq_execute` with `endpoint: "tiktok/search"` |
| Typed MCP      | `socq_tiktok_search`                            |
| Exact-tool URL | `https://api.socq.ai/mcp?tools=tiktok_search`   |
| CLI            | `socq tiktok search`                            |

Use the JSON request body above as the nested `input` object for `socq_execute`, or pass the same fields directly to the typed tool. Typed tools also accept `_wait_seconds`, `_result_limit`, and `_idempotency_key`.

<Info>
  A successful collection returns a `task_id`. Continue with `socq_get_task` until the task succeeds, then read normalized records from `results.items`.
</Info>

See [MCP quickstart](/integrations/mcp) for the complete submission and polling flow.

| Field              | Accepted values                                      |
| ------------------ | ---------------------------------------------------- |
| `sort_by`          | `relevance`, `date`, `likes`                         |
| `published_within` | `day`, `week`, `month`, `three_months`, `six_months` |

`results_limit` defaults to 100.

Results use the normalized structure documented in [TikTok Videos](/api-manual/tiktok/videos), with `resource` set to `search`. The submitted query is returned under `extra.search_query` when available.


## OpenAPI

````yaml api-manual/agent-api/agent-api.json POST /v1/tiktok/search
openapi: 3.1.0
info:
  title: SocQ Agent API
  version: v1-063d1c96173a
  description: Asynchronous social data API generated from the SocQ Capability Registry.
servers:
  - url: https://api.socq.ai
security: []
paths:
  /v1/tiktok/search:
    post:
      tags:
        - tiktok
      summary: TikTok Search API
      description: TikTok Search API
      operationId: socq_tiktok_search
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $schema: https://json-schema.org/draft/2020-12/schema
              type: object
              additionalProperties: false
              properties:
                published_within:
                  type: string
                  minLength: 1
                query:
                  type: string
                  minLength: 1
                  description: Search query.
                results_limit:
                  type: integer
                  minimum: 1
                  maximum: 2000
                sort_by:
                  type: string
                  minLength: 1
              required:
                - query
      responses:
        '200':
          description: Task accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentSubmitResponse'
      security:
        - bearerAuth: []
        - apiKeyAuth: []
components:
  schemas:
    AgentSubmitResponse:
      type: object
      properties:
        code:
          type: integer
          const: 200
        data:
          type: object
          properties:
            task_id:
              type: string
            status:
              type: string
            created_time:
              type:
                - string
                - 'null'
            idempotent_replay:
              type: boolean
          required:
            - task_id
            - status
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````