# TikTok Scraper

Collect TikTok videos, profiles, comments, and replies from keywords, video URLs, or @usernames in one task. Export 101 fields with each reply linked to its main comment and video. Search can collect comments with or without video details.

- Template page: [https://www.octoparse.com/template/tiktok-scraper](https://www.octoparse.com/template/tiktok-scraper)
- Categories: Social Media
- Status: `PUBLISHED`
- Run mode: `CLOUD`

## Pricing

Current price: **$1.5/1,000 lines**. Billing is based on output rows; an Octoparse subscription may be required.

## What is an Octoparse template?

An Octoparse template is a ready-to-use scraping workflow with predefined inputs and structured outputs. Use the exact parameter keys below; do not invent parameters.

## Overview

This ready-to-use template collects structured data from web pages.

## Output

The current workflow extracts 101 fields, including `record_type`, `input_type`, `input_value`, `search_type`, `source_context`, `account_id`, `account_handle`, `account_name`, `account_bio`, `account_website`, `account_avatar_url`, `account_url`, `account_followers_count`, `account_following_count`, `account_posts_count`, `account_total_likes_count`, `account_verified`, `account_private`, `account_commerce_info`, `account_language`, `account_location`, `collected_at`, `video_id`, `video_url`, `video_caption`, `video_cover_url`, `video_posted_at`, `video_type`, `video_is_ad`, `video_country`, `video_views_count`, `video_likes_count`, `video_comments_count`, `video_shares_count`, `video_favorites_count`, `video_reposts_count`, `video_duration_seconds`, `video_definition`, `video_width`, `video_height`, `video_play_url`, `video_download_url`, `video_hashtags`, `video_mentions`, `video_music_title`, `video_music_author`, `video_music_page_url`, `video_music_play_url`, `video_music_cover_url`, `video_music_id`, `video_music_original`, `video_music_original_cover_url`, `video_subtitle_links`, `video_detailed_mentions`, `video_effect_stickers`, `video_text_language`, `video_location`, `video_original_cover_url`, `video_author_id`, `video_author_handle`, `video_author_name`, `video_author_avatar_url`, `video_author_bio`, `video_author_followers_count`, `video_author_following_count`, `video_author_total_likes_count`, `video_author_posts_count`, `video_author_verified`, `video_author_seller`, `video_author_created_at`, `video_author_profile_url`, `comment_id`, `comment_text`, `comment_likes_count`, `comment_posted_at`, `comment_reply_count`, `comment_type`, `comment_author_id`, `comment_author_name`, `comment_author_avatar_url`, `comment_parent_id`, `comment_root_id`, `comment_liked_by_author`, `comment_pinned_by_author`, `comment_mentions`, `comment_images`, `reply_id`, `reply_text`, `reply_likes_count`, `reply_posted_at`, `reply_reply_count`, `reply_type`, `reply_author_id`, `reply_author_name`, `reply_author_avatar_url`, `reply_parent_id`, `reply_root_id`, `reply_liked_by_author`, `reply_pinned_by_author`, `reply_mentions`, `reply_images`.

## Use Cases

- Use structured results for research, comparison, and monitoring.
- Collect rows without building the extraction workflow from scratch.
- Combine results with other templates for downstream enrichment.
- Review a representative result before starting a large batch.

## Why Octoparse

- **No coding required:** complete Search Queries, Results per search query, Collect video details and start the template in cloud mode.
- **Flexible export:** review and export results as CSV, Excel, or JSON.

## Input

At least one of the following input combinations is required:

- **Search Queries**
- **Direct Video URLs**
- **TikTok Profiles**

### Search Queries

Required when using its input combination. Each keyword is searched separately and produces its own video list. Details and comments are controlled by the options below. Constraints: minItems=1; maxItems=10000; items.minLength=1; items.maxLength=5000.

### Results per search query

Optional. TikTok returns search results in pages, so the number of exported rows can differ from the number you enter. Constraints: minimum=1, maximum=.

### Collect video details

Optional. On by default. Turn it off when you only need the search-result list, which keeps the dataset smaller. Constraints: default=false.

### Comments per search-result video

Optional. Comments and replies are exported as separate rows, and every row counts as an output line. The comment stage runs once per video. Constraints: minimum=0, maximum=.

### Direct Video URLs

Required when using its input combination. Each URL produces one video row for that exact post; no keyword search is involved. Constraints: minItems=1; maxItems=10000.

### Comments per direct video

Optional. Independent of the keyword comment option, so keyword videos and direct URLs can use different comment settings in the same task. Constraints: minimum=0, maximum=.

### TikTok Profiles

Required when using its input combination. Returns account information only and does not include the account's video list. Combine it with the other groups when you also need that account's videos. Constraints: minItems=1; maxItems=10000.

## How to Use

### TikTok Scraper – Input & Usage Guide

Collect public TikTok video, account, and comment data from three entry points.

#### Inputs

Enter at least one input group. All fields optional.

- **Search Queries**: One keyword per line. Template discovers matching videos.
- **Direct Video URLs**: One full URL per line (e.g., `https://www.tiktok.com/@user/video/123`).
- **TikTok Profiles**: One profile URL (e.g., `https://www.tiktok.com/@nba`) or handle (e.g., `@nba`) per line. Bare keywords like `nba` must go in Search Queries.

Mix all three in one task.

#### Parameters (set before run)

| Parameter | Type | Description |
|-----------|------|-------------|
| `Collect video details` | Boolean | When enabled, video details are collected for search results and comments. Default: On. Off keeps only video IDs/URLs. |
| `Results per search query` | Integer | Requested number of videos to process per keyword. Not an exact limit. |
| `Comments per direct video` | Integer | Number of top-level comments to collect per direct video URL. Blank or 0 to skip. |
| `Comments per search-result video` | Integer | Number of top-level comments per video from search results. Blank or 0 to skip. |

#### Output & Pricing

- Fixed 101-column layout: fields for account, video, main comment (`comment_*`), and reply (`reply_*`).
- A reply row repeats video and main comment fields.
- Charged per final output line: **Standard $1.50/1k lines**, **Professional $1.20/1k**, **Enterprise $0.90/1k**.
- Example: 100 videos with 20 main comments each → 2,000 lines ($3.00 Standard). Profile inputs add separate lines.

#### Safety & Legal

- Only public data is extracted. Respect TikTok’s Terms of Service and local data privacy laws.
- Do not use for spam, harassment, or unauthorized surveillance.

#### Quick Steps

1. Open **TikTok Scraper** in Octoparse and click **Try it!**.
2. In the input area, paste your search keywords, video URLs, and/or profile identifiers.
3. Adjust parameters as needed.
4. Run the task in Octoparse Cloud. Optionally schedule recurring runs.
5. Export results to Excel, CSV, or JSON.

#### Limitations

- **TikTok Profiles** returns account info only – no video list for that account. Combine with search queries or direct video URLs for posts.
- **Results per search query** and comment controls are request values, not row limits. Exported lines may differ.
- No separate controls for main comments vs replies. If a reply is returned without its main comment, main-comment text stays blank.

#### Tips

- Start with one keyword or one video URL to estimate line volume.
- Keep `record_type`, `input_type`, `input_value`, `source_context` columns to trace rows back to original input.
- Leave a comment control blank to skip comment collection and produce a smaller dataset.
- Run input types as separate tasks for clean cost comparisons, or together for a single merged dataset.

## Limitations

Results depend on what the source site exposes at run time. Fields may be empty when a source page does not provide a value. The template enforces the input limits shown above.

## Tips

Use specific, valid inputs and review a representative result before starting a large batch. Remove duplicate inputs when repeated records are not needed.

## FAQ

### What do I need to enter?

Use the exact inputs and limits listed above.

### What data does this template return?

See Output Schema below; availability can vary by source record.

### How is usage billed?

See the Pricing section above for current pricing and billing details.

## Related Templates

- [TikTok Video Details & Comments Scraper](https://www.octoparse.com/template/tiktok-video-comments-scraper)
- [TikTok Search Scraper (Login Required)](https://www.octoparse.com/template/tiktok-busqueda-scraper)
- [TikTok Search Scraper (No Login Required)](https://www.octoparse.com/template/tiktok-video-url-scraper)
- [TikTok Profile Scraper](https://www.octoparse.com/template/tiktok-profile-scraper)

## Input Schema

```json
{
  "title": "TikTok Scraper input",
  "description": "Input parameters configured for the current published template version.",
  "type": "object",
  "schemaVersion": 1,
  "additionalProperties": false,
  "properties": {
    "search_Queries": {
      "title": "Search Queries",
      "description": "Each keyword is searched separately and produces its own video list. Details and comments are controlled by the options below.",
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 5000
      },
      "minItems": 1,
      "maxItems": 10000,
      "x-octoparse": {
        "apiEnabled": true
      }
    },
    "results_per_search_query": {
      "title": "Results per search query",
      "description": "TikTok returns search results in pages, so the number of exported rows can differ from the number you enter.",
      "type": "integer",
      "minimum": 1,
      "x-octoparse": {
        "apiEnabled": true
      }
    },
    "collect_video_details": {
      "title": "Collect video details",
      "description": "On by default. Turn it off when you only need the search-result list, which keeps the dataset smaller.",
      "type": "boolean",
      "default": false,
      "x-octoparse": {
        "apiEnabled": true
      }
    },
    "comments_per_search-result_video": {
      "title": "Comments per search-result video",
      "description": "Comments and replies are exported as separate rows, and every row counts as an output line. The comment stage runs once per video.",
      "type": "integer",
      "minimum": 0,
      "x-octoparse": {
        "apiEnabled": true
      }
    },
    "direct_Video_URLs": {
      "title": "Direct Video URLs",
      "description": "Each URL produces one video row for that exact post; no keyword search is involved.",
      "type": "array",
      "items": {
        "type": "string"
      },
      "minItems": 1,
      "maxItems": 10000,
      "x-octoparse": {
        "apiEnabled": true
      }
    },
    "comments_per_direct_video": {
      "title": "Comments per direct video",
      "description": "Independent of the keyword comment option, so keyword videos and direct URLs can use different comment settings in the same task.",
      "type": "integer",
      "minimum": 0,
      "x-octoparse": {
        "apiEnabled": true
      }
    },
    "tikTok_Profiles": {
      "title": "TikTok Profiles",
      "description": "Returns account information only and does not include the account's video list. Combine it with the other groups when you also need that account's videos.",
      "type": "array",
      "items": {
        "type": "string"
      },
      "minItems": 1,
      "maxItems": 10000,
      "x-octoparse": {
        "apiEnabled": true
      }
    }
  },
  "required": [],
  "anyOf": [
    {
      "title": "Search Queries",
      "required": [
        "search_Queries"
      ]
    },
    {
      "title": "Direct Video URLs",
      "required": [
        "direct_Video_URLs"
      ]
    },
    {
      "title": "TikTok Profiles",
      "required": [
        "tikTok_Profiles"
      ]
    }
  ]
}
```

## Input JSON Example

No verified real input/output examples are currently available.


## Output Schema

```json
{
  "schemaVersion": 1,
  "type": "object",
  "properties": {
    "record_type": {
      "type": "string",
      "description": ""
    },
    "input_type": {
      "type": "string",
      "description": ""
    },
    "input_value": {
      "type": "string",
      "description": ""
    },
    "search_type": {
      "type": "string",
      "description": ""
    },
    "source_context": {
      "type": "string",
      "description": ""
    },
    "account_id": {
      "type": "string",
      "description": ""
    },
    "account_handle": {
      "type": "string",
      "description": ""
    },
    "account_name": {
      "type": "string",
      "description": ""
    },
    "account_bio": {
      "type": "string",
      "description": ""
    },
    "account_website": {
      "type": "string",
      "description": ""
    },
    "account_avatar_url": {
      "type": "string",
      "description": ""
    },
    "account_url": {
      "type": "string",
      "description": ""
    },
    "account_followers_count": {
      "type": "string",
      "description": ""
    },
    "account_following_count": {
      "type": "string",
      "description": ""
    },
    "account_posts_count": {
      "type": "string",
      "description": ""
    },
    "account_total_likes_count": {
      "type": "string",
      "description": ""
    },
    "account_verified": {
      "type": "string",
      "description": ""
    },
    "account_private": {
      "type": "string",
      "description": ""
    },
    "account_commerce_info": {
      "type": "string",
      "description": ""
    },
    "account_language": {
      "type": "string",
      "description": ""
    },
    "account_location": {
      "type": "string",
      "description": ""
    },
    "collected_at": {
      "type": "string",
      "description": ""
    },
    "video_id": {
      "type": "string",
      "description": ""
    },
    "video_url": {
      "type": "string",
      "description": ""
    },
    "video_caption": {
      "type": "string",
      "description": ""
    },
    "video_cover_url": {
      "type": "string",
      "description": ""
    },
    "video_posted_at": {
      "type": "string",
      "description": ""
    },
    "video_type": {
      "type": "string",
      "description": ""
    },
    "video_is_ad": {
      "type": "string",
      "description": ""
    },
    "video_country": {
      "type": "string",
      "description": ""
    },
    "video_views_count": {
      "type": "string",
      "description": ""
    },
    "video_likes_count": {
      "type": "string",
      "description": ""
    },
    "video_comments_count": {
      "type": "string",
      "description": ""
    },
    "video_shares_count": {
      "type": "string",
      "description": ""
    },
    "video_favorites_count": {
      "type": "string",
      "description": ""
    },
    "video_reposts_count": {
      "type": "string",
      "description": ""
    },
    "video_duration_seconds": {
      "type": "string",
      "description": ""
    },
    "video_definition": {
      "type": "string",
      "description": ""
    },
    "video_width": {
      "type": "string",
      "description": ""
    },
    "video_height": {
      "type": "string",
      "description": ""
    },
    "video_play_url": {
      "type": "string",
      "description": ""
    },
    "video_download_url": {
      "type": "string",
      "description": ""
    },
    "video_hashtags": {
      "type": "string",
      "description": ""
    },
    "video_mentions": {
      "type": "string",
      "description": ""
    },
    "video_music_title": {
      "type": "string",
      "description": ""
    },
    "video_music_author": {
      "type": "string",
      "description": ""
    },
    "video_music_page_url": {
      "type": "string",
      "description": ""
    },
    "video_music_play_url": {
      "type": "string",
      "description": ""
    },
    "video_music_cover_url": {
      "type": "string",
      "description": ""
    },
    "video_music_id": {
      "type": "string",
      "description": ""
    },
    "video_music_original": {
      "type": "string",
      "description": ""
    },
    "video_music_original_cover_url": {
      "type": "string",
      "description": ""
    },
    "video_subtitle_links": {
      "type": "string",
      "description": ""
    },
    "video_detailed_mentions": {
      "type": "string",
      "description": ""
    },
    "video_effect_stickers": {
      "type": "string",
      "description": ""
    },
    "video_text_language": {
      "type": "string",
      "description": ""
    },
    "video_location": {
      "type": "string",
      "description": ""
    },
    "video_original_cover_url": {
      "type": "string",
      "description": ""
    },
    "video_author_id": {
      "type": "string",
      "description": ""
    },
    "video_author_handle": {
      "type": "string",
      "description": ""
    },
    "video_author_name": {
      "type": "string",
      "description": ""
    },
    "video_author_avatar_url": {
      "type": "string",
      "description": ""
    },
    "video_author_bio": {
      "type": "string",
      "description": ""
    },
    "video_author_followers_count": {
      "type": "string",
      "description": ""
    },
    "video_author_following_count": {
      "type": "string",
      "description": ""
    },
    "video_author_total_likes_count": {
      "type": "string",
      "description": ""
    },
    "video_author_posts_count": {
      "type": "string",
      "description": ""
    },
    "video_author_verified": {
      "type": "string",
      "description": ""
    },
    "video_author_seller": {
      "type": "string",
      "description": ""
    },
    "video_author_created_at": {
      "type": "string",
      "description": ""
    },
    "video_author_profile_url": {
      "type": "string",
      "description": ""
    },
    "comment_id": {
      "type": "string",
      "description": "Main comment field repeated on each reply row."
    },
    "comment_text": {
      "type": "string",
      "description": "Main comment field repeated on each reply row."
    },
    "comment_likes_count": {
      "type": "string",
      "description": "Main comment field repeated on each reply row."
    },
    "comment_posted_at": {
      "type": "string",
      "description": "Main comment field repeated on each reply row."
    },
    "comment_reply_count": {
      "type": "string",
      "description": "Main comment field repeated on each reply row."
    },
    "comment_type": {
      "type": "string",
      "description": "Main comment field repeated on each reply row."
    },
    "comment_author_id": {
      "type": "string",
      "description": "Main comment field repeated on each reply row."
    },
    "comment_author_name": {
      "type": "string",
      "description": "Main comment field repeated on each reply row."
    },
    "comment_author_avatar_url": {
      "type": "string",
      "description": "Main comment field repeated on each reply row."
    },
    "comment_parent_id": {
      "type": "string",
      "description": "Main comment field repeated on each reply row."
    },
    "comment_root_id": {
      "type": "string",
      "description": "Main comment field repeated on each reply row."
    },
    "comment_liked_by_author": {
      "type": "string",
      "description": "Main comment field repeated on each reply row."
    },
    "comment_pinned_by_author": {
      "type": "string",
      "description": "Main comment field repeated on each reply row."
    },
    "comment_mentions": {
      "type": "string",
      "description": "Main comment field repeated on each reply row."
    },
    "comment_images": {
      "type": "string",
      "description": "Main comment field repeated on each reply row."
    },
    "reply_id": {
      "type": "string",
      "description": "Reply field; blank when this row has no reply."
    },
    "reply_text": {
      "type": "string",
      "description": "Reply field; blank when this row has no reply."
    },
    "reply_likes_count": {
      "type": "string",
      "description": "Reply field; blank when this row has no reply."
    },
    "reply_posted_at": {
      "type": "string",
      "description": "Reply field; blank when this row has no reply."
    },
    "reply_reply_count": {
      "type": "string",
      "description": "Reply field; blank when this row has no reply."
    },
    "reply_type": {
      "type": "string",
      "description": "Reply field; blank when this row has no reply."
    },
    "reply_author_id": {
      "type": "string",
      "description": "Reply field; blank when this row has no reply."
    },
    "reply_author_name": {
      "type": "string",
      "description": "Reply field; blank when this row has no reply."
    },
    "reply_author_avatar_url": {
      "type": "string",
      "description": "Reply field; blank when this row has no reply."
    },
    "reply_parent_id": {
      "type": "string",
      "description": "Reply field; blank when this row has no reply."
    },
    "reply_root_id": {
      "type": "string",
      "description": "Reply field; blank when this row has no reply."
    },
    "reply_liked_by_author": {
      "type": "string",
      "description": "Reply field; blank when this row has no reply."
    },
    "reply_pinned_by_author": {
      "type": "string",
      "description": "Reply field; blank when this row has no reply."
    },
    "reply_mentions": {
      "type": "string",
      "description": "Reply field; blank when this row has no reply."
    },
    "reply_images": {
      "type": "string",
      "description": "Reply field; blank when this row has no reply."
    }
  },
  "title": "TikTok Scraper output",
  "description": "Initial output fields derived from the current published implementation. Field descriptions are maintained by Data Center; production field names and types should be refreshed from recent successful runs.",
  "additionalProperties": false
}
```

## Output Example

No verified real input/output examples are currently available.

## API

`POST https://openapi.octoparse.com/api/agentTools/executeTask`

This is the OpenAPI Agent Tools `executeTask` endpoint. Authenticate with a Bearer token.

Request body:

`templateName` is the template slug; `parameters` is a JSON object string whose keys match Input Schema; `taskName`, `idempotencyKey`, and `maxCollectedRows` are optional.

Obtain a token:

```http
POST https://openapi.octoparse.com/token
Content-Type: application/json

{
  "username": "YOUR_USERNAME",
  "password": "YOUR_PASSWORD",
  "grant_type": "password"
}
```

Use `data.access_token` as `Authorization: Bearer <token>`. After starting, poll `getTaskStatus` and export with `exportData`.

No verified real input/output examples are currently available.

## MCP Setup

Connect an MCP-compatible AI client to `https://mcp.octoparse.com` using browser OAuth or an Octoparse API key. Find `tiktok-scraper`, inspect its inputs, create a cloud task with the exact Input Schema keys, and export JSON results.

## Machine-readable Resources

- [Template contract](https://www.octoparse.com/templates/tiktok-scraper.json)
- [Manifest](https://www.octoparse.com/templates/tiktok-scraper-manifest.json)
