# TikTok Public Profile & Video Scraper (`woundless_yellowwood/tiktok-public-profile-scraper`) Actor

Extract public profile info and recent public video metadata from any TikTok username. No login, no API key, private accounts always skipped.

- **URL**: https://apify.com/woundless\_yellowwood/tiktok-public-profile-scraper.md
- **Developed by:** [Proyecto Apify](https://apify.com/woundless_yellowwood) (community)
- **Categories:** Social media, Videos, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

## 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 Public Profile & Video Scraper

Give it any public TikTok username and get back structured profile and video data — no login, no API key, no bypassing privacy. Private accounts are detected and skipped with a clear log entry, never bypassed.

### What it does

For each TikTok username or profile URL you provide, the Actor:

1. Navigates to `https://www.tiktok.com/@<username>` with a realistic browser fingerprint (rotating User-Agent, viewport, locale) and Apify's proxy configuration.
2. Extracts **profile-level data**: username, display name, bio, follower count, following count, total likes, video count, private/public flag, verified badge, avatar URL.
3. If the profile is public and `includeVideoDetails` is true, scrolls the video grid to load up to `maxVideosPerProfile` videos and extracts per-video metadata: video URL, caption, view/like/comment/share counts, duration (seconds), publish date, and extracted hashtags.
4. Deduplicates videos by URL within a single run.
5. Detects and cleanly handles blocking states: CAPTCHA, login wall, rate limit, not-found, and private accounts — emitting a flagged row rather than crashing.

### Input

| Field | Type | Default | Description |
|-------|------|---------|-------------|
| `usernames` | `array<string>` | `["tiktok"]` | TikTok usernames or full profile URLs (mixed input OK). |
| `maxVideosPerProfile` | `integer` | `20` | Cap on videos per public profile (1–200). |
| `includeVideoDetails` | `boolean` | `true` | If `false`, returns profile-level data only. |
| `resultsType` | `"profiles"` | `"profiles+videos"` | `"profiles+videos"` | Output scope hint. `"profiles"` forces profile-only. |
| `maxRequestRetries` | `integer` | `3` | Retries per failed profile page. |
| `scrollDelayMs` | `integer` | `1500` | Base delay between scrolls (jittered ±50%). |
| `proxyConfiguration` | `object` | Residential Apify proxy | **Required for production runs.** TikTok blocks datacenter IPs within a few requests. |

### Output

One dataset row per profile, schema declared in `actor.json`:

```json
{
  "username": "tiktok",
  "displayName": "TikTok",
  "bio": "Make Your Day",
  "followerCount": 92000000,
  "followingCount": 0,
  "totalLikes": 350000000,
  "videoCount": 200,
  "isPrivate": false,
  "isVerified": true,
  "avatarUrl": "https://...",
  "profileUrl": "https://www.tiktok.com/@tiktok",
  "extractedAt": "2026-07-27T10:00:00.000Z",
  "status": "ok",
  "error": null,
  "videos": [
    {
      "videoId": "7234567890123456789",
      "videoUrl": "https://www.tiktok.com/@tiktok/video/7234567890123456789",
      "description": "Best moments of the week #tiktok #fyp",
      "hashtags": ["tiktok", "fyp"],
      "viewCount": 1200000,
      "likeCount": 89000,
      "commentCount": 1200,
      "shareCount": 4500,
      "duration": 30,
      "publishDate": "2026-07-20T12:00:00.000Z",
      "coverUrl": "https://..."
    }
  ]
}
```

**Status field values:** `ok` | `private` | `captcha` | `login_wall` | `not_found` | `rate_limited` | `extraction_failed` | `request_failed`.

Private accounts always produce a row with `isPrivate: true`, `status: "private"`, `error: "private account, no public data available"`, and an empty `videos` array.

### Proxy configuration

TikTok is hostile to scraping from datacenter IPs. **Use residential proxies** for any non-trivial run:

```json
{
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": ["RESIDENTIAL"]
  }
}
```

Each profile request uses a fresh browser context with a single-use session, so IP rotation happens automatically.

### Privacy & compliance

- Reads **only publicly visible, non-authenticated data** from TikTok's public web interface.
- **Never** logs in, never sends cookies, never uses session tokens.
- **Never** bypasses privacy controls, CAPTCHAs, or rate limits. Private accounts are detected and skipped.
- **Never** performs engagement actions (no likes, follows, comments, video downloads).
- For research, analytics, brand monitoring, and content analysis. You are responsible for complying with TikTok's Terms of Service and applicable law when using the extracted data.

### Running locally

```bash
npm install
apify run            # uses INPUT_SCHEMA.json prefill
apify run --input ./my-input.json
```

# Actor input Schema

## `usernames` (type: `array`):

List of TikTok usernames (e.g. 'tiktok') or full profile URLs (e.g. 'https://www.tiktok.com/@tiktok'). Mixed input is supported.

## `maxVideosPerProfile` (type: `integer`):

Maximum number of recent public videos to extract per public profile. Capped at 200 to keep runtimes reasonable.

## `includeVideoDetails` (type: `boolean`):

If true, extracts recent video metadata (caption, views, likes, comments, shares, duration, publish date, hashtags). If false, only profile-level data is returned and videos will be an empty array.

## `resultsType` (type: `string`):

Hint to scope the output. 'profiles' forces profile-only output (equivalent to includeVideoDetails=false). 'profiles+videos' returns full extraction. Provided as an explicit hint rather than derived from includeVideoDetails so callers can express intent unambiguously.

## `maxRequestRetries` (type: `integer`):

How many times to retry a profile page that fails to load (timeout, network error, transient CAPTCHA). Each retry uses a fresh browser session and proxy.

## `scrollDelayMs` (type: `integer`):

Base delay between scroll actions when loading more videos. A random jitter of +/-50% is added to each delay to mimic human behavior.

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

Apify proxy configuration. Strongly recommended for TikTok to avoid CAPTCHAs and rate limits. Residential proxies are preferred; datacenter IPs are typically blocked within a few requests.

## Actor input object example

```json
{
  "usernames": [
    "tiktok"
  ],
  "maxVideosPerProfile": 20,
  "includeVideoDetails": true,
  "resultsType": "profiles+videos",
  "maxRequestRetries": 3,
  "scrollDelayMs": 1500,
  "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 = {
    "usernames": [
        "tiktok"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("woundless_yellowwood/tiktok-public-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 = { "usernames": ["tiktok"] }

# Run the Actor and wait for it to finish
run = client.actor("woundless_yellowwood/tiktok-public-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 '{
  "usernames": [
    "tiktok"
  ]
}' |
apify call woundless_yellowwood/tiktok-public-profile-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,woundless_yellowwood/tiktok-public-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/dKRVMwBlMGTTAgB2p/builds/tyLTxg9uIruzby5Mj/openapi.json
