# Tiktok Profile Videos Api Scraper (`scrapelabsapi/tiktok-profile-videos-api-scraper`) Actor

- **URL**: https://apify.com/scrapelabsapi/tiktok-profile-videos-api-scraper.md
- **Developed by:** [ScrapeLabs](https://apify.com/scrapelabsapi) (community)
- **Categories:** Automation, Lead generation, Social media
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.99 / 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.

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

## TikTok Profile Videos API Scraper

A powerful Apify Actor that scrapes videos from TikTok user profiles using the official TikTok API. This actor extracts comprehensive video data including metadata, statistics, music information, and more.

### Why Choose Us?

- **Reliable on Apify**: Default input uses Apify Proxy so runs (including platform health checks) are less likely to be blocked by TikTok.
- **Comprehensive Data Extraction**: Get all available video data including metadata, statistics, music info, challenges, and more
- **Smart Proxy Rotation**: Automatic fallback from no proxy → datacenter → residential proxy with retry logic
- **Bulk Processing**: Process multiple profiles in a single run
- **Flexible Sorting**: Sort videos by newest or oldest
- **Detailed Logging**: Real-time progress updates and detailed logs
- **Production Ready**: Built with error handling, retry logic, and rate limiting

### Key Features

- ✅ Scrape videos from TikTok profiles using official API
- ✅ Automatic proxy rotation with fallback mechanism
- ✅ Support for bulk profile processing
- ✅ Configurable sort order (newest/oldest)
- ✅ Maximum videos limit per profile
- ✅ Comprehensive video data extraction
- ✅ Detailed logging and progress tracking
- ✅ Error handling and retry logic

### Input

#### JSON Example

```json
{
  "startUrls": [
    { "url": "https://www.tiktok.com/@mrbeast" },
    { "url": "https://www.tiktok.com/@charlidamelio" }
  ],
  "sortOrder": "newest",
  "maxVideos": 50,
  "maxComments": 0,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
````

#### Input Fields

- **startUrls** (required): Array of TikTok profile URLs, usernames, or keywords
  - Can be full URLs: `https://www.tiktok.com/@username`
  - Or just usernames: `username` or `@username`

- **sortOrder** (optional): Sort order for videos
  - `"newest"` (default): Newest videos first
  - `"oldest"`: Oldest videos first

- **maxVideos** (optional): Maximum number of videos to scrape per profile
  - Set to `0` or leave empty to scrape all videos
  - Default: `0` (unlimited)

- **maxComments** (optional): Maximum number of comments per video
  - Currently not implemented, reserved for future use
  - Default: `0`

- **proxyConfiguration** (optional): Proxy settings
  - **Recommended**: Keep **Apify Proxy enabled** for reliable runs on the Apify platform (reduces blocking and avoids failed health checks).
  - If you disable proxy, the actor will try without proxy first, then automatically fall back to:
    1. Datacenter proxy
    2. Residential proxy (with 3 retries)
  - All proxy events are logged clearly

### Output

#### Output Format

Each video in the dataset contains comprehensive information:

```json
{
  "id": "7582653507375746334",
  "aweme_id": "7582653507375746334",
  "url": "https://www.tiktok.com/@mrbeast/video/7582653507375746334",
  "desc": "Video description...",
  "description": "Video description...",
  "createTime": 1765474107,
  "author": {
    "id": "6614519312189947909",
    "uniqueId": "mrbeast",
    "nickname": "MrBeast",
    "avatarThumb": {
      "url_list": ["https://..."],
      "width": null,
      "height": null
    },
    "verified": true
  },
  "stats": {
    "playCount": 1100000,
    "diggCount": 63900,
    "commentCount": 9020,
    "shareCount": 8440,
    "collectCount": 4182
  },
  "video": {
    "duration": 93,
    "width": 720,
    "height": 1280,
    "play_addr": {
      "url_list": ["https://..."],
      "width": 720,
      "height": 1280
    },
    "download_addr": {
      "url_list": ["https://..."],
      "width": 720,
      "height": 1280
    }
  },
  "music": {
    "id": "7582653324450925343",
    "title": "original sound",
    "author": "MrBeast",
    "duration": 93,
    "play_url": {
      "url_list": ["https://..."]
    }
  },
  "challenges": [],
  "profile_username": "mrbeast",
  "profile_url": "https://www.tiktok.com/@mrbeast"
}
```

#### Output Fields

- **id**: Video ID
- **aweme\_id**: Alternative video ID format
- **url**: Direct link to the video
- **desc/description**: Video description
- **createTime**: Video creation timestamp
- **author**: Complete author information (username, nickname, avatar, verification status, etc.)
- **stats**: Video statistics (views, likes, comments, shares, bookmarks)
- **video**: Video details (duration, dimensions, play URLs, download URLs)
- **music**: Music/sound information (title, author, duration, play URL)
- **challenges**: Hashtags/challenges associated with the video
- **profile\_username**: Username of the profile scraped
- **profile\_url**: URL of the profile scraped

### 🚀 How to Use the Actor (via Apify Console)

1. **Log in** at <https://console.apify.com> and go to *Actors*
2. **Find** your actor (tiktok-profile-videos-api-scraper) and click it
3. **Configure inputs**:
   - Add TikTok profile URLs or usernames in the `startUrls` field
   - Set `sortOrder` (newest/oldest)
   - Set `maxVideos` if you want to limit the number of videos
   - Configure `proxyConfiguration` if needed (optional)
4. **Run** the actor
5. **Monitor** logs in real time to see progress
6. **Access results** in the OUTPUT tab
7. **Export** results to JSON or CSV

### Best Use Cases

- **Content Research**: Analyze video performance and trends
- **Competitor Analysis**: Monitor competitor profiles and content
- **Data Collection**: Build datasets for machine learning or analysis
- **Content Aggregation**: Collect videos from multiple creators
- **Trend Analysis**: Track popular content and hashtags
- **Social Media Monitoring**: Monitor specific profiles for new content

### Frequently Asked Questions

#### Why is Apify Proxy recommended?

TikTok often blocks or throttles requests from datacenter IPs (including Apify's). Keeping **Apify Proxy enabled** (the default) makes runs more reliable and helps avoid the actor being marked as deprecated due to failed automated health checks.

#### How does proxy rotation work?

The actor uses a smart proxy rotation strategy:

1. **Default**: No proxy (direct connection)
2. **If blocked**: Automatically switches to datacenter proxy
3. **If still blocked**: Falls back to residential proxy with 3 retry attempts
4. **Sticky behavior**: Once a proxy type is selected, it sticks for all remaining requests
5. **Clear logging**: All proxy events are logged for transparency

#### Can I scrape private profiles?

No, this actor only works with public TikTok profiles. Private profiles cannot be accessed without authentication.

#### What's the rate limit?

The actor includes built-in delays (1-2 seconds) between requests to be respectful to TikTok's servers. For large-scale scraping, consider using proxy configuration.

#### How many videos can I scrape?

You can scrape unlimited videos per profile, or set a `maxVideos` limit. The actor will continue until all videos are scraped or the limit is reached.

#### Does this work with keywords?

Currently, the actor focuses on profile scraping. Keyword search functionality may be added in future versions.

#### What if a profile doesn't exist?

The actor will log an error and continue with the next profile in the list. Failed profiles are tracked in the final summary.

### Support and Feedback

For issues, questions, or feedback, please contact the actor maintainer or open an issue in the Apify platform.

### Cautions

- Data is collected only from **publicly available sources**
- No data is taken from private accounts or password-protected content
- The end user is responsible for ensuring legal compliance (spam laws, privacy, data protection, etc.)
- Respect TikTok's Terms of Service and rate limits
- Use responsibly and ethically

***

**Note**: This actor uses TikTok's official web API and may be affected by changes to TikTok's platform. Regular updates ensure compatibility with the latest TikTok structure.

# Actor input Schema

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

Add TikTok profile URLs (e.g. https://www.tiktok.com/@username) or just usernames (e.g. mrbeast). One per line.

## `sortOrder` (type: `string`):

Newest first or oldest first.

## `maxVideos` (type: `integer`):

Cap how many videos to scrape per profile. Use 0 for no limit (scrape all).

## `proxyConfiguration` (type: `object`):

Default: no proxy (requests sent to platform). If blocked, fallback: datacenter → residential (3 retries). Once fallback occurs, we stick with that proxy for all remaining requests.

## Actor input object example

```json
{
  "startUrls": [
    "https://www.tiktok.com/@mrbeast"
  ],
  "sortOrder": "newest",
  "maxVideos": 10,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# 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 = {
    "startUrls": [
        "https://www.tiktok.com/@mrbeast"
    ],
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("scrapelabsapi/tiktok-profile-videos-api-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 = {
    "startUrls": ["https://www.tiktok.com/@mrbeast"],
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("scrapelabsapi/tiktok-profile-videos-api-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 '{
  "startUrls": [
    "https://www.tiktok.com/@mrbeast"
  ],
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call scrapelabsapi/tiktok-profile-videos-api-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Tiktok Profile Videos Api Scraper",
        "version": "0.1",
        "x-build-id": "ZeQFeDoHNfoSulnRO"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/scrapelabsapi~tiktok-profile-videos-api-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-scrapelabsapi-tiktok-profile-videos-api-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/scrapelabsapi~tiktok-profile-videos-api-scraper/runs": {
            "post": {
                "operationId": "runs-sync-scrapelabsapi-tiktok-profile-videos-api-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/scrapelabsapi~tiktok-profile-videos-api-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-scrapelabsapi-tiktok-profile-videos-api-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",
                "required": [
                    "startUrls"
                ],
                "properties": {
                    "startUrls": {
                        "title": "🔗 Profiles to scrape",
                        "type": "array",
                        "description": "Add TikTok profile URLs (e.g. https://www.tiktok.com/@username) or just usernames (e.g. mrbeast). One per line.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "sortOrder": {
                        "title": "📊 Sort by",
                        "enum": [
                            "newest",
                            "oldest"
                        ],
                        "type": "string",
                        "description": "Newest first or oldest first.",
                        "default": "newest"
                    },
                    "maxVideos": {
                        "title": "📹 Max videos per profile",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Cap how many videos to scrape per profile. Use 0 for no limit (scrape all).",
                        "default": 10
                    },
                    "proxyConfiguration": {
                        "title": "🌐 Proxy",
                        "type": "object",
                        "description": "Default: no proxy (requests sent to platform). If blocked, fallback: datacenter → residential (3 retries). Once fallback occurs, we stick with that proxy for all remaining requests."
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
