# TikTok Scraper - Hashtag & Profile Videos (`gio21/tiktok-scraper`) Actor

Scrape TikTok videos by hashtag or user profile. Extract views, likes, shares, comments, author info and direct URL. No login needed. Pay per result — $0.001 per video.

- **URL**: https://apify.com/gio21/tiktok-scraper.md
- **Developed by:** [Gio](https://apify.com/gio21) (community)
- **Categories:** Social media, Videos, Automation
- **Stats:** 103 total users, 13 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $1.00 / 1,000 video 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?

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 — Videos, Views, Likes, Authors & Hashtags

**TikTok Scraper** extracts video data from [TikTok](https://www.tiktok.com) by **hashtag** or **profile**: caption, views, likes, comments, shares, duration, author, follower count, hashtags, background music and the direct video URL. It runs with **no login, no API key and no setup**.

Export to **JSON, CSV or Excel**, pull it through the **API**, schedule it, or feed it straight to an **AI agent**. Think of it as a TikTok API for the public video data the official one doesn't give you.

### What can you do with it?

- **🌟 Influencer discovery & marketing** — find creators by hashtag or topic, sort by views and engagement, and build outreach lists for influencer campaigns.
- **📈 Trend & hashtag research** — track what's going viral in any niche, measure hashtag performance and spot rising content formats early.
- **🔍 Competitor & brand monitoring** — watch a competitor's profile, follow their posting cadence and benchmark engagement against your own.
- **📊 Engagement analytics** — pull views, likes, comments and shares at scale to compute engagement rates and reporting dashboards.
- **🤖 AI / LLM datasets** — produce clean, structured video JSON for RAG pipelines, agents and content analysis.

### What data does it extract?

| Field | Description |
|-------|-------------|
| `videoId` | Unique TikTok video ID |
| `description` | Video caption / description |
| `authorUsername` | Creator's @username |
| `authorName` | Creator's display name |
| `authorFollowers` | Creator's follower count |
| `authorVerified` | Whether the account is verified |
| `views` | Total view count |
| `likes` | Total like count |
| `comments` | Total comment count |
| `shares` | Total share count |
| `duration` | Video length in seconds |
| `hashtags` | List of hashtags used in the caption |
| `musicTitle` / `musicAuthor` | Background music title and artist |
| `createdAt` | Publish date (ISO 8601) |
| `url` | Direct link to the TikTok video |

### Input

Pick a `searchType`, give it a `query`, and set how many videos you want.

| Field | Type | Description |
|-------|------|-------------|
| `searchType` | String | `hashtag` (videos under a hashtag) or `profile` (a creator's videos). Default `hashtag`. |
| `query` | String | The hashtag (without `#`, e.g. `digitalmarketing`) or the username (without `@`, e.g. `garyvee`). |
| `maxItems` | Integer | Maximum number of videos to scrape. Default 50. |

**Hashtag example:**

```json
{
  "searchType": "hashtag",
  "query": "digitalmarketing",
  "maxItems": 50
}
```

**Profile example:**

```json
{
  "searchType": "profile",
  "query": "garyvee",
  "maxItems": 30
}
```

### Output

One record per video:

```json
{
  "videoId": "7064703044331523375",
  "description": "there's alot of emotions in this video 😂 #fyp #gym #fitness",
  "authorUsername": "shereinabdelhady",
  "authorName": "shoosh",
  "authorFollowers": null,
  "authorVerified": false,
  "views": 43800000,
  "likes": 8700000,
  "shares": 66600,
  "comments": 34400,
  "duration": 26,
  "musicTitle": "without me",
  "musicAuthor": "favsoundds",
  "hashtags": ["fyp", "gym", "Fitness"],
  "createdAt": "2022-02-14T22:55:57.000Z",
  "url": "https://www.tiktok.com/@shereinabdelhady/video/7064703044331523375"
}
```

#### Field notes

- `views` / `likes` / `comments` / `shares`: returned as integers (TikTok's abbreviated `8.7M` is expanded to `8700000`).
- `authorFollowers`: `null` when TikTok doesn't expose the follower count in the listing for that video — it is more reliably present in `profile` mode.
- `hashtags`: parsed from the caption; casing follows TikTok (you may see both `fyp` and `Fitness`).
- `musicTitle` / `musicAuthor`: the background track; `null` when the sound has no attributed title or artist.
- `createdAt`: ISO 8601 UTC timestamp of when the video was published.

### Integrations

- **API** — start runs and fetch the dataset via the [Apify API](https://docs.apify.com/api/v2) (REST/JSON) or the JS/Python clients. A TikTok API for the data the official one doesn't expose.
- **Schedule & monitor** — run on a [schedule](https://docs.apify.com/platform/schedules) for recurring trend and competitor tracking; get notified on failures.
- **AI agents / MCP** — expose this actor to ChatGPT, Claude and other assistants through the [Apify MCP server](https://mcp.apify.com) so an AI can pull live TikTok data on demand.
- **No-code** — pipe results into Make, Zapier, Google Sheets, Slack or your database with Apify [integrations](https://docs.apify.com/platform/integrations) and webhooks.

### FAQ

**How does TikTok Scraper work?**
It browses TikTok exactly as a viewer would — opening a hashtag feed or a creator's profile, reading the visible video metrics, author and music, and organizing them into a structured dataset, only much faster and at scale.

**Is it legal to scrape TikTok?**
The actor collects only **publicly available** video information (no login, no private data). As with any scraping, you are responsible for how you use the data and for complying with applicable laws and terms. See [Is web scraping legal?](https://blog.apify.com/is-web-scraping-legal/)

**Do I need a TikTok account or login?**
No. No account, cookies or credentials — proxy and unblocking are handled automatically.

**Can I scrape by hashtag and by profile?**
Yes. Set `searchType` to `hashtag` to pull videos under a tag, or `profile` to pull a specific creator's public videos. The `query` field takes the hashtag (without `#`) or the username (without `@`).

**How many videos can I get?**
Set `maxItems` to the number you want. Very large pulls depend on how many videos TikTok exposes for that hashtag or profile, and on TikTok's anti-bot limits at request time.

**Why is `authorFollowers` sometimes empty?**
TikTok doesn't always include the follower count in a hashtag listing. It is more consistently present in `profile` mode, where the creator's profile is opened directly.

**Can I get the data through an API or connect it to AI?**
Yes — run it via the Apify API/clients, or expose it to AI assistants through the Apify MCP server. See **Integrations** above.

**How much does it cost?**
You pay only for what you scrape on a paid Apify plan. Pricing is per video, with no subscriptions and no minimums.

### Related Actors

Building a data pipeline? Pair TikTok Scraper with:

- **[Reddit Scraper](https://apify.com/gio21/reddit-scraper)** — posts, comments and engagement from any subreddit or thread.
- **[Mastodon Scraper](https://apify.com/gio21/mastodon-scraper)** — public posts and account data from the fediverse.

***

### ⭐ Like this actor?

If it saved you time, please take 30 seconds to [leave a review on the Apify Store](https://apify.com/gio21/tiktok-scraper) — it's the single biggest way to support continued development.

# Actor input Schema

## `searchType` (type: `string`):

What to scrape. 'hashtag' returns videos posted under a hashtag; 'profile' returns a specific creator's videos. The 'query' field is interpreted based on this choice. Example: "hashtag".

## `query` (type: `string`):

The hashtag or username to scrape (no leading '#' or '@'). When searchType=hashtag, pass a hashtag word, e.g. "fitness" or "digitalmarketing". When searchType=profile, pass a username, e.g. "nike" or "garyvee".

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

Maximum number of videos to scrape. Large pulls depend on how many videos TikTok exposes for that hashtag or profile. Example: 50.

## Actor input object example

```json
{
  "searchType": "hashtag",
  "query": "digitalmarketing",
  "maxItems": 30
}
```

# Actor output Schema

## `overview` (type: `string`):

No description

# 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 = {
    "searchType": "hashtag",
    "query": "digitalmarketing",
    "maxItems": 30
};

// Run the Actor and wait for it to finish
const run = await client.actor("gio21/tiktok-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 = {
    "searchType": "hashtag",
    "query": "digitalmarketing",
    "maxItems": 30,
}

# Run the Actor and wait for it to finish
run = client.actor("gio21/tiktok-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 '{
  "searchType": "hashtag",
  "query": "digitalmarketing",
  "maxItems": 30
}' |
apify call gio21/tiktok-scraper --silent --output-dataset

```

## MCP server setup

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