# 🛍️ Skroutz Product Scraper (`mpelas/mpelas-myactor-skroutz`) Actor

Scrape 100+ products from Skroutz.gr in under 2 minutes!
Perfect for price monitoring and market research.
No coding required. 📊

- **URL**: https://apify.com/mpelas/mpelas-myactor-skroutz.md
- **Developed by:** [Michalis Paignigiannis](https://apify.com/mpelas) (community)
- **Categories:** E-commerce
- **Features:** Limited permissions
- **Stats:** 28 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.50 / 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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

### SKROUTZ SCRAPER

I'll create a comprehensive Apify actor to scrape products from Skroutz.gr, focusing on the XHR API endpoint that returns the product JSON data.

main.py+112-24
Perfect! I've created a specialized Apify actor for scraping Skroutz.gr products. Here's what the code does:

Key Features:

1. XHR API Intercception:

Listens for the variations.json XHR endpoint that contains product data
Automatically captures and parses the JSON responses
2\. Product Data Extraction:

Extracts SKU ID, product name, price, URLs (product & image), and color variations
Handles the nested JSON structure from Skroutz API responses
3\. Helper Functions:

parse_skroutz_products(): Parses the complex API response structure
extract_search_query(): Extracts the search term from the URL
4\. Data Enrichment:

Adds page URL, search query, and page title to each product record
Structured output ready for storage or processing
How to Use:
Input Format:

{  "start_urls": \[    {"url": "https://www.skroutz.gr/search?keyphrase=tplink+tapo+camera"}  ],  "max_requests_per_crawl": 5}
Output Format:
Each product will be saved with:

{  "sku_id": 46360886,  "name": "TP-LINK Tapo C220 v1 IP Κάμερα Wi-Fi Full HD+ 4MP",  "price": "24,64 €",  "url": "/s/46360886/...",  "image_url": "//b.scdn.gr/images/...",  "follow": true,  "page_url": "https://www.skroutz.gr/search?keyphrase=...",  "search_query": "tplink tapo camera",  "page_title": "..."}
The actor uses Playwright to handle JavaScript rendering and Cloudflare's protections, then intercepts the XHR responses to extract the product JSON data efficiently!

### Python Crawlee with Playwright template

A template for [web scraping](https://apify.com/web-scraping) data from websites starting from provided URLs using Python. The starting URLs are passed through the Actor's input schema, defined by the [input schema](https://docs.apify.com/platform/actors/development/input-schema). The template uses [Crawlee for Python](https://crawlee.dev/python) for efficient web crawling, making requests via headless browser managed by [Playwright](https://playwright.dev/python/), and handling each request through a user-defined handler that uses [Playwright](https://playwright.dev/python/) API to extract data from the page. Enqueued URLs are managed in the [request queue](https://crawlee.dev/python/api/class/RequestQueue), and the extracted data is saved in a [dataset](https://crawlee.dev/python/api/class/Dataset) for easy access.

### Included features

- **[Apify SDK](https://docs.apify.com/sdk/python/)** - a toolkit for building Apify [Actors](https://apify.com/actors) in Python.
- **[Crawlee for Python](https://crawlee.dev/python/)** - a web scraping and browser automation library.
- **[Input schema](https://docs.apify.com/platform/actors/development/input-schema)** - define and validate a schema for your Actor's input.
- **[Request queue](https://crawlee.dev/python/api/class/RequestQueue)** - manage the URLs you want to scrape in a queue.
- **[Dataset](https://crawlee.dev/python/api/class/Dataset)** - store and access structured data extracted from web pages.
- **[Playwright](https://playwright.dev/python/)** - a library for managing headless browsers.

### Resources

- [Video introduction to Python SDK](https://www.youtube.com/watch?v=C8DmvJQS3jk)
- [Webinar introducing to Crawlee for Python](https://www.youtube.com/live/ip8Ii0eLfRY)
- [Apify Python SDK documentation](https://docs.apify.com/sdk/python/)
- [Crawlee for Python documentation](https://crawlee.dev/python/docs/quick-start)
- [Python tutorials in Academy](https://docs.apify.com/academy/python)
- [Integration with Make, GitHub, Zapier, Google Drive, and other apps](https://apify.com/integrations)
- [Video guide on getting scraped data using Apify API](https://www.youtube.com/watch?v=ViYYDHSBAKM)
- A short guide on how to build web scrapers using code templates:

[web scraper template](https://www.youtube.com/watch?v=u-i-Korzf8w)

### Getting started

For complete information [see this article](https://docs.apify.com/platform/actors/development#build-actor-locally). To run the Actor use the following command:

```bash
apify run
```

### Deploy to Apify

#### Connect Git repository to Apify

If you've created a Git repository for the project, you can easily connect to Apify:

1. Go to [Actor creation page](https://console.apify.com/actors/new)
2. Click on **Link Git Repository** button

#### Push project on your local machine to Apify

You can also deploy the project on your local machine to Apify without the need for the Git repository.

1. Log in to Apify. You will need to provide your [Apify API Token](https://console.apify.com/account/integrations) to complete this action.

   ```bash
   apify login
   ```

2. Deploy your Actor. This command will deploy and build the Actor on the Apify Platform. You can find your newly created Actor under [Actors -> My Actors](https://console.apify.com/actors?tab=my).

   ```bash
   apify push
   ```

### Documentation reference

To learn more about Apify and Actors, take a look at the following resources:

- [Apify SDK for JavaScript documentation](https://docs.apify.com/sdk/js)
- [Apify SDK for Python documentation](https://docs.apify.com/sdk/python)
- [Apify Platform documentation](https://docs.apify.com/platform)
- [Join our developer community on Discord](https://discord.com/invite/jyEM2PRvMU)

# Actor input Schema

## `start_urls` (type: `array`):

URLs to start with

## `max_requests_per_crawl` (type: `integer`):

Maximum number of requests per crawl

## Actor input object example

```json
{
  "start_urls": [
    {
      "url": "https://www.skroutz.gr/search?keyphrase=lenovo+laptop"
    },
    {
      "url": "https://www.skroutz.gr/search?keyphrase=hp+laptop"
    },
    {
      "url": "https://www.skroutz.gr/search?keyphrase=dell+laptop"
    }
  ],
  "max_requests_per_crawl": 5
}
```

# Actor output Schema

## `overview` (type: `string`):

No description

# 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 = {
    "start_urls": [
        {
            "url": "https://www.skroutz.gr/search?keyphrase=lenovo+laptop"
        },
        {
            "url": "https://www.skroutz.gr/search?keyphrase=hp+laptop"
        },
        {
            "url": "https://www.skroutz.gr/search?keyphrase=dell+laptop"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("mpelas/mpelas-myactor-skroutz").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 = { "start_urls": [
        { "url": "https://www.skroutz.gr/search?keyphrase=lenovo+laptop" },
        { "url": "https://www.skroutz.gr/search?keyphrase=hp+laptop" },
        { "url": "https://www.skroutz.gr/search?keyphrase=dell+laptop" },
    ] }

# Run the Actor and wait for it to finish
run = client.actor("mpelas/mpelas-myactor-skroutz").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 '{
  "start_urls": [
    {
      "url": "https://www.skroutz.gr/search?keyphrase=lenovo+laptop"
    },
    {
      "url": "https://www.skroutz.gr/search?keyphrase=hp+laptop"
    },
    {
      "url": "https://www.skroutz.gr/search?keyphrase=dell+laptop"
    }
  ]
}' |
apify call mpelas/mpelas-myactor-skroutz --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,mpelas/mpelas-myactor-skroutz"
        }
    }
}
```

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/UbAEWyFikIepRcEfS/builds/6k8a2CtWshSAA2qIQ/openapi.json
