# TikTok Scraper - Profiles, Videos & Hashtags (`s-r/tiktok-profile`) Actor

Read public TikTok accounts and their videos, look up single videos by link or id, and get reach figures for hashtags. Per video: views, likes, comments, shares, caption, hashtags, sound and posting date.

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

## Pricing

Pay per event

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 Scraper - Profiles, Videos & Hashtags

Three things in one Actor, and you pick by what you fill in.

**Accounts.** Paste handles or profile links and get the account's followers,
likes and video count, then one row per video with views, likes, comments,
shares, caption, hashtags, sound and posting date.

**Single videos.** Paste video links or bare video ids to read just those.

**Hashtags.** Paste tags to get how many videos carry them and how many views
those have between them.

No API key, no login, no browser.

### Paste the link however you copied it

A TikTok link copied from a video embedded on another site comes with a tail of
tracking:

```
https://www.tiktok.com/@that.sara.with.no.h?referer_url=www.ladbible.com%2F
&refer=embed&embed_source=121374463%2C121468991%2C121439635…
&referer_video_id=7682928988821490974
```

That works as it is. So does `@handle`, a bare handle, and a link to a single
video. Everything after the account name is dropped, so the same account pasted
four different ways is read once, not four times.

### What you get per video

- `play_count`, `like_count`, `comment_count`, `share_count`, `collect_count`
- `description` (the caption) and `hashtags` pulled out of it separately
- `created_at` as a UTC timestamp, and `duration_seconds`
- `music_title`, `music_author` and `music_id` — which sound the post used
- `cover_url`, `width`, `height`, `is_ad`
- `handle`, `nickname`, `account_id` and `follower_count` on **every row**

That last point matters more than it looks. Running twenty accounts gives you
one table you can group and sort directly, instead of rows that have to be
joined back to an account list first.

### Single videos, by link or by id

Paste a video link and only that video is read. The handle in the link is
ignored, because `/@x/video/<id>` serves the same page as the real one: the id
is what resolves. So a link with a stale handle still works, and the same video
pasted twice is read once.

A single-video row carries everything an account's video row does, plus the
author's follower count **at the moment of the run**, which is what makes a
one-off link worth reading on its own.

### Hashtags: reach figures, and only reach figures

Paste `#olemiss`, `olemiss` or a `/tag/` link and you get the hashtag's id, how
many videos carry it and how many views they have between them. Measured live:
**#olemiss, 240,700 videos, 3.44 billion views**; **#hottytoddy, 45,241 videos,
499 million views**.

What you do **not** get is the tag's video list. TikTok does not serve it: the
endpoint that would list them answers with zero items, to every client tried.
Rather than return an empty video list that reads as an empty hashtag, the run
returns the counts and reports `hashtagVideosAvailable: false`.

If you want videos for a topic, the way that works is to read the accounts that
post about it and filter their captions on the tag, which the `hashtags` field
on every video row supports directly.

### What you get per account

Followers, following, total likes and video count, plus the bio, verified flag,
whether the account is private, and the avatar. These are reported in the run
summary for every account read, and the identity fields ride along on each video
row.

Set **Maximum videos per account** to `0` to read only the accounts and skip
videos entirely. That is the cheap way to track follower counts over time.

### Two counts that will not always match, on purpose

An account's profile states how many videos it has. The feed hands over what it
is willing to serve, and those are not always the same number: restricted,
region-limited and recently removed posts are counted but not served.

Rather than smooth that over, the run summary reports all of it:

- `videosClaimedByProfiles` — what the profiles say they hold
- `videosReturned` — what actually came back
- `maxVideosPerAccount` and `cappedByMaxVideos` — so you can tell your own limit
  apart from a restriction
- `accountsThatServedNoVideos` — accounts that claim videos and served none

Asking for 40 videos from an account holding 47 is not a restriction, and
without the cap in the summary those two cases look identical.

### Empty is never assumed

The video feed is the kind of endpoint that answers awkward requests with a
success and nothing in it. This Actor treats a body with nothing in it as a
failure to be retried and reported, never as an account with no videos. A
genuinely empty account is reported as exactly that, separately.

The same applies to individual numbers: a missing view count comes back empty
rather than as `0`, because zero views is a real and different thing from a
count that was not published.

### Filters and scale

- **TikTok accounts** — handles or links, one per line
- **Maximum videos per account** — the feed returns 35 per request, so this
  rounds up to whole requests and is the ceiling on both time and cost
- **Maximum accounts** — applied after duplicates are removed

Two accounts and 73 videos took **under thirteen seconds** in testing. Videos
come back newest first and paging is handled inside the run.

### What people use this for

**Creator research.** Follower count next to per-video engagement is what
separates an account with reach from an account with an audience. The gap
between plays and likes across an account's recent posts says more than any
follower number.

**Campaign tracking.** Run the accounts in a campaign on a schedule and keep the
rows. Because `created_at` and every count are on each row, growth per post over
time falls out of the table without extra work.

**Sound and hashtag trends.** `music_id` and `hashtags` across many accounts show
what is spreading and how fast, which is the input to deciding what to post.

**Competitive monitoring.** The same shape of data for your accounts and
somebody else's, in one table, with the account on every row.

### What this does not cover

Videos are read from the account's own feed, so this returns **what an account
posted**, not what it was tagged in, and not its liked or saved posts. Comments
are counted but not fetched: a post with 146 comments gives you the number, not
the 146 texts.

**There is no keyword search**, and that is not a gap in this Actor. TikTok's
search endpoint answers with `Please login your account first`, so nobody reads
it without an account. Accounts, videos and hashtags are what is available
without one.

Sounds are identified rather than downloaded. `music_id` is stable across posts,
which is what makes it useful for tracking a sound's spread, but the audio
itself is not part of the output.

### Notes

Only public accounts can be read. A private account is reported with its profile
details and no videos, which is the honest answer rather than an empty result.

Counts are live and move constantly on popular posts; a run is a snapshot, which
is why the posting date is on every row.

An account that does not exist is reported by name, so a run of fifty tells you
exactly which handle was wrong rather than silently returning fewer rows.

# Actor input Schema

## `profiles` (type: `array`):

Handles or profile links, one per line. A link copied from an embedded video works as it is: everything after the handle is ignored, so ?referer\_url=...\&refer=embed resolves to the same account as a plain @handle. Leave empty when you only want single videos or hashtags.

## `max_videos` (type: `integer`):

How many videos to read per account, newest first. Set to 0 to read only the account details and no videos. The feed returns 35 per request, so this rounds up to whole requests and is the cost ceiling.

## `max_accounts` (type: `integer`):

Stop after this many accounts, counted after duplicates are removed.

## `video_urls` (type: `array`):

Video links or bare video ids to read one by one. The handle in a video link is ignored because the id is what resolves, so a link with a stale handle still works. Returns the same fields as an account's videos, plus the author's follower count at the moment of the run.

## `hashtags` (type: `array`):

Hashtags to look up, as #tag, tag or a /tag/ link. Returns how many videos carry the tag and how many views they have between them. TikTok does not serve the tag's video list to anyone, so this is reach figures only and the run says so rather than returning an empty list.

## Actor input object example

```json
{
  "profiles": [
    "@nasa"
  ],
  "max_videos": 50,
  "max_accounts": 25,
  "video_urls": [
    "https://www.tiktok.com/@nasa/video/7682928988821490974"
  ],
  "hashtags": [
    "#olemiss"
  ]
}
```

# Actor output Schema

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

One row per video.

## `summary` (type: `string`):

Accounts read with their follower and video counts, videos returned, and total plays and likes.

## `errors` (type: `string`):

Accounts that could not be read.

# 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 = {
    "profiles": [
        "@nasa",
        "https://www.tiktok.com/@that.sara.with.no.h"
    ],
    "video_urls": [],
    "hashtags": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("s-r/tiktok-profile").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 = {
    "profiles": [
        "@nasa",
        "https://www.tiktok.com/@that.sara.with.no.h",
    ],
    "video_urls": [],
    "hashtags": [],
}

# Run the Actor and wait for it to finish
run = client.actor("s-r/tiktok-profile").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 '{
  "profiles": [
    "@nasa",
    "https://www.tiktok.com/@that.sara.with.no.h"
  ],
  "video_urls": [],
  "hashtags": []
}' |
apify call s-r/tiktok-profile --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,s-r/tiktok-profile"
        }
    }
}

```

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/f22pT3WwXJhY4j5Md/builds/bkGEfwMCKOVfDetVR/openapi.json
