# Tiktok Videos by Profile (`shareze001/tiktok-videos-by-profile`) Actor

Get all videos of a user on tiktok.

- **URL**: https://apify.com/shareze001/tiktok-videos-by-profile.md
- **Developed by:** [shareze](https://apify.com/shareze001) (community)
- **Categories:** E-commerce, Videos, Social media
- **Stats:** 16 total users, 0 monthly users, 0.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## 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.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## TikTok Videos by Profile Scraper

This Apify Actor is designed to scrape TikTok videos from a specific profile. It allows you to retrieve detailed information about videos posted by the specified TikTok user.

### How to Use

#### 1. Input Configuration

The Actor requires an input JSON object to define the scraping parameters. The structure of the input is as follows:

```json
{
  "profile": "nike",
  "size": 10
}
```

- **`profile`**: (Required) The TikTok profile username to scrape videos from. For example, "nike".
- **`size`**: (Required) The number of videos to retrieve. Default is 10.

#### 2. Output Data

The Actor returns an array of objects containing information about the TikTok videos from the specified profile. The structure of each object is as follows:

```json
{
  "id": "123456789",
  "url": "https://www.tiktok.com/@example_user/video/123456789",
  "createTime": 1680000000,
  "desc": "This is an example video description.",
  "autor": {
    "id": "987654321",
    "avatarLarger": "https://example.com/avatar_large.jpg",
    "avatarMedium": "https://example.com/avatar_medium.jpg",
    "avatarThumb": "https://example.com/avatar_thumb.jpg",
    "nickname": "Example User",
    "uniqueId": "example_user",
    "verified": true,
    "privateAccount": false
  },
  "authorStats": {
    "followerCount": 1000,
    "heartCount": 5000,
    "videoCount": 50
  },
  "challenges": [
    {
      "id": "111",
      "title": "Example Challenge"
    }
  ],
  "music": {
    "id": "222",
    "title": "Example Music",
    "authorName": "Example Artist"
  },
  "stats": {
    "playCount": 10000,
    "likeCount": 500,
    "commentCount": 50,
    "shareCount": 10
  },
  "textLanguage": "en",
  "video": {
    "duration": 30,
    "height": 1080,
    "width": 1920,
    "url": "https://example.com/video.mp4"
  }
}
```

- **`id`**: The unique ID of the video.
- **`url`**: The URL to the TikTok video.
- **`createTime`**: The creation timestamp of the video.
- **`desc`**: The description of the video.
- **`autor`**: Information about the video author.
- **`authorStats`**: Statistics about the author, such as follower count and total likes.
- **`challenges`**: A list of challenges associated with the video.
- **`music`**: Information about the music used in the video.
- **`stats`**: Statistics about the video, such as play count and like count.
- **`textLanguage`**: The language of the video's text.
- **`video`**: Details about the video, such as duration and resolution.

#### 3. Running the Actor

1. Deploy the Actor on the Apify platform.
2. Provide the input JSON in the Actor's input configuration.
3. Run the Actor to scrape data.
4. The results will be available in the Actor's dataset.

#### 4. Example Use Case

To scrape TikTok videos from the profile "nike":

1. Set the input as:
   ```json
   {
     "profile": "nike",
     "size": 5
   }
   ```
2. Run the Actor.
3. Retrieve the output dataset containing the video details.

### Notes

- This Actor uses TikTok's public web interface to fetch data.
- Ensure that the input profile username is valid and corresponds to an existing TikTok profile.
- The Actor is optimized for performance but may be subject to rate limits or restrictions imposed by TikTok.

# Actor input Schema

## `size` (type: `integer`):

video size

## `profile` (type: `string`):

tiktok profile

## Actor input object example

```json
{
  "size": 10,
  "profile": "nike"
}
```

# 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 = {
    "size": 10,
    "profile": "nike"
};

// Run the Actor and wait for it to finish
const run = await client.actor("shareze001/tiktok-videos-by-profile").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "size": 10,
    "profile": "nike",
}

# Run the Actor and wait for it to finish
run = client.actor("shareze001/tiktok-videos-by-profile").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{
  "size": 10,
  "profile": "nike"
}' |
apify call shareze001/tiktok-videos-by-profile --silent --output-dataset

```

## MCP server setup

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

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/lSj4F6yOWBb68Ifqy/builds/GaZbcRgoI3NMY9iww/openapi.json
