# Tokopedia Product Search Scraper (`ecomscrape/tokopedia-product-search-scraper`)

The Tokopedia Product Search Scraper extracts detailed product data from Tokopedia including name, price, brand, etc., using search query URLs. It's perfect for market research, trend analysis, lead generation, and campaign planning.

- **URL**: https://beta-securitybyobscurity.apify.com/ecomscrape/tokopedia-product-search-scraper.md
- **Developed by:** [ecomscrape](https://beta-securitybyobscurity.apify.com/ecomscrape) (community)
- **Categories:** E-commerce, Lead generation, Automation
- **Stats:** 18 total users, 2 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

$20.00/month + usage

To use this Actor, you pay a monthly rental fee to the developer. The rent is subtracted from your prepaid usage every month after the free trial period.
You also pay for the Apify platform usage, which gets cheaper the higher Apify subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#rental-actors

# README

## Contact

If you encounter any issues or need to exchange information, please feel free to contact us through the following link:
[My profile](https://apify.com/ecomscrape)

## **Advanced Tokopedia Marketplace Data Extraction Solution**

Tokopedia stands as the largest eCommerce marketplace in the Indonesian region, serving millions of consumers and merchants across the archipelago. With Indonesia's e-commerce market expected to reach $200 billion by 2025, accessing and analyzing product data from this platform has become crucial for businesses, researchers, and market analysts. Tokopedia provides a customer-to-customer (C2C) platform that is free to use for merchants and buyers, hosting products across at least 25 categories, making it a goldmine of market intelligence and competitive data.

### Overview of Tokopedia Product Search Scraper

Our Tokopedia scraper is designed to efficiently extract comprehensive product information from search results and category pages. This powerful tool navigates through product listings, collecting detailed data including pricing, ratings, seller information, and product specifications. The scraper handles Tokopedia's dynamic loading system and anti-bot measures through advanced proxy rotation and intelligent request management.

The scraper is ideal for e-commerce businesses conducting competitive analysis, market researchers tracking price trends, dropshippers identifying profitable products, and data analysts studying Indonesian consumer behavior. With its robust error handling and scalable architecture, it ensures reliable data extraction even from large product catalogs.

### Input and Output Details

Example url 1: https://www.tokopedia.com/p/fashion-anak-bayi/baju-sepatu-bayi/piyama-bayi

Example url 2: https://www.tokopedia.com/p/audio-kamera-elektronik-lainnya/aksesoris-kamera/tripod-kamera

Example url 3: https://www.tokopedia.com/p/audio-kamera-elektronik-lainnya/kamera-pengintai

Example Screenshot of product list by query page:

![](https://i.ibb.co/WcMVBWj/Screenshot-from-2025-01-10-11-20-41.png)

#### Input Format

The scraper accepts configuration in JSON format with three key components:

```json
{
  "max_retries_per_url": 2, // Maximum waiting time when accessing the links you provided.
  "proxy": { // Add a proxy to ensure that during the data collection process, you are not detected as a bot.
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL" 
    ],
    "apifyProxyCountry": "SG" // You should choose an Country that coincides with the Country you want to collect data from
  },
  "max_items_per_url": 20,
  "urls": [ // Links to product list by query pages.
    "https://www.tokopedia.com/p/fashion-anak-bayi/baju-sepatu-bayi/piyama-bayi",
    "https://www.tokopedia.com/p/audio-kamera-elektronik-lainnya/aksesoris-kamera/tripod-kamera",
    "https://www.tokopedia.com/p/audio-kamera-elektronik-lainnya/kamera-pengintai"
  ]
}
```

**Configuration Parameters:**

- `max_retries_per_url`: Controls retry attempts for failed requests (recommended: 2-3)
- `proxy`: Essential for avoiding bot detection; residential proxies from Singapore work best for Indonesian sites
- `max_items_per_url`: Limits products extracted per URL to manage processing time
- `urls`: Array of Tokopedia category or search result URLs

#### Output Format

You get the output from the Tokopedia Product Search Scraper stored in a tab. The following is an example of the Information Fields collected after running the Actor.

```json
[ // List of product information
  {
    "id": "3867655430",
    "url": "https://www.tokopedia.com/minicottons/mini-cottons-baby-sleepsuit-jumper-bayi-piyama-bayi-mustard-18-24-bulan?extParam=ivf%3Dfalse",
    "image_url": "https://images.tokopedia.net/img/cache/700/VqbcmM/2023/10/17/77b4cfcc-7bb3-48b2-a1b0-0fe55f699810.jpg",
    "name": "MINI COTTONS BABY Sleepsuit Jumper Bayi Piyama bayi",
    "price": 64900.0,
    "original_price": 230000.0,
    "currency": "Rp",
    "discount_percentage": 72,
    "is_preorder": false,
    "rating": 5.0,
    "count_review": 458,
    "category": "Fashion Anak & Bayi",
    "shop_info": {
      "id": 9560455,
      "name": "MINI COTTONS",
      "url": "https://www.tokopedia.com/minicottons",
      "location": "Bandung"
    }
  }, // ... Many other product details
] 
```

#### Output Format

The scraper returns structured data for each product with the following fields:

**Core Product Information:**

- **ID**: Tokopedia's unique product identifier - essential for tracking and referencing specific items
- **URL**: Direct product page link - enables easy access to full product details and customer reviews
- **Image URL**: Primary product image link - crucial for visual product catalogs and marketing materials

**Pricing Data:**

- **Price**: Current selling price in Indonesian Rupiah - the actual price customers pay
- **Original Price**: Initial price before discounts - helps calculate deal attractiveness
- **Currency**: Always IDR for Tokopedia - ensures proper price formatting in applications
- **Discount Percentage**: Calculated discount amount - valuable for identifying promotional opportunities

**Performance Metrics:**

- **Rating**: Average customer rating (1-5 stars) - indicates product quality and customer satisfaction
- **Count Review**: Total number of reviews - shows product popularity and provides confidence in ratings

**Product Classification:**

- **Category**: Product category classification - useful for organizing data and market segmentation
- **Is Preorder**: Boolean indicating availability status - helps identify inventory constraints

**Seller Information:**

- **Shop Info**: Merchant details including shop name, location, and verification status - critical for supplier analysis and trust assessment

Example output structure helps businesses quickly identify profitable products, track competitor pricing, and analyze market trends across Indonesia's diverse product landscape.

### How to Use the Scraper

**Step 1: Prepare URLs** - Navigate to Tokopedia and copy category page URLs or search result URLs. Ensure URLs contain product listings rather than individual product pages.

**Step 2: Configure Settings** - Set appropriate retry limits (2-3 recommended), enable residential proxies from Southeast Asian countries, and limit items per URL based on your processing needs.

**Step 3: Run Extraction** - Execute the scraper and monitor progress. The tool handles pagination automatically and respects rate limits to avoid blocking.

**Best Practices:**

- Use residential proxies to maintain access reliability
- Rotate between different category URLs to diversify data
- Monitor for CAPTCHA challenges and adjust retry settings accordingly
- Schedule runs during off-peak Indonesian hours for better performance

**Common Issues:** Handle connection timeouts by increasing retry limits, resolve blocked requests by switching proxy countries, and manage large datasets by processing URLs in batches.

### Benefits and Applications

This scraper delivers significant time savings by automating data collection that would take hours manually. Market researchers gain instant access to pricing trends, product performance metrics, and competitor analysis across Indonesia's largest marketplace. E-commerce businesses can identify trending products, monitor competitor pricing strategies, and discover new suppliers efficiently.

The extracted data enables price comparison services, supports dropshipping product research, powers market intelligence dashboards, and facilitates academic research into Southeast Asian e-commerce trends. With comprehensive seller information included, users can also analyze merchant performance and identify reliable suppliers for business partnerships.

### Conclusion

The Tokopedia Product Search Scraper provides essential market intelligence from Indonesia's dominant e-commerce platform. Whether you're conducting competitive research, identifying market opportunities, or building data-driven applications, this tool delivers accurate, comprehensive product data efficiently. Start extracting valuable insights from millions of products and stay ahead in the rapidly growing Indonesian e-commerce market.

## Related Actors

- [**Tokopedia Product Details Page Scraper**](https://apify.com/ecomscrape/tokopedia-product-page-details-scraper): A specialized data extraction tool engineered to harvest comprehensive product information from Tokopedia's dominant Indonesian marketplace.

## Your feedback

We are always working to improve Actors' performance. So, if you have any technical feedback about Tokopedia Product Search Scraper or simply found a bug, please create an issue on the Actor's Issues tab in Apify Console.

# Actor input Schema

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

Add the URLs of the Product list page urls you want to scrape. You can paste URLs one by one, or use the Bulk edit section to add a prepared list.

## `max_items_per_url` (type: `integer`):

Limit the number of items per URL you want to scrape

## `max_retries_per_url` (type: `integer`):

Limit the number of retries for each URL if the scrape is detected as a bot or the page fails to load

## `proxy` (type: `object`):

Select proxies to be used by your scraper.

## Actor input object example

```json
{
  "urls": [
    "https://www.tokopedia.com/p/fashion-anak-bayi/baju-sepatu-bayi/piyama-bayi"
  ],
  "max_items_per_url": 20,
  "max_retries_per_url": 2,
  "proxy": {
    "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 = {
    "urls": [
        "https://www.tokopedia.com/p/fashion-anak-bayi/baju-sepatu-bayi/piyama-bayi"
    ],
    "max_items_per_url": 20,
    "max_retries_per_url": 2,
    "proxy": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("ecomscrape/tokopedia-product-search-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 = {
    "urls": ["https://www.tokopedia.com/p/fashion-anak-bayi/baju-sepatu-bayi/piyama-bayi"],
    "max_items_per_url": 20,
    "max_retries_per_url": 2,
    "proxy": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("ecomscrape/tokopedia-product-search-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 '{
  "urls": [
    "https://www.tokopedia.com/p/fashion-anak-bayi/baju-sepatu-bayi/piyama-bayi"
  ],
  "max_items_per_url": 20,
  "max_retries_per_url": 2,
  "proxy": {
    "useApifyProxy": false
  }
}' |
apify call ecomscrape/tokopedia-product-search-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=ecomscrape/tokopedia-product-search-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Tokopedia Product Search Scraper",
        "description": "The Tokopedia Product Search Scraper extracts detailed product data from Tokopedia including name, price, brand, etc., using search query URLs. It's perfect for market research, trend analysis, lead generation, and campaign planning.",
        "version": "0.0",
        "x-build-id": "dT9s8bEcxJx2HippV"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/ecomscrape~tokopedia-product-search-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-ecomscrape-tokopedia-product-search-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/ecomscrape~tokopedia-product-search-scraper/runs": {
            "post": {
                "operationId": "runs-sync-ecomscrape-tokopedia-product-search-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/ecomscrape~tokopedia-product-search-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-ecomscrape-tokopedia-product-search-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",
                "properties": {
                    "urls": {
                        "title": "URLs of the Product list page urls to scrape",
                        "type": "array",
                        "description": "Add the URLs of the Product list page urls you want to scrape. You can paste URLs one by one, or use the Bulk edit section to add a prepared list.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "max_items_per_url": {
                        "title": "Limit the number of items per URL",
                        "type": "integer",
                        "description": "Limit the number of items per URL you want to scrape"
                    },
                    "max_retries_per_url": {
                        "title": "Limit the number of retries for each URL",
                        "type": "integer",
                        "description": "Limit the number of retries for each URL if the scrape is detected as a bot or the page fails to load"
                    },
                    "proxy": {
                        "title": "Proxy configuration",
                        "type": "object",
                        "description": "Select proxies to be used by your scraper."
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
