# TikTok Profile & Public Videos Scraper (`spider_studio/tiktok-profile-scraper`) Actor

Resolve public TikTok profiles and fetch one paginated page of their public videos. Pay only for successful profile results.

- **URL**: https://apify.com/spider\_studio/tiktok-profile-scraper.md
- **Developed by:** [NewLai](https://apify.com/spider_studio) (community)
- **Categories:** Automation, Videos, Social media
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$1.20 / 1,000 profile scrapeds

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/actors/running/actors-in-store.md#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

### What does TikTok Profile & Public Videos Scraper do?

TikTok Profile & Public Videos Scraper resolves public [TikTok](https://www.tiktok.com/) profile URLs or usernames and returns the creator's public profile metadata plus one paginated page of public videos. It works as a **TikTok profile API alternative** for public data and also accepts a raw `secUserId` when profile metadata is not needed.

### Why use TikTok Profile & Public Videos Scraper?

- Accept profile URLs, `@usernames`, plain usernames, and raw TikTok `secUserId` values.
- Resolve public creator metadata including nickname, biography, verification status, avatar, and public counters.
- Fetch up to 50 public video records per profile request with TikTok cursor pagination.
- Process multiple profiles concurrently with independent per-profile results.
- Run on a schedule, call the Actor through the Apify API, monitor runs, and export results to Apify integrations.
- Route TikTok traffic through Apify Residential Proxy by default, with support for private proxy deployments.
- **Success-based pricing:** failed, missing, challenged, or unavailable profiles are returned with an error and are not charged.

### What data can TikTok Profile & Public Videos Scraper extract?

| Field | Type | Description |
| --- | --- | --- |
| `profile` | object or null | Normalized public creator identity, avatar, biography, verification, and counters. It is null for direct `secUserId` inputs. |
| `secUserId` | string | TikTok's stable secured user identifier used for video pagination. |
| `items` | array | Raw public TikTok video records returned for the requested page. |
| `hasMore` | boolean | Whether TikTok reports that another page is available. |
| `cursor` | string or integer | Cursor to pass into a later run for the next page. |
| `error` | string or null | A safe per-profile error message. One failed profile does not discard other results. |

### How to scrape TikTok profiles

1. Open the Actor's **Input** tab.
2. Add one or more public TikTok profile URLs, usernames, or `secUserId` values to `profiles`.
3. Leave `cursor` as `0` for the first page and choose a `count` between 1 and 50.
4. Start the run and wait for the Dataset output.
5. If `hasMore` is true, run the Actor again with the returned `cursor` to request the next page.

### How much will it cost to scrape TikTok?

The Actor costs **$1.20 per 1,000 successfully scraped TikTok profiles**
(`$0.0012` per success). A run with 100 successful profile results costs `$0.12`.
Failed, missing, challenged, private, or unavailable profiles still receive a
Dataset row with `success: false`, but they are **not charged**.

Each successful input profile is charged once, regardless of how many video
records TikTok returns in that page. The event price includes Apify platform
usage during the run. Dataset reads and long-term storage after the run remain
subject to Apify's standard platform pricing. A custom proxy can have separate
charges from its provider.

Before publishing, enable **Pay per event** in the Actor's Apify Console
monetization settings and configure the `profile-scraped` event from
`.actor/pay_per_event.json`. Without that platform setting, the SDK safely
ignores charge attempts while still writing Dataset results.

### Input

See the input tab for full configuration options. A typical first-page request is:

```json
{
  "profiles": [
    "https://www.tiktok.com/@gordonramsayofficial",
    "@demo.creator",
    "MS4wLjABAAAA_example_sec_user_id_value"
  ],
  "cursor": "0",
  "count": 21
}
```

### Output

You can download the dataset in various formats such as JSON, HTML, CSV, or Excel. One Dataset item is written for each unique input profile:

```json
{
  "source": "@demo.creator",
  "success": true,
  "profile": {
    "username": "demo.creator",
    "secUserId": "MS4wLjABAAAA...",
    "nickname": "Demo Creator",
    "verified": false,
    "stats": {
      "followers": 1200,
      "following": 50,
      "likes": 8400,
      "videos": 32
    }
  },
  "secUserId": "MS4wLjABAAAA...",
  "items": [{ "aweme_id": "1234567890" }],
  "hasMore": true,
  "cursor": 1720000000000,
  "error": null
}
```

### Tips and advanced options

- Apify Residential Proxy is used by default; private proxy deployments can replace it.
- Challenge or incomplete profile pages are retried immediately with a fresh Apify Proxy session.
- Use moderate concurrency for more stable results when processing large batches.
- A direct `secUserId` skips the public profile-page request and therefore returns `profile: null`.
- The Actor retries temporary TikTok HTTP errors and transient capacity failures.
- A challenge retry creates a fresh HTTP session and, with Apify Residential Proxy, a new proxy session ID so the next attempt can use another IP.

### Related TikTok Actors

- [TikTok Bulk Video Search](https://apify.com/spider_studio/tiktok-video-search) searches public TikTok videos by keyword and returns structured video records.
- [TikTok Video Downloader API - Direct Video URLs](https://apify.com/spider_studio/tiktok-video-resolver) converts TikTok video and short links into direct playback/download URLs and metadata.

### FAQ, disclaimers, and support

#### Does the Actor extract private TikTok data?

No. It requests only public profile and public video information and does not log in to TikTok on behalf of a user.

> Our Actor is designed not to extract private user data such as email addresses, gender, or private location. It only extracts information the user has chosen to share publicly. Results can still contain personal data protected by the GDPR and other laws. Do not scrape personal data without a legitimate reason; consult legal counsel if you are unsure.

Use the Actor's **API** tab for programmatic access. For bugs or feature requests, open the Actor's **Issues** tab and include a sanitized input example and run ID; never include credentials.

# Actor input Schema

## `profiles` (type: `array`):

TikTok profile URLs, @usernames, usernames, or raw secUserIds. Duplicate entries are ignored.

## `cursor` (type: `string`):

Cursor returned by a previous run. Use 0 for the first page.

## `count` (type: `integer`):

Number of public videos requested for each profile in this run.

## Actor input object example

```json
{
  "profiles": [
    "https://www.tiktok.com/@gordonramsayofficial"
  ],
  "cursor": "0",
  "count": 21
}
```

# 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 = {
    "profiles": [
        "https://www.tiktok.com/@gordonramsayofficial"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("spider_studio/tiktok-profile-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 = { "profiles": ["https://www.tiktok.com/@gordonramsayofficial"] }

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

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

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

```

## CLI example

```bash
echo '{
  "profiles": [
    "https://www.tiktok.com/@gordonramsayofficial"
  ]
}' |
apify call spider_studio/tiktok-profile-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,spider_studio/tiktok-profile-scraper"
        }
    }
}

```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/AOXufQjcvHRpoa5MQ/builds/XnfvoRL5avFnXXvf4/openapi.json
