# TikTok Playlist Discovery & Video Order Scraper (`vexaloom-labs/tiktok-playlist-discovery-and-video-order-scraper`) Actor

Scrape TikTok playlists - discover all playlists for a profile, get playlist metadata, and extract all videos. Supports playlist URLs, IDs, and profile URLs. No cookies required.

- **URL**: https://apify.com/vexaloom-labs/tiktok-playlist-discovery-and-video-order-scraper.md
- **Developed by:** [vexaloom-labs](https://apify.com/vexaloom-labs) (community)
- **Categories:** Social media, Videos, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.49 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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 Playlist & Collection Scraper

Collect every public video in a TikTok playlist or collection, in the creator's order, plus the playlist details that make the data usable: cover image, owner, owner stats, view/like/comment counts, sound metadata, media URLs, hashtags, mentions and slideshow images.

Give it a playlist URL, a collection URL, a numeric ID, a profile URL or a plain `@handle`. It returns one row per playlist or collection, one row per video, and clear status rows when a target cannot be read. No login, cookies or proxy setup are needed.

### What this actor does

- Scrapes **playlists** (`/@user/playlist/...`) and **public collections** (`/@user/collection/...`)
- Accepts full URLs, numeric playlist/collection IDs, profile URLs and handles — mix them in one run
- Returns the **full ordered video list**, not just the first visible page
- Discovers every public playlist on a profile, up to a limit you set
- Adds the playlist cover, creator identity, creator stats, `shareMeta` for collections and a `scrapedAt` timestamp
- Captures slideshow posts as slideshows with their ordered image URLs
- Reports invalid, private, empty, blocked and partial targets as `rowType: "status"` rows
- Deduplicates videos by post ID and omits empty fields at every depth

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `playlistUrls` | string\[] | – | Playlist URLs. Collection URLs pasted here are detected automatically. |
| `playlistIds` | string\[] | — | Numeric playlist IDs (15–20 digits). A collection ID is retried on the collection route. |
| `collectionUrls` | string\[] | — | Public collection URLs. |
| `collectionIds` | string\[] | — | Numeric collection IDs. |
| `profileUrls` | string\[] | — | Profile URLs; every public playlist on the profile is discovered. |
| `usernames` | string\[] | — | Handles with or without `@`. |
| `mode` | select | `both` | `metadata`, `posts` or `both`. |
| `maxPostsPerPlaylist` | integer | 100 | Videos per playlist/collection (1–5000). Raise it for large playlists. |
| `maxPlaylistsPerProfile` | integer | 20 | Playlists processed per profile (1–100). |
| `maxItems` | integer | 0 | Global row cap across all targets and status rows. `0` means no cap. |

#### Example: one playlist, metadata only

```json
{
  "playlistUrls": ["https://www.tiktok.com/@natgeo/playlist/Cinematic-7509464647364283178"],
  "mode": "metadata",
  "maxPostsPerPlaylist": 1
}
```

#### Example: full playlist in creator order

```json
{
  "playlistUrls": ["https://www.tiktok.com/@natgeo/playlist/Cinematic-7509464647364283178"],
  "mode": "posts",
  "maxPostsPerPlaylist": 500
}
```

#### Example: a public collection by URL or ID

```json
{
  "collectionUrls": ["https://www.tiktok.com/@aubreyisamess/collection/places%20to%20go-7154034669288196891"],
  "mode": "both",
  "maxPostsPerPlaylist": 1000
}
```

#### Example: discover a profile's playlists

```json
{
  "usernames": ["natgeo"],
  "mode": "metadata",
  "maxPlaylistsPerProfile": 20
}
```

#### Example: mixed targets with a global cap

```json
{
  "playlistIds": ["7509464647364283178"],
  "collectionIds": ["7154034669288196891"],
  "usernames": ["natgeo"],
  "mode": "both",
  "maxPostsPerPlaylist": 500,
  "maxPlaylistsPerProfile": 5,
  "maxItems": 250
}
```

### Output

All rows share `rowType`, `scrapedAt` and (when applicable) `playlistId`, `playlistName`, `playlistType` and `playlistUrl`.

#### Playlist / collection row (`rowType: "playlist"`)

- `playlistType` — `"playlist"` or `"collection"`
- `playlistId`, `playlistName`, `videoCount`
- `playlistUrl` — canonical TikTok URL
- `playlistCoverUrl` and `coverThumbnailUrl` — cover image (signed, expiring)
- `coverPostId` — only when TikTok names a cover video
- `creatorId`, `creatorUsername`, `creatorDisplayName`, `creatorVerified`, `creatorAvatarUrl`
- `creatorStats` — `followerCount`, `followingCount`, `heartCount`, `videoCount`
- `shareMeta` — `title` and `desc` for public collections
- `scrapedAt` — ISO 8601 UTC timestamp

#### Video row (`rowType: "post"`)

- `playlistId`, `playlistName`, `playlistType`, `playlistUrl`, `positionInPlaylist` (zero-based, source order)
- `postId`, `postType` (`video` or `slideshow`), `postUrl`
- `caption`, `textLanguage`, `createTime`, `createdAt`
- `playCount`, `likeCount`, `commentCount`, `shareCount`, `collectCount`, `repostCount`
- `commentStatus`, `shareEnabled`, `duetEnabled`, `stitchEnabled`
- `isAd`, `isECVideo`, `privateItem`, `forFriend`, `originalItem`, `isAigc`, `AIGCDescription`
- `author` — ID, secure ID, username, display name, bio, verified, avatar, follower/following/heart/video counts
- `music` — ID, title, author, duration, original flag, cover URL and play URL when TikTok exposes it
- `video` — dimensions, duration, ratio, definition, codec, bitrate info, play/download/cover URLs
- `images` — ordered slideshow images with width, height and URL list
- `hashtags`, `mentions`
- `mediaUrlExpiresAt` — when signed video/cover URLs expire
- `scrapedAt`

#### Status row (`rowType: "status"`)

- `status` — `invalid`, `not_found`, `private`, `empty`, `blocked` or `partial`
- `input` — the URL, ID or handle that produced the row
- `playlistId`, `playlistName`, `playlistType` when known
- `message` — plain-language explanation
- `scrapedAt`

### Ordering and completeness

`positionInPlaylist` follows the order TikTok serves for that playlist or collection. It is not sorted by publish date, because creators deliberately order series, tutorials and trip lists. Every page is read until the source reports no more videos or your `maxPostsPerPlaylist` / `maxItems` limit is reached.

Collections can report more videos than are publicly accessible (deleted, private or region-locked items are still counted). The actor returns every accessible video once and never invents filler rows.

### Use cases

- Archiving a creator's series before videos disappear
- Researching how publishers group content into themed playlists
- Auditing collection-based campaigns and their engagement
- Building ordered video libraries from travel, education or recipe collections
- Tracking creator output, follower growth and playlist size over time
- Feeding ordered short-form video datasets into a CMS, dashboard or model

### FAQ

**Do I need cookies or a login?**
No. The actor reads public pages without credentials.

**Do I need to configure a proxy?**
No. The actor chooses its own connection automatically.

**Why is `positionInPlaylist` not sorted by date?**
Playlists and collections have a creator-defined order. The position preserves that order, which is usually the point of scraping a playlist.

**How many videos will I get?**
All publicly accessible videos, up to `maxPostsPerPlaylist` per target and `maxItems` overall. A playlist reported as 34 videos with 34 public items returns 34 rows.

**Why does a collection say 651 videos but return fewer?**
TikTok counts unavailable entries in the collection total. Only publicly accessible videos can be returned.

**What happens with a bad or private target?**
The run finishes successfully and emits a status row explaining the outcome instead of a fake playlist row.

**Are the video and image URLs permanent?**
No. TikTok's CDN URLs are signed and expire after a few hours. Use `postUrl` as the stable reference and re-run when you need fresh media URLs.

**Can I combine playlists, collections and profiles in one run?**
Yes. Add any mix of the input arrays. Duplicate targets are processed once.

**What does `maxItems` count?**
Every dataset row, including playlist, video and status rows.

# Actor input Schema

## `playlistUrls` (type: `array`):

Playlist URLs, e.g. https://www.tiktok.com/@natgeo/playlist/Cinematic-7509464647364283178. Collection URLs pasted here are detected automatically.

## `playlistIds` (type: `array`):

Numeric TikTok playlist IDs (15–20 digits). If an ID belongs to a public collection, the collection route is tried automatically.

## `collectionUrls` (type: `array`):

Public collection URLs, e.g. https://www.tiktok.com/@user/collection/places-to-go-7154034669288196891.

## `collectionIds` (type: `array`):

Numeric TikTok collection IDs (15–20 digits).

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

TikTok profile URLs. Every public playlist on each profile is discovered, up to the per-profile limit.

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

TikTok handles with or without @. Every public playlist on each profile is discovered.

## `mode` (type: `string`):

Return playlist/collection metadata rows, video rows, or both.

## `maxPostsPerPlaylist` (type: `integer`):

Maximum videos to return from each playlist or collection. Set high enough to cover the full list.

## `maxPlaylistsPerProfile` (type: `integer`):

Maximum playlists to process for each profile or username target.

## `maxItems` (type: `integer`):

Stop after this many dataset rows across all targets, including status rows. Use 0 for no global limit.

## Actor input object example

```json
{
  "playlistUrls": [
    "https://www.tiktok.com/@natgeo/playlist/Cinematic-7509464647364283178"
  ],
  "mode": "metadata",
  "maxPostsPerPlaylist": 1,
  "maxPlaylistsPerProfile": 1,
  "maxItems": 1
}
```

# Actor output Schema

## `playlistsAndVideos` (type: `string`):

Dataset containing playlist/collection rows, ordered video rows and status rows.

# 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 = {
    "playlistUrls": [
        "https://www.tiktok.com/@natgeo/playlist/Cinematic-7509464647364283178"
    ],
    "mode": "metadata",
    "maxPostsPerPlaylist": 1,
    "maxPlaylistsPerProfile": 1,
    "maxItems": 1
};

// Run the Actor and wait for it to finish
const run = await client.actor("vexaloom-labs/tiktok-playlist-discovery-and-video-order-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 = {
    "playlistUrls": ["https://www.tiktok.com/@natgeo/playlist/Cinematic-7509464647364283178"],
    "mode": "metadata",
    "maxPostsPerPlaylist": 1,
    "maxPlaylistsPerProfile": 1,
    "maxItems": 1,
}

# Run the Actor and wait for it to finish
run = client.actor("vexaloom-labs/tiktok-playlist-discovery-and-video-order-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 '{
  "playlistUrls": [
    "https://www.tiktok.com/@natgeo/playlist/Cinematic-7509464647364283178"
  ],
  "mode": "metadata",
  "maxPostsPerPlaylist": 1,
  "maxPlaylistsPerProfile": 1,
  "maxItems": 1
}' |
apify call vexaloom-labs/tiktok-playlist-discovery-and-video-order-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,vexaloom-labs/tiktok-playlist-discovery-and-video-order-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/qozsOy4Z8clHa7QIw/builds/Dawm0G9OaKftgReSB/openapi.json
