# TikTok Search API 🔥 (`sentry/tiktok-search-api`) Actor

The fastest and cheapest way to search TikTok by keyword. Extract video data, engagement stats, and creator info.

- **URL**: https://apify.com/sentry/tiktok-search-api.md
- **Developed by:** [Sentry](https://apify.com/sentry) (community)
- **Categories:** Social media, Videos, Automation
- **Stats:** 38 total users, 19 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $0.25 / 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 web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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 API & Video Scraper 🔥

Search TikTok by keyword and extract structured video, creator, hashtag, music, and engagement data programmatically. Use this Actor as a TikTok search API, TikTok video scraper, creator research tool, or data source for trend analysis and social listening.

***

### Data returned

For every video matching your search keywords:

| Field | Description |
|---|---|
| `url` | Direct link to the TikTok video |
| `desc` | Full caption / description |
| `createdAt` | Upload date (ISO 8601) |
| `cover` | Thumbnail image URL |
| `dynamicCover` | Animated thumbnail URL |
| `videoUrl` | Playable video URL |
| `duration` | Video length in seconds |
| `author` | Username (`@handle`) |
| `nickname` | Display name |
| `verified` | Verified account status |
| `avatar` | Profile picture URL |
| `followers` | Follower count |
| `following` | Following count |
| `videoCount` | Total videos published |
| `plays` | View count |
| `likes` | Like count |
| `comments` | Comment count |
| `shares` | Share count |
| `bookmarks` | Save/bookmark count |
| `hashtags` | Array of hashtag strings |
| `musicTitle` | Background track name |
| `musicAuthor` | Music creator |
| `musicUrl` | Music playback URL |
| `keyword` | Search keyword that matched this video |
| `id` | TikTok video ID |
| `embedUrl` | Embeddable player URL |

***

### Input

```json
{
  "keywords": ["cosplay", "street food", "gym motivation"],
  "maxVideosPerKeyword": 100,
  "maxVideosTotal": 1000,
  "sortOrder": "mostRecent",
  "datePosted": "thisMonth"
}
```

| Parameter | Type | Default | Description |
|---|---|---|---|
| `keywords` | string\[] | — | One or more search terms. Required. |
| `maxVideosPerKeyword` | integer | 100 | Cap per keyword — set as high as you need |
| `maxVideosTotal` | integer | 1000 | Hard cap across all keywords combined |
| `sortOrder` | string | `relevance` | `relevance`, `mostRecent`, or `mostViews` |
| `datePosted` | string | `allTime` | `allTime`, `today`, `thisWeek`, `thisMonth`, `3months`, `6months` |
| `includePhotoPosts` | boolean | false | Include photo carousel posts alongside videos |
| `sessionCookie` | string | — | Advanced: your own TikTok session for personalised results |

***

### Output example

```json
{
  "keyword": "cosplay",
  "id": "7384920183746251051",
  "url": "https://www.tiktok.com/@mayacosplays/video/7384920183746251051",
  "desc": "POV: you spent 3 months on this armor #cosplay #anime #handmade",
  "createdAt": "2024-06-15T14:22:10Z",
  "duration": 28,
  "cover": "https://p16-sign.tiktokcdn-us.com/...",
  "author": "mayacosplays",
  "nickname": "Maya Cosplays",
  "verified": false,
  "followers": 284000,
  "following": 412,
  "plays": 1820000,
  "likes": 94300,
  "comments": 1240,
  "shares": 8700,
  "bookmarks": 12500,
  "hashtags": ["cosplay", "anime", "handmade"],
  "musicTitle": "original sound",
  "musicAuthor": "mayacosplays"
}
```

***

### Use cases

**Content research** — find what's trending in any niche right now, filtered by date or sorted by views.

**Influencer discovery** — search by topic and filter by engagement metrics and follower counts to find creators worth reaching out to.

**Competitor monitoring** — track what videos are being published in your space, who's gaining traction, and how audiences are responding.

**Market research** — monitor search volume and sentiment around a brand, product, or category over time.

**Social listening** — track keywords, hashtags, and topics across TikTok at scale.

**Dataset building** — collect labeled TikTok video data for machine learning, classification, or analysis projects.

**Trend detection** — pull recent videos on a keyword and watch engagement patterns to catch rising topics early.

***

### Pricing

Pricing is usage-based: you pay for the results collected, plus the small Actor Start event shown on the Actor page. This keeps costs predictable for both targeted searches and larger keyword batches.

***

### FAQ

**Is there an official TikTok search API?**
TikTok's developer API does not expose search. This actor provides the same programmatic access to TikTok search results that TikTok's API never offered — structured, typed data ready to use without any parsing.

**What happened to the TikTok developer API?**
TikTok restricted and eventually shut down most of their public developer API access. This actor is designed specifically to fill that gap for developers and researchers who need TikTok search data programmatically.

**How fast is it?**
Around 3–5 seconds for 100 results. Multiple keywords are searched in a single run with results sorted globally at the end.

**How does the cost compare to other TikTok scrapers?**
The lightweight pay-per-result model is designed for fast, cost-efficient keyword searches. Check the current pricing table on the Actor page for the exact per-result rate.

**Does it require a TikTok account or login?**
No. It works without any credentials by default.

**Does it require a proxy?**
No proxy configuration is required from you.

**How many results can I get per keyword?**
It depends entirely on how many results TikTok has indexed for that search term — some keywords return dozens, others return thousands. The actor paginates automatically until TikTok has no more results or your limit is reached. Set `maxVideosPerKeyword` as high as you need.

**Can I search multiple keywords at once?**
Yes — pass an array and every keyword is searched in one run, with all results combined into a single dataset.

**Can I filter by date or sort by views?**
Yes. Use `datePosted` to filter to recent content (today, this week, this month, 3 months, 6 months) and `sortOrder` to sort by most recent or most viewed.

**How fresh are the results?**
Results come directly from TikTok's live search index — the same videos you'd see searching on TikTok.com at that moment.

**Are follower counts and engagement stats accurate?**
Yes. All numeric fields are real integers, not strings or approximations. Follower counts, view counts, like counts, and comment counts are exact values as returned by TikTok.

**What regions does it cover?**
Defaults to US region results. TikTok's search index includes global public content.

**Is the data ready to use without further processing?**
Yes. Every field is typed — integers are integers, dates are ISO 8601 strings, booleans are booleans. Drop it straight into a spreadsheet, database, or downstream API.

# Actor input Schema

## `keywords` (type: `array`):

One or more search keywords. Each keyword is searched independently and results are combined in the dataset.

## `includePhotoPosts` (type: `boolean`):

Include photo carousels (slideshow posts) alongside videos. By default only videos are returned.

## `sortOrder` (type: `string`):

Sort results by relevance (default), most recent upload, or most views.

## `datePosted` (type: `string`):

Only return videos posted within this time window. Applied after fetching — narrow filters may return fewer results than the max.

## `maxVideosPerKeyword` (type: `integer`):

Maximum number of videos to collect per keyword. Actual results depend on how many TikTok has indexed for that search term.

## `maxVideosTotal` (type: `integer`):

Hard cap across all keywords combined.

## `sessionCookie` (type: `string`):

Advanced: override the default session with your own TikTok sessionid. Useful if you want results personalized to your account or region. Find it in Chrome DevTools → Application → Cookies → tiktok.com → sessionid. Leave blank to use the built-in default.

## Actor input object example

```json
{
  "keywords": [
    "anime",
    "cosplay"
  ],
  "includePhotoPosts": false,
  "sortOrder": "relevance",
  "datePosted": "allTime",
  "maxVideosPerKeyword": 100,
  "maxVideosTotal": 1000
}
```

# Actor output Schema

## `dataset` (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 = {
    "keywords": [
        "anime",
        "cosplay"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("sentry/tiktok-search-api").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 = { "keywords": [
        "anime",
        "cosplay",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("sentry/tiktok-search-api").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 '{
  "keywords": [
    "anime",
    "cosplay"
  ]
}' |
apify call sentry/tiktok-search-api --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/1SpIR6vF0cL8oUfaU/builds/M2WzeSfOP6V0wnPWn/openapi.json
