# Trendyol Product Search Scraper (`ecomscrape/trendyol-product-search-scraper`) Actor

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

- **URL**: https://apify.com/ecomscrape/trendyol-product-search-scraper.md
- **Developed by:** [ecomscrape](https://apify.com/ecomscrape) (community)
- **Categories:** Automation, E-commerce, Lead generation
- **Features:** Full permissions
- **Stats:** 133 total users, 1 monthly users, 100.0% runs succeeded, 0 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

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

## What does Trendyol Product Search Query Scraper do?

### Introduction

Trendyol stands as Turkey's largest and fastest-growing ecommerce platform, commanding over 20 million monthly visitors and serving more than 40 million active customers. Making up 50% of online fashion and 70% of online beauty sales in Turkey, this marketplace hosts over 250,000 merchants across diverse categories including fashion, electronics, home goods, and cosmetics.

For businesses, researchers, and analysts, extracting product data from Trendyol presents invaluable opportunities for market intelligence, competitive pricing analysis, and trend identification. However, manually collecting this data across thousands of products is time-consuming and impractical. Our Trendyol Product Search Query Scraper addresses this challenge by automating the data extraction process efficiently and accurately.

### Scraper Overview

The Trendyol Product Search Query Scraper is a sophisticated tool designed to extract comprehensive product information from Trendyol's search results and category pages. Built for scalability and reliability, it handles multiple URLs simultaneously while respecting rate limits and anti-bot measures through residential proxy integration.

This scraper caters to ecommerce professionals, market researchers, price monitoring services, and businesses seeking competitive intelligence. Whether you're analyzing competitor pricing strategies, identifying trending products, or conducting market research across Turkish and European markets, this tool provides the data foundation you need.

The scraper supports multi-country extraction, making it particularly valuable given Trendyol's expansion into Romania, Czech Republic, Slovakia, Poland, Hungary, Bulgaria, and Greece.

### Input and Output Format

*Please note that not all URLs will yield results based on the country code selected. The product list may differ for each country code, and there may be instances where it doesn't work or an error occurs, preventing the selected country page from loading.*

Therefore, it’s recommended to choose the country code that corresponds to the language code in the URL, or select the Auto-select country code if missing option if you prefer not to manually enter it.

Below is a table showing the country codes that correspond to the language codes in the URL:

| Language Code | Country Code               |
|---------------|----------------------------|
| tr            | tr                         |
| de            | de, at                     |
| en            | ae, sa, qa, kw, om, bh, be, bg, hr, cz, dk, ee, fi, fr, gr, hu, ie, it, lv, lt, mt, nl, pl, pt, ro, sk, si, es, se, gb, lu |
| ar            | ae, sa, qa, kw, om, bh     |
| bg            | bg                         |
| cs            | cz                         |
| el            | gr                         |
| hu            | hu                         |
| pl            | pl                         |
| ro            | ro                         |
| sk            | sk                         |

Example 1:

- Url: https://www.trendyol.com/en/men-t-shirts-x-g2-c73?pi=2
- Languge code in url: en
- Country code: ie
  \=> Matched

Example 2:

- Url: https://www.trendyol.com/de/men-t-shirts-x-g2-c73?pi=2
- Languge code in url: de
- Country code: ie
  \=> Not Match

Example 3:

- Url: https://www.trendyol.com/men-t-shirts-x-g2-c73?pi=2
- Languge code in url: not found
- Country code: No need filled in

**Input Parameters Explained:**

##### Scrape with Urls:

*When providing URLs, all options in the "scrape with search filters" section are disabled. Only data from specified URLs will be collected.*

**URLs Parameter:**

- Add product list page URLs with optional country codes
- URLs may or may not include language codes
- If URL has language code but no country_code specified, enable `auto_select_country_code_if_missing`
- Use Bulk edit to add multiple URLs at once

**Ignore URL Failures:**

- When `true`, scraper continues processing other URLs even if some fail after max retries
- Prevents one problematic URL from stopping the entire job

##### Scrape with Filters options:

*When using search filters, leave the `urls` field empty. The scraper will build search URLs automatically based on your filters.*

**Keyword:**

- Search term to find items (e.g., "men t-shirts", "dresses")

**Country Code:**

- Select target country for search
- Available: tr, de, ae, sa, qa, kw, om, bh, ua, md, at, be, bg, hr, cz, dk, ee, fi, fr, gr, hu, ie, it, lv, lt, nl, pl, pt, ro, sk, si, es, se, az, us, lu, ge, kz, kg, jo, iq, lb

**Language Code:**

- Select display language for results
- Available: tr (Turkish), de (German), en (English), ar (Arabic), bg (Bulgarian), cs (Czech), el (Greek), hu (Hungarian), pl (Polish), ro (Romanian), sk (Slovak)

**Sort By:**

- `""` - Recommended sorting
- `PRICE_BY_ASC` - Lowest price
- `PRICE_BY_DESC` - Highest price
- `MOST_RECENT` - Newest
- `BEST_SELLER` - Best selling
- `MOST_FAVOURITE` - Most favorited
- `MOST_RATED` - Most reviewed

**Discount:**

- `true` - Show only discounted items
- `false` - Show all items

**Availability:**

- `true` - Show only available items
- `false` - Show all items including out of stock

**Page:**

- Starting page number for search results
- Useful for continuing interrupted scrapes

##### General options:

*These options apply to both scraping modes:*

**Auto Select Country Code:**

- Automatically detects country code from URL when not explicitly provided
- Ensures accurate results when language code is present in URL

**Max Items Per URL:**

- Limit number of items scraped per URL or search filter
- Default: 20

**Max Retries Per URL:**

- Maximum retry attempts for each URL or search filter when detected as bot or page load fails
- Default: 2
- Balances thoroughness with efficiency

**Proxy Configuration:**

- Essential for maintaining anonymity and avoiding detection
- Residential proxies recommended
- Set `apifyProxyCountry` to match target country for best results

Some cases when used Trendyol Product Search Query Scraper to collect product data from product list by query pages:

##### 1. Use a url with a language code and country code option filled in

Example url: https://www.trendyol.com/en/men-t-shirts-x-g2-c73?pi=2

\=> Language code in url *en*

Example country code filled in: ie

Example Screenshot of product information page:

![](https://i.ibb.co/RyMq0k9/Screenshot-from-2025-01-09-16-29-01.png)

**Input:**

```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
  },
  "auto_select_country_code_if_missing": true,
  "max_items_per_url": 20,
  "ignore_url_failures": true,
  "urls": [ 
    {
      "url":"https://www.trendyol.com/en/men-t-shirts-x-g2-c73?pi=2", // Links to product list by query page.
      "country_code": "ie" // Country code
    }
  ]
}
```

**Output:**

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

```json
[ // List of product information
  {
    "url": "https://www.trendyol.com/en/lacoste/agate-nepse-t-shirt-for-men-p-782813730",
    "title": "AGATE NEPSE T-Shirt For Men",
    "brand": "Lacoste",
    "image_url": "https://cdn.dsmcdn.com/mnresize/400/-/ty1614/product/media/images/prod/PIM/20241223/11/7fa2a2e1-1168-4623-b646-e63486c96315/1_org_zoom.jpg",
    "total_reviews": 6,
    "rating_score": null,
    "old_price": null,
    "social_proof": [
      "🚀\n60 added to cart",
      "🧡\n208 favorites"
    ],
    "discount_percentage": null,
    "lastest_price": null,
    "currency": "€",
    "promotion_name": "Free Shipping",
    "from_url": "https://www.trendyol.com/en/men-t-shirts-x-g2-c73?pi=2",
    "from_country_code": "ie"
  }, // ... Many other product details
]
```

##### 2. Use a url with a language code and country code option not filled in

Example url: https://www.trendyol.com/en/men-t-shirts-x-g2-c73?pi=2

\=> Language code in url *en*

Example Screenshot of product information page:

![](https://i.ibb.co/1KHm38Z/Screenshot-from-2025-01-09-16-32-00.png)

**Input:**

```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
  },
  "auto_select_country_code_if_missing": true,
  "max_items_per_url": 20,
  "ignore_url_failures": true,
  "urls": [ 
    {
      "url":"https://www.trendyol.com/en/men-t-shirts-x-g2-c73?pi=2" // Links to product list by query page.
    }
  ]
}
```

**Output:**

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

```json
[ // List of product information
  {
    "url": "https://www.trendyol.com/en/trendyol-collection/comfortable-fit-printed-brown-cotton-t-shirt-tmnss23ts00261-p-471465156",
    "title": "Comfortable Fit Printed Brown Cotton T-Shirt - TMNSS23TS00261",
    "brand": "Trendyol Collection",
    "image_url": "https://cdn.dsmcdn.com/mnresize/400/-/ty740/product/media/images/20230221/8/285502456/671822618/5/5_org_zoom.jpg",
    "total_reviews": 1456,
    "rating_score": null,
    "old_price": "32.99",
    "social_proof": [
      "🚀\n50+ items sold",
      "🚀\n622 added to cart",
      "🧡\n35K favorites"
    ],
    "discount_percentage": "-30%",
    "lastest_price": "23.09",
    "currency": "SAR",
    "promotion_name": "Free Shipping over 100 SAR",
    "from_url": "https://www.trendyol.com/en/men-t-shirts-x-g2-c73?pi=2",
    "from_country_code": "ae"
  }, // ... Many other product details
]
```

##### 3. Use a url without a language code and country code option not filled in

Example url: https://www.trendyol.com/men-t-shirts-x-g2-c73?pi=2

Example Screenshot of product information page:

![](https://i.ibb.co/hfvnrZp/Screenshot-from-2025-01-09-16-33-04.png)

**Input:**

```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
  },
  "auto_select_country_code_if_missing": true,
  "max_items_per_url": 20,
  "ignore_url_failures": true,
  "urls": [ 
    {
      "url":"https://www.trendyol.com/men-t-shirts-x-g2-c73?pi=2" // Links to product list by query page.
    }
  ]
}
```

**Output:**

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

```json
[ // List of product information
  {
    "url": "https://www.trendyol.com/grimelange/river-erkek-nakis-islemeli-oversize-100-organik-pamuk-orme-siyah-t-shirt-p-52477773",
    "title": "Rıver Erkek Nakış Işlemeli Oversize %100 Organik Pamuk Örme Siyah T-shirt",
    "brand": "GRIMELANGE",
    "image_url": "https://cdn.dsmcdn.com/ty1618/prod/QC/20241231/18/9f764fb4-41b2-38a6-8773-aa42fad6dd3f/1_org.jpg",
    "total_reviews": 4691,
    "rating_score": 46.0,
    "old_price": "279,99",
    "social_proof": [
      "Son 3 günde 100+ ürün satıldı!",
      "82.7B kişi favoriledi!",
      "Son 3 günde 100+ ürün satıldı!"
    ],
    "discount_percentage": null,
    "lastest_price": "229,99",
    "currency": "TL",
    "promotion_name": null,
    "from_url": "https://www.trendyol.com/men-t-shirts-x-g2-c73?pi=2",
    "from_country_code": "gb"
  }, // ... Many other product details
]
```

##### 4. Use a url a language code and country code option not filled in

Example url: https://www.trendyol.com/de/men-t-shirts-x-g2-c73?pi=2

\=> Language code in url *de*

Example country code filled in: ie

**Input:**

```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
  },
  "auto_select_country_code_if_missing": true,
  "max_items_per_url": 20,
  "ignore_url_failures": true,
  "urls": [ 
    {
      "url":"https://www.trendyol.com/de/men-t-shirts-x-g2-c73?pi=2", // Links to product list by query page.
      "country_code": "ie" // Country code
    }
  ]
}
```

**Output:**

*No output, because the country code you provided doesn't match the URL.*

\=> As demonstrated in the four use cases above, the information displayed for the first product we collect differs in each case, in case 4, no results are collected. Therefore, we recommend filling in the country code for each URL to ensure the desired results are achieved.

##### 5. Use a search filters option to scrape

Example Screenshot of product information page:

![](https://i.ibb.co/sv3YZr2k/Screenshot-from-2025-11-07-17-57-11.png)

**Input:**

```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
  },
  "auto_select_country_code_if_missing": true,
  "max_items_per_url": 20,
  "keyword": "Shoe",
  "country_code": "bg",
  "language_code": "en",
  "sort_by": "PRICE_BY_ASC",
  "page": 1,
  "discount": false,
  "availability": true,
}
```

**Output:**

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

```json
[ // List of product information
  {
  "url": "https://www.trendyol.com/shoes-center/beyaz-1-cm-kalinliginda-1-cift-yassi-spor-ayakkabi-bagcigi-p-921814420?boutiqueId=61&merchantId=109491",
  "title": "Beyaz 1 cm Kalınlığında 1 Çift Yassı Spor Ayakkabı Bağcığı",
  "brand": "Shoes Center",
  "image_url": [
    "https://cdn.dsmcdn.com/mnresize/400/-/ty1786/prod/QC_ENRICHMENT/20251106/11/9bfdf8e9-3220-3f29-b240-9cafda87aab7/1_org_zoom.jpg",
    "https://cdn.dsmcdn.com/mnresize/400/-/ty1786/prod/QC_ENRICHMENT/20251106/11/83d7f40d-e6bf-3eb8-a088-50daef8af522/1_org_zoom.jpg",
    "https://cdn.dsmcdn.com/mnresize/400/-/ty1786/prod/QC_ENRICHMENT/20251106/11/53e02056-2334-3ccb-9dda-551aded021f9/1_org_zoom.jpg",
    "https://cdn.dsmcdn.com/mnresize/400/-/ty1786/prod/QC_ENRICHMENT/20251106/11/9bfdf8e9-3220-3f29-b240-9cafda87aab7/1_org_zoom.jpg",
    "https://cdn.dsmcdn.com/mnresize/400/-/ty1786/prod/QC_ENRICHMENT/20251106/11/83d7f40d-e6bf-3eb8-a088-50daef8af522/1_org_zoom.jpg",
    "https://cdn.dsmcdn.com/mnresize/400/-/ty1786/prod/QC_ENRICHMENT/20251106/11/53e02056-2334-3ccb-9dda-551aded021f9/1_org_zoom.jpg",
    "https://cdn.dsmcdn.com/mnresize/400/-/ty1786/prod/QC_ENRICHMENT/20251106/11/9bfdf8e9-3220-3f29-b240-9cafda87aab7/1_org_zoom.jpg",
    "https://cdn.dsmcdn.com/mnresize/400/-/ty1786/prod/QC_ENRICHMENT/20251106/11/83d7f40d-e6bf-3eb8-a088-50daef8af522/1_org_zoom.jpg",
    "https://cdn.dsmcdn.com/mnresize/400/-/ty1786/prod/QC_ENRICHMENT/20251106/11/53e02056-2334-3ccb-9dda-551aded021f9/1_org_zoom.jpg"
  ],
  "total_reviews": 2,
  "rating_score": 30.0,
  "old_price": "84,90 TL",
  "social_proof": null,
  "discount_percentage": null,
  "lastest_price": "41,88 TL",
  "currency": "TL",
  "promotion_name": null,
  "from_url": "url='https://www.trendyol.com/sr?q=Shoe&sst=PRICE_BY_ASC&cc=False&bs=True&pi=1' country_code='tr' is_compatible=False"
} // ... Many other product details
]
```

#### Output Format

The scraper returns structured data with 12 key fields per product:

**Core Product Information:**

- **URL**: Direct product page link for detailed access
- **Title**: Complete product name and description
- **Brand**: Manufacturer or brand name
- **Image URL**: High-resolution product image link

**Pricing and Commercial Data:**

- **Latest Price**: Current selling price
- **Old Price**: Original price before discounts
- **Currency**: Price denomination (TRY, EUR, etc.)
- **Discount Percentage**: Savings percentage calculation
- **Promotion Name**: Active campaign or sale information

**Social Proof and Quality Metrics:**

- **Total Reviews**: Review count indicating product popularity
- **Rating Score**: Average customer rating (1-5 scale)
- **Social Proof**: Additional trust indicators and badges

Each field serves specific business purposes: pricing data enables competitive analysis, review metrics indicate product performance, and promotion information reveals marketing strategies. The structured output integrates seamlessly with analytics tools, databases, and business intelligence platforms.

### Usage Guide

**Step 1: Configuration**\
You can scrape product data from Trendyol either by providing target URLs from search results or category pages, or by specifying filter options such as keyword, country code, and sorting:

- **By URLs**:\
  Configure your input JSON with one or more product list or category URLs. Each URL can optionally include a `country_code` for region-specific extraction. If the country code is missing, you can enable the auto-select feature to let the scraper choose the most suitable code.

- **By Filters**:\
  Instead of providing URLs, you can use filter options including `keyword`, `country_code`, `language_code`, `sort_by`, `discount`, `availability`, and `page` to construct your target product lists dynamically. In this mode, leave the `urls` field empty or set to `null`.

Ensure you set the proxy settings to match your target country for optimal data accuracy and successful scraping.

**Step 2: URL or Filter Selection**

- Use specific search query or category page URLs, including all filter parameters (such as price, brand, ratings) as needed for your extraction goals.
- If scraping by filters, set desired filters directly in your JSON configuration for greater flexibility.

**Step 3: Execution**\
Run the scraper with your chosen configuration. Monitor progress with the provided logging and real-time status updates. The scraper will automatically handle pagination, retries, and country/language adjustments according to your settings.

**Best Practices:**

- Start with small batches (e.g., 5-10 URLs or a few search filter combinations) to verify correct results and configuration.
- Use residential proxies to minimize IP blocking and gain access to local content.
- Set reasonable delays between requests to prevent server-side blocking.
- Double-check that country and language codes match your extraction targets.
- Take advantage of the auto-select country code feature if your URLs do not specify it.
- Regularly update URLs and filter parameters to reflect product changes on Trendyol.

**Filter-based Scraping Notes:**

- You can search for products using just a keyword or a combination of filters such as `country_code`, `language_code`, `discount`, sorting options, and so on.
- Leave the `urls` property empty when scraping by filters.
- All filter options (like `discount`, `availability`, `page`, etc.) can be combined for precise and dynamic product extraction.

**Common Issues and Solutions:**

- **Empty Results**: Double-check your URLs or filter parameters. Make sure your proxies provide access to the necessary Trendyol region.
- **Blocked Requests**: Increase proxy rotation frequency, enable proxies from the target market, and slow down request speed.
- **Missing Data**: Some items may not include all details; review extraction logs and update parameters if needed.

**Error Handling:**
Common issues include rate limiting (solved by proxy rotation), invalid URLs (verify Trendyol format), and country mismatches (check regional availability).

### Benefits and Applications

**Time Efficiency:** Eliminate manual data collection from thousands of products. What previously required days of manual work completes in hours.

**Market Intelligence:** Track competitor pricing, identify trending products, and monitor market dynamics across multiple categories and regions.

**Business Applications:**

- **Retailers**: Monitor competitor pricing and product availability
- **Brands**: Track product performance and market positioning
- **Researchers**: Analyze consumer trends and market patterns
- **Agencies**: Provide clients with comprehensive market reports

**Regional Insights:** With Trendyol's expansion across Europe, extract data from multiple markets for comparative analysis and international strategy development.

### Conclusion

The Trendyol Product Search Query Scraper transforms manual data collection into an automated, scalable process. By providing comprehensive product intelligence from Turkey's leading ecommerce platform, it empowers businesses to make data-driven decisions in competitive markets.

Start extracting valuable product insights today and gain the competitive advantage your business needs.

## Relate Actors

[**Trendyol Product Details Page Scraper**](https://apify.com/ecomscrape/trendyol-product-page-details-scraper): A powerful tool designed to automatically extracts comprehensive product information from Trendyol's marketplace platform.

## Your feedback

We are always working to improve Actors' performance. So, if you have any technical feedback about Trendyol Product Search Query 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 by query and country code (optional) you want to scrape. The URL may or may not include a language code. If url include language code and you do not enter the country code please select Auto select country code. You can paste URLs one by one, or use the Bulk edit section to add a prepared list.

## `ignore_url_failures` (type: `boolean`):

If true, the scraper will continue running even if some URLs fail to be scraped after the maximum number of retries is reached.

## `keyword` (type: `string`):

Enter the keyword to search for items

## `country_code` (type: `string`):

Search Items in the selected country code

## `language_code` (type: `string`):

Search Items in the selected language code

## `sort_by` (type: `string`):

Sort Items by (e.g., price-ascending, price-descending, title-ascending, title-descending, relevance)

## `discount` (type: `boolean`):

Show items with discount

## `availability` (type: `boolean`):

Show items with availability

## `page` (type: `integer`):

Specify the page number to start scraping from

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

Limit the number of items per URL or search filters you want to scrape

## `auto_select_country_code_if_missing` (type: `boolean`):

If you do not enter the country code in the Urls, to ensure you get the desired results, use Auto select country code.

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

Limit the number of retries for each URL or search filters 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": [
    {
      "url": "https://www.trendyol.com/en/men-t-shirts-x-g2-c73?pi=2",
      "country_code": "sa"
    },
    {
      "url": "https://www.trendyol.com/men-t-shirts-x-g2-c73?pi=2"
    }
  ],
  "ignore_url_failures": true,
  "discount": true,
  "availability": true,
  "max_items_per_url": 20,
  "auto_select_country_code_if_missing": true,
  "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": [
        {
            "url": "https://www.trendyol.com/en/men-t-shirts-x-g2-c73?pi=2",
            "country_code": "sa"
        },
        {
            "url": "https://www.trendyol.com/men-t-shirts-x-g2-c73?pi=2"
        }
    ],
    "ignore_url_failures": true,
    "discount": true,
    "availability": true,
    "max_items_per_url": 20,
    "auto_select_country_code_if_missing": true,
    "max_retries_per_url": 2,
    "proxy": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("ecomscrape/trendyol-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": [
        {
            "url": "https://www.trendyol.com/en/men-t-shirts-x-g2-c73?pi=2",
            "country_code": "sa",
        },
        { "url": "https://www.trendyol.com/men-t-shirts-x-g2-c73?pi=2" },
    ],
    "ignore_url_failures": True,
    "discount": True,
    "availability": True,
    "max_items_per_url": 20,
    "auto_select_country_code_if_missing": True,
    "max_retries_per_url": 2,
    "proxy": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("ecomscrape/trendyol-product-search-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 '{
  "urls": [
    {
      "url": "https://www.trendyol.com/en/men-t-shirts-x-g2-c73?pi=2",
      "country_code": "sa"
    },
    {
      "url": "https://www.trendyol.com/men-t-shirts-x-g2-c73?pi=2"
    }
  ],
  "ignore_url_failures": true,
  "discount": true,
  "availability": true,
  "max_items_per_url": 20,
  "auto_select_country_code_if_missing": true,
  "max_retries_per_url": 2,
  "proxy": {
    "useApifyProxy": false
  }
}' |
apify call ecomscrape/trendyol-product-search-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,ecomscrape/trendyol-product-search-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/iTZBfLiohApgH666l/builds/YatJVwhWVna6RJz8i/openapi.json
