# TikTok Explore Feed Trending Post Scraper (`nimbryxo-studio/tiktok-explore-feed-trending-post-scraper`) Actor

Collect trending posts from TikTok's Explore feed across one or more content categories, with engagement stats, author snapshot, sound and video details. Can also try to discover category IDs.

- **URL**: https://apify.com/nimbryxo-studio/tiktok-explore-feed-trending-post-scraper.md
- **Developed by:** [Nimbryxo-studio](https://apify.com/nimbryxo-studio) (community)
- **Categories:** Social media, Videos, Other
- **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 Explore Feed Trending Post Scraper

TikTok's Explore tab surfaces whatever its discovery system is currently amplifying, broken out by content category. This actor paginates that feed for one or more categories and returns each trending post with its engagement stats, author snapshot, sound, and video details. Category 123 ("All") works without any extra configuration; an auto-discovery option tries to read the other category IDs from the live Explore page.

### What this actor does

- Accepts a list of category objects (`id` + `name`) and paginates TikTok's Explore feed for each one
- Tags every post with `feedType`, `categoryId`, and `categoryName` so results from multiple categories stay distinguishable
- Deduplicates posts that surface in more than one category so each video is only emitted once per run
- Can try to discover more category IDs by clicking the category tabs on TikTok's live Explore page
- Category 123 ("All") is the default and needs no extra setup
- Fields a post doesn't have (e.g. no detected caption language) are omitted rather than returned empty

### Output per post

- `feedType` — always `explore`
- `categoryId`, `categoryName` — the category this post was collected from (see the FAQ on category IDs)
- `postId`, `postType` (`video` or `slideshow`), `postUrl` — post identity
- `caption`, `textLanguage` — caption text and its detected language
- `locationCreated` — the region code TikTok attaches to the post, when present
- `createTime`, `createdAt` — publication time as a Unix timestamp and ISO 8601 date
- `playCount`, `likeCount`, `commentCount`, `shareCount`, `collectCount`, `repostCount` — engagement counts
- `isAd` — whether the post is marked as an advertisement
- `stitchEnabled`, `duetEnabled`, `shareEnabled` — creator-controlled interaction permissions
- `author.id`, `author.secUid` — author's TikTok IDs
- `author.username`, `author.displayName`, `author.bio` — author profile text
- `author.verified`, `author.privateAccount` — author account flags
- `author.roomId` — present when TikTok reports a live room for the author
- `author.avatarUrl` — author avatar image URL
- `author.followerCount`, `author.followingCount`, `author.heartCount`, `author.videoCount` — author stats snapshot
- `music.id`, `music.title`, `music.authorName`, `music.original`, `music.duration`, `music.album` — sound details
- `music.playUrl`, `music.coverUrl` — sound audio and cover URLs
- `video.width`, `video.height`, `video.duration`, `video.ratio` — video technical metadata
- `video.playUrl`, `video.cover` — signed video stream and cover image URLs
- `mediaUrlExpiresAt` — ISO 8601 timestamp when the signed media URLs expire, when it can be read from the URL
- `images` — slideshow image objects (`ordinal`, `width`, `height`, `urlList`), for `postType: "slideshow"` posts
- `hashtags` — array of hashtag objects with `name`, plus `id` and `isCommerce: true` when TikTok supplies them
- `mentions` — array of `{username, start, end}` objects marking caption offsets (with `awemeId` when present)

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `categories` | array | `[{"id": 123, "name": "All"}]` | Category objects with numeric `id` and human-readable `name`. |
| `maxItemsPerCategory` | integer | `50` | Maximum trending posts to collect per category (1–500). |
| `maxItems` | integer | – | Alias for `maxItemsPerCategory`. When set, it is used unless `maxItemsPerCategory` is set to a value other than `50`. |
| `categoryId` | integer | – | Shorthand for a single category. When set, it replaces the `categories` list entirely. |
| `autoDiscoverCategories` | boolean | `false` | Click through the category tabs on TikTok's Explore page and add every category ID found to the list. If none are found, the All category is used. |

#### Example: default All-category feed

```json
{
  "categories": [{"id": 123, "name": "All"}],
  "maxItemsPerCategory": 10
}
```

#### Example: multiple specific categories

```json
{
  "categories": [
    {"id": 123, "name": "All"},
    {"id": 4, "name": "Entertainment"},
    {"id": 9, "name": "Sports"}
  ],
  "maxItemsPerCategory": 50
}
```

#### Example: auto-discover all categories

```json
{
  "categories": [],
  "autoDiscoverCategories": true,
  "maxItemsPerCategory": 30
}
```

### Use cases

- **Trend analysts** — monitor which video formats and topics are surfacing on TikTok's Explore feed each day
- **Content strategists** — identify high-performing content styles within specific categories like Sports or Entertainment
- **Brand safety teams** — review what trending content is appearing in categories near planned ad placements
- **Academic researchers** — build time-series datasets of trending TikTok content for algorithmic studies
- **Media benchmarking** — track which creators and formats are being amplified by TikTok's discovery system
- **Trend dashboards** — feed breakout content into a notification system that flags momentum early

### FAQ

**What is category 123?**
Category 123 is TikTok's "All" Explore feed — the default tab showing trending posts across all content types, and the recommended starting point. If none of the IDs you ask for match the feed TikTok actually loads on the Explore page, the actor switches to the ID TikTok served, so `categoryId` on the records can differ from the one you entered (your `categoryName` label is kept).

**How do I find other category IDs?**
Set `autoDiscoverCategories` to `true`. The actor clicks each category tab on TikTok's live Explore page and records the ID behind it; the run log lists what it found, so you can reuse those IDs in later runs. Discovery is best-effort: if TikTok's page layout doesn't expose the tabs, only the All category is scraped.

**Do posts get deduplicated across categories?**
Yes. If the same video appears in more than one requested category, it's only emitted once in the dataset.

**How many posts can I get per category?**
Up to 500 per category, set via `maxItemsPerCategory`. A category stops earlier when TikTok reports no more posts or a whole page contains only posts already collected. With a very small limit, the first page TikTok returns is saved in full, so a category can come out a few posts over the limit.

**Do I need login or cookies?**
No. There are no login or cookie inputs.

**Do the video URLs expire?**
Yes. TikTok signs video and audio URLs with short-lived tokens. `mediaUrlExpiresAt` tells you exactly when they expire, so download or cache anything you need promptly.

**Can I use this to monitor trending content over time?**
Yes. Schedule recurring runs and compare `categoryId`, `postId` and the engagement counts between runs to see how the feed shifts over time.

**Is this affiliated with TikTok?**
No. This is an independent, third-party actor that reads TikTok's publicly viewable Explore feed; it isn't affiliated with or endorsed by TikTok.

# Actor input Schema

## `categories` (type: `array`):

Category IDs to explore. The 'All' category (id=123) is always available. Use autoDiscoverCategories=true to find additional category IDs from the live TikTok UI.

## `maxItemsPerCategory` (type: `integer`):

Maximum number of trending posts to collect per category.

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

Alias for maxItemsPerCategory. If both are set, maxItemsPerCategory takes precedence.

## `categoryId` (type: `integer`):

Shorthand: a single integer category ID. Maps to categories=\[{id: N}]. Use 123 for All.

## `autoDiscoverCategories` (type: `boolean`):

When enabled, navigates to TikTok's Explore page and clicks each category tab to discover all available category IDs from the live UI. Discovered categories are added to the categories list.

## Actor input object example

```json
{
  "categories": [
    {
      "id": 123,
      "name": "All"
    }
  ],
  "maxItemsPerCategory": 10,
  "autoDiscoverCategories": false
}
```

# Actor output Schema

## `data` (type: `string`):

Dataset of trending TikTok posts from the Explore feed. Each row is one post with full video metadata, author info, engagement stats, and explore context (feedType, categoryId, categoryName).

# 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 = {
    "categories": [
        {
            "id": 123,
            "name": "All"
        }
    ],
    "maxItemsPerCategory": 10,
    "autoDiscoverCategories": false
};

// Run the Actor and wait for it to finish
const run = await client.actor("nimbryxo-studio/tiktok-explore-feed-trending-post-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 = {
    "categories": [{
            "id": 123,
            "name": "All",
        }],
    "maxItemsPerCategory": 10,
    "autoDiscoverCategories": False,
}

# Run the Actor and wait for it to finish
run = client.actor("nimbryxo-studio/tiktok-explore-feed-trending-post-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 '{
  "categories": [
    {
      "id": 123,
      "name": "All"
    }
  ],
  "maxItemsPerCategory": 10,
  "autoDiscoverCategories": false
}' |
apify call nimbryxo-studio/tiktok-explore-feed-trending-post-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,nimbryxo-studio/tiktok-explore-feed-trending-post-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/BvUQENdTgrozjghWJ/builds/4us631gXJhggpbEqt/openapi.json
