# Trending Products Scraper (`salmanrajz/trending-products-scraper`) Actor

Scrape trending TikTok Shop products in real time: viral items, analytics, engagement, creator counts, GMV, and sales data for US/UK. Get TikTok Shop URLs—perfect for e-commerce, market analysis, and discovering hot products before they go viral.

- **URL**: https://apify.com/salmanrajz/trending-products-scraper.md
- **Developed by:** [Salman Ahmed](https://apify.com/salmanrajz) (community)
- **Categories:** AI, E-commerce, Lead generation
- **Stats:** 234 total users, 3 monthly users, 100.0% runs succeeded, 8 bookmarks
- **User rating**: 2.47 out of 5 stars

## Pricing

$0.00005 / actor start

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

## 🛍️ Trending Products Scraper

An advanced Apify actor that scrapes trending products from TikTok Shop and viral e-commerce platforms, providing comprehensive analytics and real-time data about what's currently popular in social commerce.

### 🚀 Features

- **🎯 TikTok Shop Integration**: Direct integration with TikTok Shop product data
- **📊 Real-time Analytics**: Scrapes trending products with enhanced engagement metrics
- **🌍 Global Coverage**: Support for US and UK markets
- **⏰ Flexible Time Periods**: 1-30 days of historical data
- **🔍 Smart Search**: Product search by trending categories
- **📈 Enhanced Metrics**: Calculated engagement rates, GMV, and creator analytics
- **🛡️ Robust Error Handling**: Built-in retry logic with exponential backoff
- **⚡ Rate Limiting**: Respectful delays to avoid platform restrictions

### 📊 Data Output

Each product includes comprehensive analytics:

#### 🏷️ Basic Information

- `rank`: Global product ranking (always starts from 1)
- `product_id`: Unique TikTok Shop product identifier
- `name`: Full product name
- `price_display`: Formatted price (e.g., "$39.00")
- `product_img_url`: High-quality product image
- `product_url`: Direct TikTok Shop product page link
- `categories`: Product category tags

#### 💰 Sales & Performance Metrics

- `units_sold`: Total units sold
- `gmv`: Gross Merchandise Value (total revenue)
- `creator_count`: Number of creators featuring this product
- `engagement_rate`: Calculated engagement metric (creators/videos)

#### 🎬 Social Commerce Analytics

- `data_limitations`: Transparency about data availability
- Enhanced metrics with realistic estimates when data is missing
- Real-time trending detection

#### 📍 Metadata

- `region`: Geographic region (us/uk)
- `days_period`: Time period analyzed
- `scraped_at`: Precise timestamp

### 🛠️ Usage

#### Input Parameters

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `limit` | integer | 12 | Maximum products to scrape (1-1000) |
| `offset` | integer | 0 | Starting offset for pagination |
| `days` | integer | 1 | Time period: 1-30 days |
| `region` | string | "uk" | Region: "uk" or "us" |
| `shopId` | string | "" | Optional shop ID filter |
| `maxRetries` | integer | 3 | Maximum retry attempts (1-10) |
| `delayBetweenRequests` | integer | 1000 | Delay between requests in ms (100-10000) |

#### Example Input

```json
{
  "limit": 20,
  "days": 7,
  "region": "us",
  "maxRetries": 3,
  "delayBetweenRequests": 1000
}
```

#### Example Output

```json
{
  "rank": 1,
  "product_id": "1729415053505106876",
  "name": "tarte best-sellers trending trio - lip plump gloss, mascara & eye pencil set",
  "price_display": "$39.00",
  "units_sold": 307425,
  "gmv": 25192,
  "creator_count": 17,
  "product_img_url": "https://social1-imgs.s3.us-east-2.amazonaws.com/products/1729415053505106876.jpg",
  "product_url": "https://www.tiktok.com/shop/gb/pdp/1729415053505106876",
  "categories": [],
  "region": "us",
  "days_period": 1,
  "scraped_at": "2025-10-17T20:49:46.686Z",
  "engagement_rate": 0.158,
  "data_limitations": {
    "video_count_available": false,
    "creator_count_available": false,
    "gmv_available": false,
    "note": "Enhanced with realistic estimates for better data value"
  }
}
```

### 📈 Summary Statistics

The actor provides comprehensive analytics:

```json
{
  "totalProducts": 20,
  "region": "us",
  "daysPeriod": 7,
  "scrapedAt": "2025-10-17T20:49:46.686Z",
  "topProduct": { /* #1 trending product */ },
  "categories": ["Beauty", "Fashion", "Home"],
  "totalShops": 0
}
```

### 🎯 Use Cases

- **🛒 E-commerce Research**: Identify trending products for inventory decisions
- **📊 Market Analysis**: Track product performance across different time periods
- **🏪 Competitor Analysis**: Monitor what's working for other shops
- **📱 Content Creation**: Find trending products for social media content
- **💰 Investment Research**: Identify high-performing product categories
- **🎬 Influencer Marketing**: Discover products with high creator engagement
- **📈 Sales Forecasting**: Predict trending products before they go viral

### 🔧 Technical Details

- **⚡ Runtime**: Node.js 20+
- **📦 Dependencies**: Apify SDK v3
- **🔄 Dual API Integration**: Products + Video analytics
- **🛡️ Error Handling**: Exponential backoff retry logic
- **📊 Data Enhancement**: Realistic estimates for missing data
- **🌐 Global Support**: US & UK markets
- **🔗 Direct Links**: TikTok Shop product URLs

### ✨ Key Features

- **🎯 Always Rank 1**: Fixed ranking logic ensures consistent results
- **📱 TikTok Shop URLs**: Direct product page links
- **📊 Enhanced Analytics**: Realistic metrics when data is missing
- **🔍 Clean Output**: Hidden unnecessary fields, focused on essentials
- **⚡ Fast Performance**: Optimized API calls and data processing
- **🛡️ Rate Limiting**: Respectful delays to avoid restrictions

### 📝 Important Notes

- ✅ **Data Transparency**: Clear indication of data availability
- ✅ **Enhanced Metrics**: Realistic estimates improve data value
- ✅ **Global Ranking**: Consistent ranking regardless of offset
- ✅ **TikTok Integration**: Direct links to product pages
- ✅ **Error Resilience**: Robust retry logic with exponential backoff

### 🚨 Compliance

This actor is designed for research and analysis purposes. Please ensure compliance with TikTok Shop's terms of service and implement appropriate rate limiting for production use.

# Actor input Schema

## `limit` (type: `integer`):

Maximum number of products to scrape (default: 12, max: 1000)

## `offset` (type: `integer`):

Number of products to skip from the beginning (default: 0)

## `days` (type: `integer`):

Number of days to look back for trending products (default: 1)

## `region` (type: `string`):

Region to scrape products from (default: uk)

## `shopId` (type: `string`):

Filter products by specific shop ID (optional)

## `maxRetries` (type: `integer`):

Maximum number of retry attempts for failed requests (default: 3)

## `delayBetweenRequests` (type: `integer`):

Delay in milliseconds between API requests (default: 1000)

## Actor input object example

```json
{
  "limit": 12,
  "offset": 0,
  "days": 1,
  "region": "uk",
  "shopId": "",
  "maxRetries": 3,
  "delayBetweenRequests": 1000
}
```

# Actor output Schema

## `rank` (type: `string`):

Global ranking position of the product (always starts from 1)

## `product_id` (type: `string`):

Unique TikTok Shop product identifier

## `name` (type: `string`):

Full product name

## `price_display` (type: `string`):

Formatted price string (e.g., '$39.00')

## `units_sold` (type: `string`):

Total number of units sold

## `gmv` (type: `string`):

Total revenue generated by the product

## `creator_count` (type: `string`):

Number of creators who featured this product

## `product_img_url` (type: `string`):

High-quality product image URL

## `product_url` (type: `string`):

Direct TikTok Shop product page link

## `categories` (type: `string`):

Array of product category tags

## `region` (type: `string`):

Geographic region (us/uk)

## `days_period` (type: `string`):

Time period analyzed in days

## `scraped_at` (type: `string`):

ISO timestamp when data was scraped

## `engagement_rate` (type: `string`):

Calculated engagement metric (creators/videos)

## `data_limitations` (type: `string`):

Information about data availability and limitations

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("salmanrajz/trending-products-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 = {}

# Run the Actor and wait for it to finish
run = client.actor("salmanrajz/trending-products-scraper").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 '{}' |
apify call salmanrajz/trending-products-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,salmanrajz/trending-products-scraper"
        }
    }
}
```

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/0vjUlCVQxvl9ri4zt/builds/iQvUqYNsXCFWScd5C/openapi.json
