# TikTok Profile Posts Scraper (`outspoken_strategy/tiktok-profile-posts-scraper`) Actor

Paste a TikTok profile URL and get that account's videos for any period. Date-range filtering, multi-profile input, auto-pagination. Returns description, author, likes, comments, shares, plays, cover and video URL.

- **URL**: https://apify.com/outspoken\_strategy/tiktok-profile-posts-scraper.md
- **Developed by:** [code craker](https://apify.com/outspoken_strategy) (community)
- **Categories:** Social media, News, Other
- **Stats:** 1 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $20.00 / 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/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

## TikTok Profile Posts Scraper

Paste a TikTok profile URL and get that account's videos as structured data — description, author, publish date, likes, comments, shares, plays, cover image and the video URL. Supports several profiles per run, a date range, and auto-pagination.

### Input

| Field | Description |
| --- | --- |
| `profileUrl` | One profile: a full URL (`https://www.tiktok.com/@tiktok`), an `@handle`, a bare handle, or any video URL on the profile. Several profiles can be pasted one per line. |
| `profileUrls` | Several profiles as an array. `numberOfPosts` applies **per profile**. |
| `numberOfPosts` | Maximum videos to return per profile (default 100). |
| `scrapeAll` | Keep scrolling/paginating until the target count, the date range boundary, or the end of the feed (default on). |
| `timeSince` / `timeUntil` | Inclusive date range (`yyyy-mm-dd`, UTC). The actor stops scrolling once the feed passes below `timeSince`. |
| `cookies` | Optional logged-in TikTok session (JSON cookie export). See **Authentication** below. |
| `proxyConfiguration` | Defaults to Apify RESIDENTIAL proxy with US exits — TikTok blocks datacenter IPs. |

### Authentication (optional but recommended)

TikTok answers the profile feed API for logged-out visitors with **empty responses**, no matter how clean the IP. The actor handles both cases:

- **With a session** (the `cookies` input, or a `TIKTOK_COOKIES` secret environment variable on the actor — a JSON cookie export or a `name=value; name2=value2` string): the full profile feed is scraped with pagination, up to `numberOfPosts` videos per profile.
- **Without a session**: the actor falls back to the profile's public **embed widget**, which reliably serves roughly the **10 newest videos** per profile, and enriches each with its full engagement stats from the video's own page.

Always use a throwaway TikTok account for cookies, never a personal one.

### Output

One dataset item per video:

```json
{
    "id": "7676134473112489247",
    "webVideoUrl": "https://www.tiktok.com/@tiktok/video/7676134473112489247",
    "text": "why do fans keep posting 🥚 ...",
    "created_at": "2026-08-20T15:22:21.000Z",
    "author": { "uniqueId": "tiktok", "username": "tiktok", "nickname": "TikTok", "id": "107955", "profileUrl": "https://www.tiktok.com/@tiktok" },
    "likesCount": 5938,
    "commentsCount": 1697,
    "sharesCount": 210,
    "viewsCount": 332000,
    "collectCount": 415,
    "duration": 34,
    "coverUrl": "https://...",
    "musicName": "original sound",
    "hashtags": ["fyp"],
    "profileHandle": "tiktok",
    "profileUrl": "https://www.tiktok.com/@tiktok"
}
```

Engagement fields also carry snake\_case and camelCase aliases (`digg_count`/`diggCount`, `play_count`/`playCount`, ...) so the items are a drop-in replacement for common TikTok actor outputs.

### Tips

- A private, banned or nonexistent profile is skipped with a warning instead of failing the run.
- For date-bounded monitoring (e.g. "last 7 days"), set `timeSince` — the actor stops scrolling as soon as the feed passes the boundary.
- Check `DEBUG_SCREENSHOT` / `DEBUG_HTML` in the run's key-value store when a run returns nothing.

# Actor input Schema

## `profileUrl` (type: `string`):

The TikTok profile to scrape, e.g. https://www.tiktok.com/@tiktok. An @handle or a bare handle also works, and so does any video URL on the profile (it is resolved to its author). You can paste several profiles, one per line. For a clean list use "profileUrls" below instead.

## `profileUrls` (type: `array`):

Several profiles to scrape — each is scraped separately and the results are combined. "Number of videos" applies PER profile.

## `numberOfPosts` (type: `integer`):

Maximum number of videos to return per profile (after date filtering).

## `scrapeAll` (type: `boolean`):

Keep scrolling until the target count is reached, the date range is passed, or the feed runs dry. When unchecked only the videos on the initial page load are returned.

## `timeSince` (type: `string`):

Only return videos published on or after this date (format: yyyy-mm-dd). Inclusive.

## `timeUntil` (type: `string`):

Only return videos published on or before this date (format: yyyy-mm-dd). Inclusive.

## `cookies` (type: `array`):

Cookies of a logged-in TikTok session, exported with a browser extension such as Cookie-Editor (JSON array of {name, value, domain, ...}). Alternatively set the TIKTOK\_COOKIES secret environment variable on the actor (same JSON, or a 'name=value; name2=value2' string). Use a throwaway account, never your personal one.

## `region` (type: `string`):

Country code used for the proxy exit IPs when the proxy configuration has no country of its own (e.g. "US", "GB", "ZA").

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

Proxy to route traffic through. RESIDENTIAL proxies with a country set are strongly recommended — TikTok blocks datacenter IPs and flags many anonymous exits.

## `headless` (type: `boolean`):

Uncheck to run a headed browser (useful only for local debugging).

## Actor input object example

```json
{
  "profileUrl": "https://www.tiktok.com/@tiktok",
  "profileUrls": [],
  "numberOfPosts": 100,
  "scrapeAll": true,
  "region": "US",
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "US"
  },
  "headless": true
}
```

# Actor output Schema

## `videos` (type: `string`):

The scraped videos as dataset items — one item per video, with description, author, publish date, engagement counts (likes, comments, shares, plays) and the video URL.

# 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 = {
    "profileUrl": "https://www.tiktok.com/@tiktok",
    "profileUrls": [],
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ],
        "apifyProxyCountry": "US"
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("outspoken_strategy/tiktok-profile-posts-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 = {
    "profileUrl": "https://www.tiktok.com/@tiktok",
    "profileUrls": [],
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
        "apifyProxyCountry": "US",
    },
}

# Run the Actor and wait for it to finish
run = client.actor("outspoken_strategy/tiktok-profile-posts-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 '{
  "profileUrl": "https://www.tiktok.com/@tiktok",
  "profileUrls": [],
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "US"
  }
}' |
apify call outspoken_strategy/tiktok-profile-posts-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,outspoken_strategy/tiktok-profile-posts-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/OnxAT7by5Cme9sznR/builds/UYC5Qa2UOZPRSiRlS/openapi.json
