# TikTok Profile & Video Scraper (`bgfc97/tiktok-profile-scraper`) Actor

Scrape any public TikTok profile: followers, following, likes, verified, bio, avatar and recent videos (views, likes, comments, shares, date). No login. Fast via internal data.

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

## Pricing

from $2.40 / 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?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

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

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## TikTok Profile & Videos Scraper

Scrape **public TikTok profiles without login** — bio, avatar, verification status, and follower/following/like/video counts, plus **recent videos** (views, likes, comments, shares) when TikTok includes them in the profile page. Uses browser-grade requests (`got-scraping`) through a **residential proxy**, since TikTok blocks datacenter IPs aggressively.

### Why it's useful

TikTok profile and video stats are in high demand for influencer vetting, competitor tracking, growth monitoring and lead lists — and TikTok has no public API for this. This actor reads the same JSON TikTok's own front-end renders from, giving structured data straight from the source page.

### How it works

1. Fetches `https://www.tiktok.com/@{username}` with realistic browser headers and a residential proxy session.
2. Parses the `<script id="__UNIVERSAL_DATA_FOR_REHYDRATION__">` JSON blob embedded in the HTML (the same data TikTok's React app hydrates from) — no login, no cookies, no signed API calls.
3. Reads `__DEFAULT_SCOPE__["webapp.user-detail"].userInfo` for the profile + stats, and scans the page's other scopes for any embedded video list to build `recent_videos`.
4. If the page is blocked (captcha/403/429) or the JSON isn't found, retries with a **fresh proxy session** up to 5 times. If still blocked, it returns an honest `error` field — it never fabricates data.

### Input

```json
{
  "usernames": ["tiktok", "@nasa", "https://www.tiktok.com/@nasa"],
  "maxVideos": 30,
  "proxyConfiguration": { "useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"] },
  "timeoutSecs": 30
}
```

- `usernames` — required. Handles (`@name`), bare usernames (`name`) or full profile URLs — all normalized automatically.
- `maxVideos` — cap on how many recent videos to keep per profile (0-200, default 30). Videos are only returned when TikTok's page includes them; this never invents entries.
- `proxyConfiguration` — **residential proxy strongly recommended.** TikTok blocks Apify's datacenter IPs almost immediately.
- `timeoutSecs` — per-request timeout (5-90s, default 30).

### Output (per profile)

```json
{
  "username": "nasa",
  "uniqueId": "nasa",
  "nickname": "NASA",
  "signature": "Exploring the universe...",
  "verified": true,
  "privateAccount": false,
  "avatarLarger": "https://...",
  "region": "US",
  "stats": {
    "followerCount": 24000000,
    "followingCount": 12,
    "heartCount": 300000000,
    "videoCount": 900,
    "diggCount": 0
  },
  "recent_videos": [
    {
      "id": "7123456789012345678",
      "desc": "Look at this galaxy 🌌",
      "createTime": "2026-01-15T18:00:00.000Z",
      "stats": { "playCount": 500000, "diggCount": 40000, "commentCount": 1200, "shareCount": 3000 },
      "coverUrl": "https://...",
      "url": "https://www.tiktok.com/@nasa/video/7123456789012345678"
    }
  ],
  "profileUrl": "https://www.tiktok.com/@nasa",
  "scrapedAt": "2026-09-25T12:00:00.000Z"
}
```

On a block after 5 retries, or if the account doesn't exist:

```json
{ "username": "somehandle", "error": "blocked (needs residential proxy): HTTP 403 (attempt 5/5)" }
```

### Notes

- **Recent videos are best-effort.** TikTok often loads a profile's video grid via a separate signed `item_list` endpoint rather than the initial page JSON. When that happens, this actor returns the profile + stats and a `recent_videos_note` explaining it — it does not fake video data.
- Public profiles only. Private accounts return `privateAccount: true` with whatever public fields TikTok exposes (no video data).
- Charges 1 **profile** event per successfully scraped username.

### ⭐ Enjoying this Actor?

A quick **rating/review** helps others find it. Need the item\_list video endpoint wired in too, or hashtag/sound scraping? Open a ticket on the **Issues** tab.

# Actor input Schema

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

TikTok targets to scrape. Accepts @handles (e.g. @nasa), bare usernames (nasa), full profile URLs (https://www.tiktok.com/@nasa), or a single-video URL (https://www.tiktok.com/@user/video/123...). Profiles return profile info (and, if includeVideos is on, recent videos); a video URL returns that one video's stats.

## `includeVideos` (type: `boolean`):

OFF by default. When off, each profile is read from its server-rendered page over plain HTTP (fast and very cheap). When ON, the actor opens a real headless browser so TikTok's own JavaScript fires the signed requests that load the recent-video list — this returns each profile's recent videos but is considerably more expensive to run. Turn it on only when you actually need the videos.

## `maxVideos` (type: `integer`):

Only used when includeVideos is ON. Maximum number of recent videos to return per profile (the browser scrolls to load more via TikTok's item\_list requests until it reaches this number or runs out).

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

Leave on the default and the actor picks the cheapest proxy that works automatically: it tries DATACENTER first for the HTTP profile path (which TikTok serves fine over datacenter IPs) and only falls back to RESIDENTIAL for any target that gets blocked. The video/browser path always uses residential. Pick specific groups here only if you want to force them.

## `timeoutSecs` (type: `integer`):

Navigation timeout per page load, in seconds (15-120).

## Actor input object example

```json
{
  "usernames": [
    "nasa",
    "tiktok"
  ],
  "includeVideos": false,
  "maxVideos": 30,
  "proxyConfiguration": {
    "useApifyProxy": true
  },
  "timeoutSecs": 45
}
```

# Actor output Schema

## `dataset` (type: `string`):

Scrape public TikTok profiles without login: bio, avatar, verification, follower/following/like/video counts, and recent videos with view/like/comment/share counts. Browser-grade requests through residential proxy to handle anti-bot.

# 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": [
        "nasa",
        "tiktok"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

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

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

```

## MCP server setup

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