# eMAG Romania Product Scraper (`khadinakbar/emag-romania-product-scraper`) Actor

Scrape emag.ro products by keyword, category/search URL, or product URL — RON prices, ratings, stock, seller, optional specs.

- **URL**: https://apify.com/khadinakbar/emag-romania-product-scraper.md
- **Developed by:** [Khadin Akbar](https://apify.com/khadinakbar) (community)
- **Categories:** E-commerce, Automation, MCP servers
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.00 / 1,000 product scrapeds

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

## eMAG Romania Product Scraper

Extract public emag.ro catalogue products into structured dataset rows for Romanian price-monitoring teams, marketplace sellers, and AI agents. Paste a keyword, a category/search URL, or a `/pd/{PNK}/` product URL and the Actor returns RON prices, ratings, review counts, stock labels, category trail, PNK/SKU, and optional detail enrichment (brand, MPN, specs, description, gallery, seller).

This Actor stays on the Romania market only. For African multi-market retail cards use [Jumia Product Scraper](https://apify.com/khadinakbar/jumia-product-scraper) when the job is Jumia markets instead of emag.ro. For US retail product detail use [Walmart Data Extractor](https://apify.com/khadinakbar/walmart-data-extractor) when the next step is Walmart.com cards instead of Romanian listings.

### Best fit for this Actor

- Start with `searchKeywords` or emag.ro `/c`, `/sd`, search, or `/pd/` URLs when you need public catalogue rows in RON rather than a multi-country marketplace dump.
- Use `maxResults` as the spend cap: each saved product is one `product-scraped` event; detail enrichment adds `product-detail-enriched` when enabled or when you paste a product URL.
- Continue with [Alibaba Listings Scraper](https://apify.com/khadinakbar/alibaba-listings-scraper) when the next step is B2B supplier cards instead of Romanian consumer listings.

### Practical scenario

A Romanian price analyst pastes `laptop` with `maxResults` 20, keeps Residential RO on, and receives listing cards with RON sale price, old price, discount, rating, stock, PNK, and product URL. The team compares assortment against a competitor, then schedules the same input weekly. When they already have a MacBook `/pd/` link, they set `enrichDetails` (or paste the product URL alone) to merge brand, MPN, specs, and gallery. `OUTPUT` and `RUN_SUMMARY` state whether collection finished, found no public match, needed a later retry, or rejected non-emag.ro input.

### Quick start input

```json
{
  "searchKeywords": ["laptop"],
  "maxResults": 20,
  "enrichDetails": false,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": ["RESIDENTIAL"],
    "apifyProxyCountry": "RO"
  }
}
```

Provide at least one `searchKeywords` value or one emag.ro `startUrls` entry. `maxResults` defaults to 50 and caps at 5000. The Console quality sample uses 20 products so a first run stays bounded.

### Input reference

| Field | Type | What it controls |
| --- | --- | --- |
| `searchKeywords` | string\[] | Keywords searched on emag.ro. Optional if `startUrls` is set. |
| `startUrls` | object\[] | emag.ro search, `/c`/`/sd` category, or `/pd/{PNK}/` product URLs. |
| `maxResults` | integer | Overall saved-product cap. Default 50. Prefill 20. |
| `enrichDetails` | boolean | Fetch PDP fields (brand, MPN, specs, description, gallery). Product URLs always enrich. |
| `proxyConfiguration` | object | Defaults to Apify Residential in Romania. Bare IPs often hit AWS WAF captcha. |

### What data you receive

Each dataset item is one public product observation.

```json
{
  "title": "Laptop ASUS Vivobook 15",
  "price": 2499.99,
  "oldPrice": 2999.99,
  "discountPercent": 16.7,
  "currency": "RON",
  "rating": 4.94,
  "reviewCount": 17,
  "brand": "ASUS",
  "seller": "eMAG",
  "availability": "În stoc",
  "inStock": true,
  "productUrl": "https://www.emag.ro/example/pd/DGWN0M2BM/",
  "imageUrl": "https://s13emagst.akamaized.net/products/example.jpg",
  "pnk": "DGWN0M2BM",
  "sku": "DGWN0M2BM",
  "categoryPath": ["Laptopuri"],
  "enriched": false,
  "scrapedAt": "2026-09-23T12:00:00.000Z"
}
```

The default key-value store also contains:

- `OUTPUT` — `outcome`, message, saved count, warnings, and charged event counts.
- `RUN_SUMMARY` — input counts, request attempts, and terminal diagnostics.

`COMPLETE`, `PARTIAL`, `VALID_EMPTY`, and `INVALID_INPUT` finish successfully. `UPSTREAM_FAILED` is the honest terminal state when valid work received no usable catalogue data after retries (for example persistent WAF captcha). Control rows stay out of the product dataset.

### Use through the API

```bash
curl "https://api.apify.com/v2/acts/khadinakbar~emag-romania-product-scraper/runs?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"searchKeywords":["casti bluetooth"],"maxResults":10,"proxyConfiguration":{"useApifyProxy":true,"apifyProxyGroups":["RESIDENTIAL"],"apifyProxyCountry":"RO"}}'
```

```js
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('khadinakbar/emag-romania-product-scraper').call({
  searchKeywords: ['casti bluetooth'],
  maxResults: 10,
  proxyConfiguration: {
    useApifyProxy: true,
    apifyProxyGroups: ['RESIDENTIAL'],
    apifyProxyCountry: 'RO',
  },
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

### Use with AI agents through Apify MCP

> Scrape public emag.ro products for keyword `laptop` with maxResults 10 and Residential RO. Return title, RON price, stock, PNK, and productUrl. Inspect OUTPUT.outcome before treating an empty dataset as a real no-match.

Tell the agent to keep `maxResults` small on the first call, enable `enrichDetails` only when specs/brand are required, preserve `productUrl` as provenance, and read `RUN_SUMMARY` when the outcome is `PARTIAL` or needs a later retry. Current MCP client setup: https://mcp.apify.com

Tool name after you publish: `apify--emag-romania-product-scraper`.

### Connect the workflow

Start here when the job is Romanian emag.ro catalogue rows in RON. Route African multi-market retail cards to [Jumia Product Scraper](https://apify.com/khadinakbar/jumia-product-scraper). Route US retail product detail to [Walmart Data Extractor](https://apify.com/khadinakbar/walmart-data-extractor). Route B2B supplier listing cards to [Alibaba Listings Scraper](https://apify.com/khadinakbar/alibaba-listings-scraper).

### Pricing

This Actor uses **Pay per event** with Apify **platform usage included**. Open the live Pricing tab for current event names and amounts. `maxResults` is the predictable cap on product events with Apify platform compute and proxy usage included. A worked example: 20 listing products ≈ 20 × `product-scraped` plus one `apify-actor-start`, with Residential transfer and compute included. A product is validated before it is persisted and charged, so only accepted rows receive product events.

### Best results

- Paste canonical emag.ro `/c`, `/sd`, search, or `/pd/{PNK}/` URLs, or clear keywords.
- Keep the first run small (`maxResults` 5–20) and inspect `OUTPUT` before raising the cap.
- Leave the Residential Romania proxy default; bare IPs often receive AWS WAF captcha HTML.

### Builder's note

I found that emag.ro listing cards expose reliable structured fields on `js-product-data` / `data-product` JSON, while bare datacenter IPs frequently receive AWS WAF captcha (HTTP 511). This Actor therefore defaults to Apify Residential RO, parses cards first, and only opens the PDP when `enrichDetails` is on or the input is already a `/pd/` URL. Hitting `maxResults` is a normal COMPLETE stop once the spend cap is reached.

### Responsible use

Use this Actor for lawful collection and analysis of public marketplace catalogue information. Follow applicable laws and eMAG policies, and keep the workflow on public pages you are authorized to collect. eMAG is a trademark of its owner. This independent Actor is not affiliated with, associated with, or endorsed by eMAG / Dante International.

# Actor input Schema

## `searchKeywords` (type: `array`):

Romanian or English product keywords to search on emag.ro (e.g. "laptop", "casti bluetooth"). Each keyword runs as its own search and results are merged/deduped by PNK. Prefer this for discovery. NOT a full URL — put URLs in startUrls instead.

## `startUrls` (type: `array`):

emag.ro URLs only. Accepts search pages (/search/...), category pages ending in /c or /sd, brand listings, or product pages containing /pd/PNK/. Mode is auto-detected from the path. Non-emag hosts are skipped with a warning.

## `maxResults` (type: `integer`):

Hard cap on validated products persisted and billed across all keywords and URLs (1–5000). Prefill 20 keeps the automated quality test under 5 minutes and predictable PPE spend.

## `enrichDetails` (type: `boolean`):

When true, fetch each product /pd/ page for brand, MPN/part number, specification table, description, image gallery, seller, and shipping signals. Adds one Residential page load and a product-detail-enriched event per product. Direct product URLs are always detail-scraped.

## `proxyConfiguration` (type: `object`):

Apify Proxy settings. Default to Residential with country RO — emag.ro serves AWS WAF captcha to many bare and some datacenter IPs. Store users should keep Residential enabled for reliable catalogue HTML.

## Actor input object example

```json
{
  "searchKeywords": [
    "laptop gaming"
  ],
  "startUrls": [
    {
      "url": "https://www.emag.ro/telefoane-mobile/c"
    }
  ],
  "maxResults": 20,
  "enrichDetails": false,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "RO"
  }
}
```

# Actor output Schema

## `dataset` (type: `string`):

Default dataset with one structured record per public emag.ro product observation (RON pricing).

## `summary` (type: `string`):

Stable terminal outcome with persisted-item counts, charged events, and warnings.

## `runSummary` (type: `string`):

Input coverage, Residential route diagnostics, cost state, and safe errors for the completed run.

# 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 = {
    "searchKeywords": [
        "laptop"
    ],
    "startUrls": [
        {
            "url": "https://www.emag.ro/laptopuri/c"
        }
    ],
    "maxResults": 20,
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ],
        "apifyProxyCountry": "RO"
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("khadinakbar/emag-romania-product-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 = {
    "searchKeywords": ["laptop"],
    "startUrls": [{ "url": "https://www.emag.ro/laptopuri/c" }],
    "maxResults": 20,
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
        "apifyProxyCountry": "RO",
    },
}

# Run the Actor and wait for it to finish
run = client.actor("khadinakbar/emag-romania-product-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 '{
  "searchKeywords": [
    "laptop"
  ],
  "startUrls": [
    {
      "url": "https://www.emag.ro/laptopuri/c"
    }
  ],
  "maxResults": 20,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "RO"
  }
}' |
apify call khadinakbar/emag-romania-product-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,khadinakbar/emag-romania-product-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/hSuQ64OUG1HizzQ2H/builds/9bQ5QTUuFZb4SaZSe/openapi.json
