# Tiktok Shop Product (`excavator/tiktok-shop-product`) Actor

This is the Actor for crawling data from the TikTok shop product URLs.
For example: https://shop.tiktok.com/view/product/XXXXXXXXXX
OR https://www.tiktok.com/t/XXXXXXXXX/ which only available for TikTok Shop US. I increased price because TikTok always update their algorithm, 10$/1000 request

- **URL**: https://apify.com/excavator/tiktok-shop-product.md
- **Developed by:** [Excavator](https://apify.com/excavator) (community)
- **Categories:** Automation, Developer tools, SEO tools
- **Features:** Full permissions
- **Stats:** 263 total users, 2 monthly users, 100.0% runs succeeded, 7 bookmarks
- **User rating**: 1.13 out of 5 stars

## Pricing

$10.00 / 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/actors/running/actors-in-store.md#pay-per-event

## 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 Shop Product Crawler

**TikTok Shop Product Crawler** is a lightweight and efficient service designed to extract product data from TikTok Shop URLs. This service is ideal for developers, marketers, and businesses seeking to automate data collection from TikTok Shop for analysis, inventory management, or market research.

### Features

- **Simple Input**: Provide a list of TikTok Shop product URLs to crawl.
- **Detailed Output**: Extracts product titles and all associated images.
- **Durable and Trustworthy**: The first and only service on Apify specifically designed for TikTok Shop product data crawling, ensuring reliability and robustness.

### Input Format

The input is a JSON object containing a list of TikTok Shop product URLs.

Example:

```json
{
  "urls": [
    "https://shop.tiktok.com/view/product/1729802854478746459"
  ]
}
```

### Output Format

The output is a JSON array with the extracted product information, including the product title and image URLs.
If you need more Data from output please get in touch with me, I will update it soon.

Example:

```json
[
  {
    "title": "Hunter Trump With Busch Light Beer Hoodie, Trump Shirt, Camo Sweater, Dog Hunting Shirt, Busch Light Shirt, Election 2024 Gift Casual For Men Women",
    "images": [
      "https://p19-oec-ttp.tiktokcdn-us.com/tos-useast5-i-omjb5zjo8w-tx/5f4d5cc370a24872830494b469250fa4~tplv-omjb5zjo8w-resize-jpeg:800:800.jpeg?from=1826719393",
      "https://p19-oec-ttp.tiktokcdn-us.com/tos-useast5-i-omjb5zjo8w-tx/7433da77ad404dadb442dd94d65ba9e8~tplv-omjb5zjo8w-resize-jpeg:800:800.jpeg?from=1826719393",
      "https://p19-oec-ttp.tiktokcdn-us.com/tos-useast5-i-omjb5zjo8w-tx/88effcef48bf4138910566a3b5ec23cf~tplv-omjb5zjo8w-resize-jpeg:800:800.jpeg?from=1826719393"
      // Additional images here
    ],
    "sold": 150,
    "price": "$9.00 - 31.20"
  }
]
```

### Better memory performance

By default the Memory use is 4GB, you can add enable more memory usage by add query parameter in to API url\
For Example: Increase the maximum to 32GB

```
https://api.apify.com/v2/acts/excavator~tiktok-shop-product/runs?token=<TOKEN>&memory=32768
```

By default, up to 10 URLs are processed at the same time. You can increase this limit to speed up processing, but it may use more memory.
The chunk setting divides the list of URLs into smaller groups for processing. Larger chunks allow more URLs to be handled in parallel,
but they can also use more memory and increase the chance of slowdowns. Here's an example configuration with higher concurrency and chunk size:

```json
{
  "urls": [
    "https://shop.tiktok.com/view/product/1729802854478746459"
  ],
  "concurrency": 20,
  "chunk": 200
}
```

- **chunk**: `200`: The input URLs are divided into chunks of `200 URLs` each, processed by multiple threads.
- **concurrency**: `20`: Within each chunk, up to `20 URLs` are processed simultaneously.

Follow deafult configuration `1000` Urls may take ~60s and cost `4.4Gb`. You may need to increase your RAM if you would like to run more than that at a time
![metric](https://i.ibb.co/xJT7Krp/c85cbe99-c7c5-4204-b5ab-aa6422245a4f.jpg)

### Key Benefits

- Unique Solution: The first and only service on Apify dedicated to TikTok Shop product crawling.
- Highly Reliable: Designed for durability and consistent performance.
- Easy to Use: Supports simple JSON input and output for seamless integration with your applications.

### Getting Started

1. Prepare a JSON file containing the TikTok Shop product URLs you want to crawl.
2. Use the service to process your input and extract product data.
3. Receive a JSON array containing the product title and image URLs.

### Use Cases

- Market Research: Analyze trending products on TikTok Shop.
- Inventory Management: Automate data collection for your business needs.
- Data Enrichment: Enhance your existing product database with TikTok Shop product details.

### Why Choose This Service?

This is the most durable and trustworthy service for TikTok Shop data crawling on Apify. Backed by a robust architecture, it ensures accurate and efficient data extraction.

# Actor input Schema

## `urls` (type: `array`):

A list of website URLs from which data will be retrieved.

## `chunk` (type: `integer`):

The number of input items to divide into chunks for processing across multiple threads.

## `concurrency` (type: `integer`):

The maximum number of URLs processed simultaneously within a single chunk.

## Actor input object example

```json
{
  "urls": [
    "https://www.tiktok.com/view/product/1729394745420976584"
  ],
  "chunk": 100,
  "concurrency": 10
}
```

# 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 = {
    "urls": [
        "https://www.tiktok.com/view/product/1729394745420976584"
    ],
    "chunk": 100,
    "concurrency": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("excavator/tiktok-shop-product").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 = {
    "urls": ["https://www.tiktok.com/view/product/1729394745420976584"],
    "chunk": 100,
    "concurrency": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("excavator/tiktok-shop-product").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 '{
  "urls": [
    "https://www.tiktok.com/view/product/1729394745420976584"
  ],
  "chunk": 100,
  "concurrency": 10
}' |
apify call excavator/tiktok-shop-product --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,excavator/tiktok-shop-product"
        }
    }
}
```

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/tAxPXrWWdsGlws4ac/builds/o9rPoXiJyPfgU8nb3/openapi.json
