# Magento E-Commerce Scraper 🚧 (`jupri/magento-scraper`) Actor

Scrape data about product price, description and other information from Magento E-Commerce websites.

- **URL**: https://apify.com/jupri/magento-scraper.md
- **Developed by:** [cat](https://apify.com/jupri) (community)
- **Categories:** E-commerce
- **Stats:** 481 total users, 5 monthly users, 100.0% runs succeeded, 6 bookmarks
- **User rating**: 1.00 out of 5 stars

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

### Welcome to Magento Scraper

![dont be sad readme is here](https://raw.githubusercontent.com/JupriGH/resources/main/cats/catframe.png)

#### About Magento

<img src="https://upload.wikimedia.org/wikipedia/commons/5/55/Magento_Logo.svg" width="320">

**Magento** is an [open-source](https://en.wikipedia.org/wiki/Open-source_software "Open-source software")  [e-commerce platform](https://en.wikipedia.org/wiki/E-commerce "E-commerce") written in [PHP](https://en.wikipedia.org/wiki/PHP "PHP"). It uses multiple other PHP frameworks such as [Laminas](https://en.wikipedia.org/wiki/Laminas "Laminas") (formerly known as [Zend Framework](https://en.wikipedia.org/wiki/Zend_Framework "Zend Framework")) and [Symfony](https://en.wikipedia.org/wiki/Symfony "Symfony"). Magento [source code](https://en.wikipedia.org/wiki/Source_code "Source code") is distributed under [Open Software License (OSL)](https://en.wikipedia.org/wiki/Open_Software_License "Open Software License") v3.0. Magento was acquired by [Adobe Inc](https://en.wikipedia.org/wiki/Adobe_Inc "Adobe Inc") in May 2018 for $1.68 billion.[\[2\]](https://en.wikipedia.org/wiki/Magento#cite_note-2)

#### About This Actor

Use this actor to extract product price, description, variants and other info from a Magento E-Commerce website. Example of websites can be found [here](https://trends.builtwith.com/websitelist/Magento).

#### Disclaimer

This Actor is using generic logic to scrape a Magento website. It may not work for all website. Please contact support to submit an issue.

#### Tutorial

***Example #1: Basic Usage***

```json
{ "url": "www.rebook.id" }
```

#### Output Samples

```json
{
    "created_at": "2023-05-12 02:05:42",
    "description": "<p>Ideal for the summer-season, this short-sleeve shirt features a seasonal 'Overlapping Check' print in muted tones. </p>\n",
    "id": 286995,
    "image": {
        "big": {
            "url": "https://media.paulsmith.com/dam/products/w_auto,c_scale/q_80/STILL/M1R/M1R-905U-L02056-92/M1R-905U-L02056-92_10.jpg"
        },
        "small": {
            "url": "https://media.paulsmith.com/dam/products/w_auto,c_scale/q_80/STILL/M1R/M1R-905U-L02056-92/M1R-905U-L02056-92_10.jpg"
        },
        "thumb": {
            "url": "https://media.paulsmith.com/dam/products/w_auto,c_scale/q_80/STILL/M1R/M1R-905U-L02056-92/M1R-905U-L02056-92_10.jpg"
        }
    },
    "name": "Viscose 'Overlapping Check' Print Shirt",
    "overview": "This short-sleeve shirt features a seasonal 'Overlapping Check' print in muted tones. Order today with FREE shipping offers available.",
    "price": {
        "max": {
            "discount": { "amount": 0,  "percent": 0 },
            "final": { "currency": "GBP", "value": 325 },
            "regular": { "currency": "GBP", "value": 325 }
        },
        "min": {
            "discount": { "amount": 0, "percent": 0 },
            "final": { "currency": "GBP", "value": 325 },
            "regular": { "currency": "GBP", "value": 0 }
        }
    },
    "sku": "M1R-905U-L02056-92",
    "status": "OUT_OF_STOCK",
    "type": "configurable",
    "updated_at": "2023-05-24 13:28:33",
    "url": "https://www.paulsmith.com/viscose-overlapping-check-print-shirt",
    "variants": [
        {
            "attributes": [
                { "code": "size", "label": "L", "value_index": 346 }
            ],
            "product": {
                "id": 286991,
                "name": "MENS S/S REGULAR FIT SHIRT",
                "sku": "M1R-905U-L02056-92-L"
            }
        },
        {
            "attributes": [
                { "code": "size", "label": "M", "value_index": 347 }
            ],
            "product": {
                "id": 286992,
                "name": "MENS S/S REGULAR FIT SHIRT",
                "sku": "M1R-905U-L02056-92-M"
            }
        },
        {
            "attributes": [
                { "code": "size", "label": "S", "value_index": 348 }
            ],
            "product": {
                "id": 286993,
                "name": "MENS S/S REGULAR FIT SHIRT",
                "sku": "M1R-905U-L02056-92-S"
            }
        },
        {
            "attributes": [
                { "code": "size", "label": "XL", "value_index": 349 }
            ],
            "product": {
                "id": 286994,
                "name": "MENS S/S REGULAR FIT SHIRT",
                "sku": "M1R-905U-L02056-92-XL"
            }
        }
    ]
}
```

# Changelog

This Actor's version history is a separate document: https://apify.com/jupri/magento-scraper/changelog.md

# Actor input Schema

## `url` (type: `string`):

No description

## `search` (type: `string`):

Search by Keywords

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

Limit number of results.

## `show_filters` (type: `boolean`):

Show available filters & sorting Keys <i>(in console)</i>.

## `sort` (type: `string`):

Every website could have different <code>Sorting Key</code>. Use <code>show_filters=true</code> to show available options. Most common values is: <code>name, price</code>

## `order` (type: `string`):

Sorting Order

## `includes:description` (type: `boolean`):

Long description (HTML).

## `includes:gallery` (type: `boolean`):

No description

## `includes:related` (type: `boolean`):

No description

## `includes:variants` (type: `boolean`):

No description

## `includes:upsell` (type: `boolean`):

<b>Upselling</b> is the process of encouraging customers to upgrade or include add-ons to the product or service they're buying.

## `includes:crosssell` (type: `boolean`):

<b>Cross-selling</b> is the process of offering a customer products that are compatible with the ones they're purchasing.

## `deprecated` (type: `boolean`):

No description

## `filters:sku` (type: `string`):

No description

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

No description

## `filters:description` (type: `string`):

No description

## `min_price` (type: `integer`):

Minimum price

## `max_price` (type: `integer`):

Maximum price

## `other_filters` (type: `array`):

Use <i><code>show_filters=true</code></i> to show all available options.

## `dev_proxy_config` (type: `object`):

<b>Supported protocol:</b><br><br><b>HTTP(S), SOCKS5</b><br><code>{http|socks5}://{user:pass}@{hostname|ip-address}:port</code><br><br><b>\<a href=https://scrapeops.io/app/register/main target=\_blank>ScrapeOps.IO</a></b><br><code>scrapeops://{api-key}</code><br><br><b>Example</b>: <code>socks5://example.com:9000</code>

## `dev_custom_headers` (type: `array`):

💡 Additional HTTP Headers

## `dev_custom_cookies` (type: `array`):

💡 Additional HTTP Cookies

## `dev_no_strip` (type: `boolean`):

💡 Keep/Save empty values <i><code>(NULL, FALSE, empty ARRAY, empty OBJECT, empty STRING)</code></i>

## `dev_transform_enable` (type: `boolean`):

No description

## `dev_transform_fields` (type: `array`):

No description

## `dev_dataset_enable` (type: `boolean`):

No description

## `dev_dataset_clear` (type: `boolean`):

Clear Dataset before insert/update.

## `dev_dataset_name` (type: `string`):

💡 <b>Use mask to customize dataset name</b><br><br><code>{ACTOR} = actor name<br>{DATE} = date (YYYYMMDD)<br>{TIME} = time (HHMMSS)</code><br><br>This masks can be used to autogenerate Dataset Name.<br><br>example: <i><code>data-{DATE}</code></i><br>Depending on today date the dataset name will be: <code>data-20230603</code><i><br><br>default: <code>data-{ACTOR}-{DATE}-{TIME}</code></i>

## Actor input object example

```json
{
  "url": "https://www.reebok.id",
  "limit": 5,
  "includes:variants": true
}
```

# 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 = {
    "url": "https://www.reebok.id",
    "limit": 5
};

// Run the Actor and wait for it to finish
const run = await client.actor("jupri/magento-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 = {
    "url": "https://www.reebok.id",
    "limit": 5,
}

# Run the Actor and wait for it to finish
run = client.actor("jupri/magento-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 '{
  "url": "https://www.reebok.id",
  "limit": 5
}' |
apify call jupri/magento-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,jupri/magento-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/MOQRII6SbCXfUDXqo/builds/LDPpAwCn9rvaQGDla/openapi.json
