# 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:** 7 total users, 4 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 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 API 🔥

Search TikTok by keyword and extract structured video data programmatically. The fastest and most affordable way to get TikTok search results on Apify — and a practical replacement for TikTok's deprecated developer API.

---

### 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

Charged per result — no minimum run fee, no flat cost per execution. You pay for what you collect and nothing more. At current rates, this is the lowest cost-per-result of any TikTok search scraper on Apify.

***

### 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?**
This actor consistently runs faster and costs less per result than alternatives on Apify. Because it requires no proxy and no browser, overhead is minimal and that saving passes directly to your bill.

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

**Does it require a proxy?**
No. It runs reliably on standard Apify infrastructure without any proxy configuration or added cost.

**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

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "TikTok Search API 🔥",
        "description": "The fastest and cheapest way to search TikTok by keyword. Extract video data, engagement stats, and creator info.",
        "version": "1.0",
        "x-build-id": "8b2dVhbW0yVqngQ5y"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/sentry~tiktok-search-api/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-sentry-tiktok-search-api",
                "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/sentry~tiktok-search-api/runs": {
            "post": {
                "operationId": "runs-sync-sentry-tiktok-search-api",
                "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/sentry~tiktok-search-api/run-sync": {
            "post": {
                "operationId": "run-sync-sentry-tiktok-search-api",
                "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": [
                    "keywords"
                ],
                "properties": {
                    "keywords": {
                        "title": "Search Keywords",
                        "type": "array",
                        "description": "One or more search keywords. Each keyword is searched independently and results are combined in the dataset.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "includePhotoPosts": {
                        "title": "Include Photo Posts",
                        "type": "boolean",
                        "description": "Include photo carousels (slideshow posts) alongside videos. By default only videos are returned.",
                        "default": false
                    },
                    "sortOrder": {
                        "title": "Sort Order",
                        "enum": [
                            "relevance",
                            "mostRecent",
                            "mostViews"
                        ],
                        "type": "string",
                        "description": "Sort results by relevance (default), most recent upload, or most views.",
                        "default": "relevance"
                    },
                    "datePosted": {
                        "title": "Date Posted",
                        "enum": [
                            "allTime",
                            "today",
                            "thisWeek",
                            "thisMonth",
                            "3months",
                            "6months"
                        ],
                        "type": "string",
                        "description": "Only return videos posted within this time window. Applied after fetching — narrow filters may return fewer results than the max.",
                        "default": "allTime"
                    },
                    "maxVideosPerKeyword": {
                        "title": "Max Videos per Keyword",
                        "minimum": 1,
                        "type": "integer",
                        "description": "Maximum number of videos to collect per keyword. Actual results depend on how many TikTok has indexed for that search term.",
                        "default": 100
                    },
                    "maxVideosTotal": {
                        "title": "Max Videos Total",
                        "minimum": 1,
                        "type": "integer",
                        "description": "Hard cap across all keywords combined.",
                        "default": 1000
                    },
                    "sessionCookie": {
                        "title": "Custom Session Cookie (Advanced)",
                        "type": "string",
                        "description": "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."
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
