# TikTok user posts scrapper

**Action ID:** `tiktok_user_posts_scrapper`

## Description

Scrape TikTok posts for a user.

## Connection

| Name               | Description                                 | Required | Category |
| ------------------ | ------------------------------------------- | -------- | -------- |
| PixelML Connection | The PixelML connection to call PixelML API. | True     | pixelml  |

## Input Parameters

| Name       | Type    | Required | Default | Description                                            |
| ---------- | ------- | :------: | ------- | ------------------------------------------------------ |
| user\_name | string  |     ✓    | -       | The TikTok username to scrape posts from               |
| max\_items | integer |     -    | 10      | The maximum number of posts to scrape. Range: 1 to 100 |

<details>

<summary>View JSON Schema</summary>

```json
{
  "description": "TikTok user posts scrapper node input.",
  "properties": {
    "user_name": {
      "description": "The username of the TikTok user.",
      "title": "TikTok username",
      "type": "string"
    },
    "max_items": {
      "default": 10,
      "description": "The maximum number of posts to scrape (1-100).",
      "maximum": 100,
      "minimum": 1,
      "title": "Maximum number of posts",
      "type": "integer"
    }
  },
  "required": [
    "user_name"
  ],
  "title": "TikTokUserPostsScrapperNodeInput",
  "type": "object"
}
```

</details>

## Output Parameters

| Name  | Type  | Description                                                                     |
| ----- | ----- | ------------------------------------------------------------------------------- |
| posts | array | Array of TikTok post objects containing engagement metrics and song information |

**TikTokPostData Object:**

| Field        | Type           | Description                              |
| ------------ | -------------- | ---------------------------------------- |
| id           | string         | The unique identifier of the TikTok post |
| title        | string         | The caption or title of the post         |
| views        | integer        | Total number of views                    |
| likes        | integer        | Total number of likes                    |
| comments     | integer        | Total number of comments                 |
| shares       | integer        | Total number of shares                   |
| bookmarks    | integer        | Total number of bookmarks/saves          |
| song\_title  | string         | Title of the audio track used            |
| song\_artist | string         | Artist of the audio track                |
| song\_album  | string or null | Album name (if available)                |

<details>

<summary>View JSON Schema</summary>

```json
{
  "$defs": {
    "TikTokPostData": {
      "description": "TikTok post data.",
      "properties": {
        "id": {
          "description": "The ID of the TikTok post.",
          "title": "Id",
          "type": "string"
        },
        "title": {
          "description": "The title or caption of the TikTok post.",
          "title": "Title",
          "type": "string"
        },
        "views": {
          "description": "The number of views for the post.",
          "title": "Views",
          "type": "integer"
        },
        "likes": {
          "description": "The number of likes for the post.",
          "title": "Likes",
          "type": "integer"
        },
        "comments": {
          "description": "The number of comments on the post.",
          "title": "Comments",
          "type": "integer"
        },
        "shares": {
          "description": "The number of shares for the post.",
          "title": "Shares",
          "type": "integer"
        },
        "bookmarks": {
          "description": "The number of bookmarks for the post.",
          "title": "Bookmarks",
          "type": "integer"
        },
        "song_title": {
          "description": "The title of the song used in the post.",
          "title": "Song Title",
          "type": "string"
        },
        "song_artist": {
          "description": "The artist of the song used in the post.",
          "title": "Song Artist",
          "type": "string"
        },
        "song_album": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The album of the song used in the post.",
          "title": "Song Album"
        }
      },
      "required": [
        "id",
        "title",
        "views",
        "likes",
        "comments",
        "shares",
        "bookmarks",
        "song_title",
        "song_artist"
      ],
      "title": "TikTokPostData",
      "type": "object"
    }
  },
  "description": "TikTok user posts scrapper node output.",
  "properties": {
    "posts": {
      "description": "The list of TikTok posts for the user.",
      "items": {
        "$ref": "#/$defs/TikTokPostData"
      },
      "title": "Posts",
      "type": "array"
    }
  },
  "required": [
    "posts"
  ],
  "title": "TikTokUserPostsScrapperNodeOutput",
  "type": "object"
}
```

</details>

## How It Works

This node connects to TikTok through the PixelML API to scrape public post data from a specified user's profile. It retrieves comprehensive information about each post including engagement metrics (views, likes, comments, shares, bookmarks) and audio details (song title, artist, album), returning up to the specified maximum number of posts in reverse chronological order for analysis and tracking purposes.

## Usage Examples

### Example 1: Analyze Influencer Content

**Input:**

```
user_name: "creativecreator"
max_items: 5
```

**Output:**

```
posts: [
  {
    "id": "7234567890123456789",
    "title": "Easy morning routine tips! #morningroutine #productivity",
    "views": 1245000,
    "likes": 89500,
    "comments": 2340,
    "shares": 4200,
    "bookmarks": 12300,
    "song_title": "Chill Vibes",
    "song_artist": "Lo-Fi Beats",
    "song_album": "Relaxing Sounds"
  },
  {
    "id": "7234567890123456788",
    "title": "Quick recipe for busy weeknights 🍝",
    "views": 987000,
    "likes": 67800,
    "comments": 1890,
    "shares": 3100,
    "bookmarks": 8900,
    "song_title": "Cooking Time",
    "song_artist": "Kitchen Beats",
    "song_album": null
  }
]
```

### Example 2: Track Brand Account Performance

**Input:**

```
user_name: "techgadgets_official"
max_items: 20
```

**Output:**

```
posts: [
  {
    "id": "7234567890123456790",
    "title": "Unboxing the latest smartphone! Link in bio 📱",
    "views": 2500000,
    "likes": 185000,
    "comments": 5600,
    "shares": 8900,
    "bookmarks": 23400,
    "song_title": "Tech Innovation",
    "song_artist": "Future Sound",
    "song_album": "Digital Age"
  },
  // ... 19 more posts
]
```

### Example 3: Research Competitor Content Strategy

**Input:**

```
user_name: "competitor_account"
max_items: 50
```

**Output:**

```
posts: [
  {
    "id": "7234567890123456791",
    "title": "New product launch coming soon! Stay tuned 👀",
    "views": 456000,
    "likes": 34200,
    "comments": 890,
    "shares": 1200,
    "bookmarks": 4500,
    "song_title": "Hype Music",
    "song_artist": "Trending Artist",
    "song_album": "Viral Hits"
  },
  // ... 49 more posts
]
```

## Common Use Cases

* **Influencer Analysis**: Research potential influencer partners by analyzing their content performance and engagement rates
* **Competitive Intelligence**: Track competitor content strategies, posting frequency, and audience engagement trends
* **Content Performance Tracking**: Monitor your own brand's TikTok performance over time to identify top-performing content
* **Trend Discovery**: Analyze popular songs, hashtags, and content themes across multiple creators in your niche
* **Engagement Benchmarking**: Compare engagement metrics across different creators to establish industry benchmarks
* **Campaign Monitoring**: Track campaign-specific posts and measure their reach and engagement during promotional periods
* **Content Planning**: Study successful content patterns to inform your content creation strategy

## Error Handling

| Error Type                | Cause                                               | Solution                                                                        |
| ------------------------- | --------------------------------------------------- | ------------------------------------------------------------------------------- |
| User Not Found            | The username doesn't exist on TikTok                | Verify the username is correct and the account is public                        |
| Private Account           | The TikTok account is set to private                | Only public accounts can be scraped; request the user make their account public |
| Rate Limited              | Too many requests in a short time period            | Wait a few minutes before retrying or reduce the frequency of requests          |
| Connection Error          | Unable to connect to PixelML or TikTok              | Check your PixelML connection settings and network connectivity                 |
| Invalid Max Items         | max\_items is outside the 1-100 range               | Set max\_items between 1 and 100                                                |
| No Posts Available        | The user has no public posts or deleted all content | Verify the account has published posts and they are publicly visible            |
| API Authentication Failed | PixelML connection credentials are invalid          | Verify your PixelML connection configuration and API credentials                |

## Notes

* **PixelML Connection Required**: This node requires a valid PixelML connection to access TikTok data through their API.
* **Public Accounts Only**: The node can only scrape data from public TikTok accounts; private accounts will return an error.
* **Recent Posts First**: Posts are returned in reverse chronological order, with the most recent posts appearing first in the array.
* **Rate Limiting**: Be mindful of rate limits when scraping multiple accounts or making frequent requests.
* **Data Freshness**: Engagement metrics represent a snapshot at the time of scraping and may change over time.
* **Username Format**: Use the TikTok username without the @ symbol (e.g., "username" not "@username").
* **Max Items Limit**: While you can request up to 100 posts, the actual number returned may be less if the user has fewer posts.
* **Song Information**: Song data is extracted from the post's audio track; original sounds or deleted audio may show limited information.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.agenticflow.ai/reference/nodes/tiktok_user_posts_scrapper.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
