# Tiktok Search Scraper (`logical_scrapers/tiktok-search-scraper`) Actor

High-performance Apify Actor that searches TikTok for any keyword and extracts detailed video data from the results. Track trending content, analyze competitor strategies, monitor brand mentions, or research hashtags, this scraper delivers accurate, structured data in JSON, CSV, or Excel formats.

- **URL**: https://apify.com/logical\_scrapers/tiktok-search-scraper.md
- **Developed by:** [Goldmine](https://apify.com/logical_scrapers) (community)
- **Categories:** Social media, Videos, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

$10.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## TikTok Search Scraper - Search & Extract TikTok Videos

---

![xtiktok-search-scraper](https://images.apifyusercontent.com/R-ELa8oYCYKja_3PVHu1YMOWPr44yg7uXO9MlWAWMuM/rs:fill:250:250/cb:1/aHR0cHM6Ly9hcGlmeS1pbWFnZS11cGxvYWRzLXByb2QuczMudXMtZWFzdC0xLmFtYXpvbmF3cy5jb20vVVU5RHV3VjFlcDhOM2hNdzQtYWN0b3ItQ0thaUJzcEhXaTlHZlFjaTQtNTVncnBqVlBnRC1PSVAuanBlZw.webp)

---

### Fast, Reliable TikTok Search Scraper

**TikTok Search Scraper** is a high-performance Apify Actor that searches TikTok for any keyword and extracts detailed video data from the results.

Whether you need to track trending content, analyze competitor strategies, monitor brand mentions, or research hashtags, this scraper delivers accurate, structured data in JSON, CSV, or Excel formats.

---

### Key Features

*   **Keyword Search:** Search TikTok for any keyword or phrase and extract matching video results.
*   **Deep Data Extraction:** Captures comprehensive video details including:
    *   **Video ID & URL**
    *   **Description & Hashtags**
    *   **Author Info:** Username, nickname, avatar, verified status
    *   **Engagement Stats:** Plays, likes, shares, comments, saves
    *   **Video Metadata:** Duration, resolution, cover image
    *   **Music Info:** Title, author, album
    *   **Download URLs:** Direct video play and download links
*   **Multiple Queries:** Run multiple search queries in a single Actor run.
*   **Proxy Support:** Built-in support for Apify Proxy (Residential) to handle TikTok's anti-bot protections.

---

### Input Parameters

The Actor accepts a simple JSON input to control the scraping logic:

| Field | Type | Description |
| :--- | :--- | :--- |
| `searchQueries` | Array of strings | **Required.** List of keywords to search on TikTok. Each query returns matching video results. |
| `maxItems` | Number | **Optional.** Maximum number of videos to scrape per search query. Default: `5`. Free users are limited to 20 items per run. |
| `proxyConfiguration` | Object | **Optional.** Proxy settings. Residential proxies are recommended for reliable access to TikTok. |

#### Example Input

```json
{
    "searchQueries": ["funny cats", "cooking recipes"],
    "maxItems": 10,
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": ["RESIDENTIAL"],
        "apifyProxyCountry": "US"
    }
}
````

***

### Output Data

The scraper stores results in the default dataset. You can download the data in JSON, CSV, Excel, or XML formats.

#### Sample Output (JSON)

```json
{
    "id": "7345678901234567890",
    "url": "https://www.tiktok.com/@username/video/7345678901234567890",
    "description": "The funniest cat compilation you'll ever see #funnycats #catsoftiktok",
    "createTime": "2024-03-15T12:30:00.000Z",
    "author": {
        "id": "123456789",
        "uniqueId": "username",
        "nickname": "Cat Lover",
        "avatar": "https://p16-sign.tiktokcdn-us.com/...",
        "signature": "Sharing the best cat content",
        "verified": false
    },
    "video": {
        "duration": 45,
        "ratio": "720p",
        "cover": "https://p16-sign.tiktokcdn-us.com/...",
        "playUrl": "https://v16-webapp.tiktok.com/...",
        "downloadUrl": "https://v16-webapp.tiktok.com/...",
        "bitrate": 1048576
    },
    "stats": {
        "likes": 125000,
        "shares": 5400,
        "comments": 3200,
        "plays": 2500000,
        "saves": 15000
    },
    "music": {
        "title": "Original Sound",
        "author": "username",
        "album": null
    },
    "hashtags": ["funnycats", "catsoftiktok"],
    "searchQuery": "funny cats",
    "rank": 1,
    "crawl_status": "success",
    "error_reason": null,
    "crawled_at": "2024-03-20T10:00:00.000Z"
}
```

***

### Tips for Best Results

- **Use specific keywords** for more targeted results (e.g., "vegan meal prep" instead of "food").
- **Residential proxies are recommended** since TikTok actively blocks datacenter IPs.
- **Start with a small `maxItems`** value to test before running large scrapes.
- **Free tier** is limited to 20 results per run. Subscribe to unlock unlimited scraping.

***

### Related Scrapers

- [tiktok trend researcher](https://apify.com/logical_scrapers/tiktok-trend-researcher)
- [tiktok comments scraper](https://apify.com/logical_scrapers/tiktok-comments-api)
- [tiktok realtime post details scraper](https://apify.com/logical_scrapers/tiktok-realtime-post-details-scraper)

***

### Support & Feedback

Got any feedback or custom inquiries?

Email: coredev.dan@gmail.com

If you encounter any issues or have feature requests, please check the "Issues" tab on the Actor page.

# Actor input Schema

## `searchQueries` (type: `array`):

List of keywords to search on TikTok. Each query will return matching video results.

## `maxItems` (type: `integer`):

Maximum number of videos to scrape per search query. Free users are limited to 20 items per run. Subscribe to the Actor to unlock unlimited results.

## `proxyConfiguration` (type: `object`):

Proxy configuration for the scraper. TikTok requires residential proxies for reliable access.

## Actor input object example

```json
{
  "searchQueries": [
    "funny cats",
    "cooking recipes"
  ],
  "maxItems": 5,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

## `overview` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "searchQueries": [
        "funny cats",
        "cooking recipes"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("logical_scrapers/tiktok-search-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "searchQueries": [
        "funny cats",
        "cooking recipes",
    ],
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("logical_scrapers/tiktok-search-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "searchQueries": [
    "funny cats",
    "cooking recipes"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call logical_scrapers/tiktok-search-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=logical_scrapers/tiktok-search-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Tiktok Search Scraper",
        "description": "High-performance Apify Actor that searches TikTok for any keyword and extracts detailed video data from the results. Track trending content, analyze competitor strategies, monitor brand mentions, or research hashtags, this scraper delivers accurate, structured data in JSON, CSV, or Excel formats.",
        "version": "1.0",
        "x-build-id": "nKmMskRQaOZrpgWve"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/logical_scrapers~tiktok-search-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-logical_scrapers-tiktok-search-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/logical_scrapers~tiktok-search-scraper/runs": {
            "post": {
                "operationId": "runs-sync-logical_scrapers-tiktok-search-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/logical_scrapers~tiktok-search-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-logical_scrapers-tiktok-search-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "searchQueries"
                ],
                "properties": {
                    "searchQueries": {
                        "title": "Search Queries",
                        "type": "array",
                        "description": "List of keywords to search on TikTok. Each query will return matching video results.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "maxItems": {
                        "title": "Max Items",
                        "minimum": 1,
                        "type": "integer",
                        "description": "Maximum number of videos to scrape per search query. Free users are limited to 20 items per run. Subscribe to the Actor to unlock unlimited results.",
                        "default": 5
                    },
                    "proxyConfiguration": {
                        "title": "Proxy Configuration",
                        "type": "object",
                        "description": "Proxy configuration for the scraper. TikTok requires residential proxies for reliable access."
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
