# Tiktok Scraper Pro (`agenscrape/tiktok-scraper-pro`) Actor

A powerful TikTok data extraction tool that helps you gather valuable insights from the platform. Extract user profiles, search for videos by keyword, and discover TikTok creators - all without needing any API keys or authentication.

- **URL**: https://apify.com/agenscrape/tiktok-scraper-pro.md
- **Developed by:** [Agenscrape](https://apify.com/agenscrape) (community)
- **Categories:** Social media, Automation, Lead generation
- **Stats:** 23 total users, 2 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.75 / 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 Scraper - Profiles, Videos & Users

A powerful TikTok data extraction tool that helps you gather valuable insights from the platform. Extract user profiles, search for videos by keyword, and discover TikTok creators - all without needing any API keys or authentication.

### What This Actor Does

This Actor allows you to extract three types of data from TikTok:

#### 1. User Profile Extraction
Get detailed profile information for any public TikTok account including:
- Follower and following counts
- Total likes (hearts) received
- Video count
- Bio/signature
- Verification status
- Avatar images in multiple sizes
- Direct profile URL

#### 2. Video Search
Search TikTok's vast video library by keyword and get:
- Video descriptions and hashtags
- View counts, likes, shares, and comments
- Author information (username, verification status)
- Video duration and creation date
- Cover images and direct video URLs
- Music/sound information

#### 3. User Search
Find TikTok creators matching your search criteria:
- Username and display name
- Follower counts and engagement metrics
- Bio and verification status
- Profile pictures
- Direct links to their profiles

### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `searchType` | string | Yes | Type of search: `userProfile`, `searchVideos`, or `searchUsers` |
| `username` | string | For userProfile | TikTok username without @ (e.g., `tiktok` for @tiktok) |
| `keyword` | string | For search | Search term (e.g., `cooking`, `travel`, `fitness`) |
| `resultsCount` | integer | No | Number of results to return (default: 12, max: 100) |

### Input Examples

#### Get a User Profile
```json
{
    "searchType": "userProfile",
    "username": "charlidamelio"
}
````

#### Search for Videos

```json
{
    "searchType": "searchVideos",
    "keyword": "cooking recipes",
    "resultsCount": 20
}
```

#### Find TikTok Users

```json
{
    "searchType": "searchUsers",
    "keyword": "fitness coach",
    "resultsCount": 15
}
```

### Output Examples

#### User Profile Output

```json
{
    "type": "user_profile",
    "id": "5831967",
    "uniqueId": "charlidamelio",
    "nickname": "charli d'amelio",
    "signature": "hi :)",
    "verified": true,
    "followerCount": 156100000,
    "followingCount": 1284,
    "heartCount": 11700000000,
    "videoCount": 2891,
    "privateAccount": false,
    "avatarThumb": "https://...",
    "avatarMedium": "https://...",
    "avatarLarger": "https://...",
    "webUrl": "https://www.tiktok.com/@charlidamelio"
}
```

#### Video Search Output

```json
{
    "type": "video",
    "id": "7403476867866903841",
    "desc": "Easy pasta recipe everyone should know #cooking #recipe #food",
    "createTime": "2024-08-15 14:30:00",
    "authorId": "6828374829",
    "authorUsername": "home_cook",
    "authorNickname": "Home Cook",
    "authorVerified": false,
    "playCount": 2500000,
    "diggCount": 185000,
    "shareCount": 12500,
    "commentCount": 3200,
    "collectCount": 45000,
    "duration": 58,
    "coverUrl": "https://...",
    "webUrl": "https://www.tiktok.com/@home_cook/video/7403476867866903841"
}
```

#### User Search Output

```json
{
    "type": "user",
    "id": "6892145678",
    "uniqueId": "fitness_pro",
    "nickname": "Fitness Professional",
    "signature": "Certified trainer | Daily workout tips",
    "verified": true,
    "followerCount": 850000,
    "followingCount": 245,
    "heartCount": 15600000,
    "videoCount": 412,
    "avatarThumb": "https://...",
    "webUrl": "https://www.tiktok.com/@fitness_pro"
}
```

### Use Cases

- **Influencer Marketing**: Research potential partners by analyzing their follower counts, engagement, and content style
- **Competitor Analysis**: Monitor competitor accounts and track their growth over time
- **Content Research**: Discover trending videos and popular creators in your niche
- **Market Research**: Understand what content resonates with TikTok audiences
- **Brand Monitoring**: Find mentions and related content about your brand
- **Talent Discovery**: Identify emerging creators before they go viral

### Coming Soon

We're actively developing additional features that are currently in testing:

- **User Videos** - Retrieve all videos from a specific creator
- **Video Comments** - Extract comments from any TikTok video
- **User Followers/Following** - Get complete follower and following lists
- **Hashtag Videos** - Find all videos using a specific hashtag
- **Trending Videos** - Access currently trending content

These features are being optimized for reliability and will be released soon.

### Tips for Best Results

1. **Keep result counts reasonable** - For optimal performance, request 50 or fewer results per run
2. **Use specific keywords** - More specific search terms yield more relevant results
3. **Check account privacy** - Private accounts will return limited data
4. **Handle rate limits** - Space out multiple requests to avoid temporary blocks

### Limitations

- Results depend on TikTok's availability and may vary
- Some accounts may be private and return limited information
- Very high-volume requests may experience rate limiting
- Video download URLs expire after a short period

### Support

If you encounter any issues or have feature requests, please reach out through Apify's support channels or leave a review with your feedback.

# Actor input Schema

## `searchType` (type: `string`):

Type of search to perform: User Profile extracts a single user's profile data, Search Videos finds videos by keyword, Search Users finds users by keyword, Video Comments extracts comments from a specific video.

## `username` (type: `string`):

TikTok username without @ symbol (e.g., 'tiktok' for @tiktok). Required for User Profile search type.

## `keyword` (type: `string`):

Keyword to search for videos or users (e.g., 'cooking', 'dance', 'travel'). Required for Search Videos and Search Users.

## `videoId` (type: `string`):

TikTok video ID (numeric). Required for Video Comments if Video URL is not provided.

## `videoUrl` (type: `string`):

Full TikTok video URL (e.g., https://www.tiktok.com/@username/video/1234567890). Required for Video Comments if Video ID is not provided.

## `resultsCount` (type: `integer`):

Maximum number of results to return.

## `tiktokCookies` (type: `string`):

Optional TikTok cookies string for authenticated access. Format: 'cookie1=value1; cookie2=value2'. Useful for accessing restricted content.

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

Select proxies to use for scraping. Residential proxies are recommended for TikTok.

## Actor input object example

```json
{
  "searchType": "userProfile",
  "username": "tiktok",
  "keyword": "cooking",
  "resultsCount": 5,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# 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 = {
    "searchType": "userProfile",
    "username": "tiktok",
    "keyword": "cooking",
    "resultsCount": 5,
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("agenscrape/tiktok-scraper-pro").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 = {
    "searchType": "userProfile",
    "username": "tiktok",
    "keyword": "cooking",
    "resultsCount": 5,
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("agenscrape/tiktok-scraper-pro").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 '{
  "searchType": "userProfile",
  "username": "tiktok",
  "keyword": "cooking",
  "resultsCount": 5,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call agenscrape/tiktok-scraper-pro --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Tiktok Scraper Pro",
        "description": "A powerful TikTok data extraction tool that helps you gather valuable insights from the platform. Extract user profiles, search for videos by keyword, and discover TikTok creators - all without needing any API keys or authentication.",
        "version": "1.0",
        "x-build-id": "2rFO3usttNRMQQrya"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/agenscrape~tiktok-scraper-pro/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-agenscrape-tiktok-scraper-pro",
                "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/agenscrape~tiktok-scraper-pro/runs": {
            "post": {
                "operationId": "runs-sync-agenscrape-tiktok-scraper-pro",
                "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/agenscrape~tiktok-scraper-pro/run-sync": {
            "post": {
                "operationId": "run-sync-agenscrape-tiktok-scraper-pro",
                "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": [
                    "searchType"
                ],
                "properties": {
                    "searchType": {
                        "title": "Search Type",
                        "enum": [
                            "userProfile",
                            "searchVideos",
                            "searchUsers",
                            "videoComments"
                        ],
                        "type": "string",
                        "description": "Type of search to perform: User Profile extracts a single user's profile data, Search Videos finds videos by keyword, Search Users finds users by keyword, Video Comments extracts comments from a specific video.",
                        "default": "userProfile"
                    },
                    "username": {
                        "title": "Username",
                        "type": "string",
                        "description": "TikTok username without @ symbol (e.g., 'tiktok' for @tiktok). Required for User Profile search type."
                    },
                    "keyword": {
                        "title": "Search Keyword",
                        "type": "string",
                        "description": "Keyword to search for videos or users (e.g., 'cooking', 'dance', 'travel'). Required for Search Videos and Search Users."
                    },
                    "videoId": {
                        "title": "Video ID",
                        "type": "string",
                        "description": "TikTok video ID (numeric). Required for Video Comments if Video URL is not provided."
                    },
                    "videoUrl": {
                        "title": "Video URL",
                        "type": "string",
                        "description": "Full TikTok video URL (e.g., https://www.tiktok.com/@username/video/1234567890). Required for Video Comments if Video ID is not provided."
                    },
                    "resultsCount": {
                        "title": "Results Count",
                        "minimum": 1,
                        "maximum": 100,
                        "type": "integer",
                        "description": "Maximum number of results to return.",
                        "default": 12
                    },
                    "tiktokCookies": {
                        "title": "TikTok Cookies (Optional)",
                        "type": "string",
                        "description": "Optional TikTok cookies string for authenticated access. Format: 'cookie1=value1; cookie2=value2'. Useful for accessing restricted content."
                    },
                    "proxyConfiguration": {
                        "title": "Proxy Configuration",
                        "type": "object",
                        "description": "Select proxies to use for scraping. Residential proxies are recommended for TikTok.",
                        "default": {
                            "useApifyProxy": true,
                            "apifyProxyGroups": [
                                "RESIDENTIAL"
                            ]
                        }
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
