# TikTok Posts Scraper (`tom_mobi/tiktok-posts-scraper`) Actor

Discover and scrape TikTok posts by keyword search or profile URL. Collects post metadata, engagement stats, video URLs, and profile information.

- **URL**: https://apify.com/tom\_mobi/tiktok-posts-scraper.md
- **Developed by:** [Tom Mobi](https://apify.com/tom_mobi) (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 $1.70 / 1,000 results

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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

### What does TikTok Posts Scraper do?

**TikTok Posts Scraper** discovers and extracts TikTok posts by **keyword search** or **profile URL**. It collects detailed post metadata including engagement statistics (plays, likes, shares, comments, collects), video URLs, hashtags, and author profile information — all without the need to maintain your own TikTok API integration or handle anti-bot measures.

This Actor is ideal for **social media monitoring, trend analysis, content research, influencer discovery, and competitive intelligence**. Simply provide your search keywords or profile URLs, and the Actor handles the API calls, polling, and data collection automatically. Results are delivered as a structured dataset ready for export in JSON, CSV, Excel, or HTML formats via Apify's integrated storage.

### Why use TikTok Posts Scraper?

- **Dual mode** — Search by keyword to discover trending content, or scrape specific profiles to track creators
- **Keyword-powered discovery** — Find TikTok posts by topic, trend, or brand without needing specific user URLs or post IDs
- **Rich engagement data** — Extract plays, likes, shares, comments, and collects to gauge content performance
- **No official API needed** — No need to apply for TikTok's official API access or deal with rate limits
- **Apify ecosystem** — Schedule runs, integrate with other Actors via webhooks, and export data in your preferred format
- **Simple input, structured output** — Define keywords and get clean, normalized JSON output ready for analysis

### How to use TikTok Posts Scraper

1. **Enter search keywords or profile URLs** — Provide TikTok keywords (e.g., "cooking recipes") and/or profile URLs (e.g. `https://www.tiktok.com/@mrbeast`)
2. **Configure settings** — Adjust posts per source as needed
3. **Run the Actor** — Click "Run" and wait for the results. The Actor triggers data collection, polls until data is ready, and pushes results to the dataset
4. **Export your data** — View the structured results in the Output tab or download as JSON, CSV, Excel, or HTML

### Input

| Field | Type | Default | Description |
|-------|------|---------|-------------|
| `searchKeywords` | `array[string]` | — | Keywords to discover TikTok posts (max 10) |
| `startUrls` | `array[object]` | — | TikTok profile URLs to scrape posts from, e.g. `https://www.tiktok.com/@mrbeast` (max 10) |
| `numOfPosts` | `integer` | `20` | Number of posts to collect per keyword or profile (0 = unlimited) |

At least one of `searchKeywords` or `startUrls` must be provided.

#### Input JSON examples

**Keyword search:**
```json
{
  "searchKeywords": ["cooking recipes", "tech reviews"],
  "numOfPosts": 30
}
````

**Profile scraping:**

```json
{
  "startUrls": [{ "url": "https://www.tiktok.com/@mrbeast" }],
  "numOfPosts": 50
}
```

**Both combined:**

```json
{
  "searchKeywords": ["cooking recipes"],
  "startUrls": [{ "url": "https://www.tiktok.com/@mrbeast" }],
  "numOfPosts": 20
}
```

### Output

The Actor pushes one dataset item per TikTok post. Below is an example output item:

```json
{
  "post_id": "7500000000000000000",
  "description": "Easy pasta recipe you need to try #cooking #recipes #foodtok",
  "create_time": "2025-02-10T09:15:00.000Z",
  "like_count": 24500,
  "share_count": 3200,
  "collect_count": 8900,
  "comment_count": 1500,
  "play_count": 5200000,
  "video_duration": 60,
  "hashtags": ["#cooking", "#recipes", "#foodtok"],
  "video_url": "https://v16-webapp-prime.tiktok.com/video/example.mp4",
  "profile_username": "homechef",
  "profile_url": "https://www.tiktok.com/@homechef",
  "is_verified": false,
  "source": "cooking recipes"
}
```

You can download the dataset in various formats such as **JSON, HTML, CSV, or Excel**.

### Data fields

| Field | Type | Description |
|-------|------|-------------|
| `post_id` | string | Unique TikTok post identifier |
| `description` | string | Post caption / description text |
| `create_time` | string | ISO 8601 timestamp of post creation |
| `like_count` | integer | Number of likes |
| `share_count` | integer | Number of shares |
| `collect_count` | integer | Number of saves/collects |
| `comment_count` | integer | Number of comments |
| `play_count` | integer | Number of video plays |
| `video_duration` | integer | Video length in seconds |
| `hashtags` | array\[string] | Hashtags used in the post |
| `video_url` | string | URL to the video file |
| `profile_username` | string | TikTok username of the author |
| `profile_url` | string | TikTok profile URL of the author |
| `is_verified` | boolean | Whether the author account is verified |
| `source` | string | The keyword or profile URL that sourced this post |

### Pricing / Cost estimation

**From $1.7 per 1,000 results** — the Actor uses lightweight HTTP requests with no browser overhead, making it very cost-efficient. No proxy costs, no API fees.

Apify's free tier includes $5 in monthly compute credits to get started.

### Tips

- **Start small** — Test with 1–2 keywords or a single profile to validate setup before scaling up
- **Set a reasonable posts-per-source limit** — TikTok discovery can return hundreds of results; cap with `numOfPosts` to control cost and runtime

### FAQ, disclaimers, and support

**Is this TikTok's official API?** No. This Actor uses a third-party data API to discover public TikTok posts. It does not use TikTok's official API.

**Are there usage limits?** The underlying API may have rate limits. The Actor includes configurable retry and polling settings to handle rate limiting gracefully.

**Data accuracy** — Engagement numbers (plays, likes, etc.) are snapshots taken at collection time and may not reflect real-time values.

**Legal compliance** — You are responsible for complying with all applicable laws and TikTok's Terms of Service when using data collected by this Actor.

For support, feature requests, or bug reports, please visit the [Issues tab](https://github.com/apify/actors) on GitHub or contact Apify support.

# Actor input Schema

## `searchKeywords` (type: `array`):

Keywords to discover TikTok posts. Each keyword triggers a separate API request. Max 10 keywords per run.

## `startUrls` (type: `array`):

TikTok profile URLs to scrape posts from (e.g. https://www.tiktok.com/@mrbeast). Max 10 profiles per run.

## `numOfPosts` (type: `integer`):

Number of posts to collect per keyword or per profile. 0 or empty means no limit (uses API default).

## Actor input object example

```json
{
  "searchKeywords": [
    "cooking recipes"
  ],
  "startUrls": [],
  "numOfPosts": 20
}
```

# Actor output Schema

## `dataset` (type: `string`):

The dataset containing scraped TikTok posts

## `runUrl` (type: `string`):

Link to the Actor run in Apify Console

# 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 = {
    "searchKeywords": [
        "cooking recipes"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("tom_mobi/tiktok-posts-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 = { "searchKeywords": ["cooking recipes"] }

# Run the Actor and wait for it to finish
run = client.actor("tom_mobi/tiktok-posts-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "searchKeywords": [
    "cooking recipes"
  ]
}' |
apify call tom_mobi/tiktok-posts-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=tom_mobi/tiktok-posts-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "TikTok Posts Scraper",
        "description": "Discover and scrape TikTok posts by keyword search or profile URL. Collects post metadata, engagement stats, video URLs, and profile information.",
        "version": "1.0",
        "x-build-id": "FEcE0vpBLXiLX1QQG"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/tom_mobi~tiktok-posts-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-tom_mobi-tiktok-posts-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/tom_mobi~tiktok-posts-scraper/runs": {
            "post": {
                "operationId": "runs-sync-tom_mobi-tiktok-posts-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/tom_mobi~tiktok-posts-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-tom_mobi-tiktok-posts-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "searchKeywords": {
                        "title": "Search Keywords",
                        "type": "array",
                        "description": "Keywords to discover TikTok posts. Each keyword triggers a separate API request. Max 10 keywords per run.",
                        "default": [],
                        "items": {
                            "type": "string"
                        }
                    },
                    "startUrls": {
                        "title": "Profile URLs",
                        "type": "array",
                        "description": "TikTok profile URLs to scrape posts from (e.g. https://www.tiktok.com/@mrbeast). Max 10 profiles per run.",
                        "default": [],
                        "items": {
                            "type": "object",
                            "required": [
                                "url"
                            ],
                            "properties": {
                                "url": {
                                    "type": "string",
                                    "title": "URL of a web page",
                                    "format": "uri"
                                }
                            }
                        }
                    },
                    "numOfPosts": {
                        "title": "Posts per Source",
                        "minimum": 0,
                        "maximum": 500,
                        "type": "integer",
                        "description": "Number of posts to collect per keyword or per profile. 0 or empty means no limit (uses API default).",
                        "default": 20
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
