# Magnit Grocery Catalog Scraper (`bovi/magnit-scraper`) Actor

Collect distinct public product cards from Magnit pages. Get product IDs, titles, prices, URLs, and source metadata. Use HTTPS startUrl on a Magnit category page; no login. Pricing: $0.0035 per dataset item + $0.00005 per Actor Start event.

- **URL**: https://apify.com/bovi/magnit-scraper.md
- **Developed by:** [Vitalii Bondarev](https://apify.com/bovi) (community)
- **Categories:** E-commerce
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 85.2% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.50 / 1,000 magnit grocery catalog scrapers

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

## Magnit Grocery Catalog Scraper

You can extract distinct public product cards from Magnit catalog pages at magnit.ru, including prices, discounts, pack units, promotion status, product URLs, and source metadata. No Magnit login is needed, and the Apify proxy is optional. Pricing on Free is $0.0035 per dataset item and $0.00005 per Actor Start event.

- Extract product IDs, titles, and current prices in rubles from the Magnit page you request
- Monitor current and previous prices and discount percentages for price-monitoring workflows
- Track promotion flags, pack units, and product URLs for catalog and promotion review
- Export distinct product records with source pages and collection timestamps for downstream analysis

### What you get

The Actor reads server-rendered Nuxt data embedded in the requested Magnit page.

| Field | Type | Description |
| --- | --- | --- |
| `product_id` | string | Magnit product ID. Used to remove duplicate product records. |
| `title` | string | Product title exposed by the product card. |
| `url` | string | Magnit product URL. |
| `price` | number | Current product price in RUB. |
| `old_price` | number | Previous price in RUB when the card exposes a positive previous price. |
| `discount_percent` | integer | Discount percentage when a percentage is present in the product card. |
| `unit` | string | Pack size or unit when the card exposes it. |
| `is_promo` | boolean | Promotion flag when the card exposes a boolean value. |
| `source_url` | string | Magnit page URL used as the source for the record. |
| `source` | string | Source domain, set to `magnit.ru`. |
| `scraped_at` | ISO 8601 string | UTC collection timestamp. One value is set per run, so every record from the same run carries the same `scraped_at`. |

The Actor only returns product cards with a product ID, title, product URL, and current price.

### Sample output

One real dataset record:

```json
{
  "product_id": "1000567279",
  "title": "М Здоровье Витамин С 900 таблетки шипучие 20шт",
  "url": "https://magnit.ru/product/1000567279-magnit_zdorove_bad_vitamin_s_900_21?shopCode=992301&shopType=dostavka",
  "price": 164.99,
  "source_url": "https://magnit.ru/catalog",
  "source": "magnit.ru",
  "old_price": 209.99,
  "discount_percent": 21,
  "is_promo": false,
  "scraped_at": "2026-11-09T00:38:15.398030+00:00"
}
```

### Pricing

This Actor uses pay-per-event billing. You pay only for the events listed below. This Actor does not use the Pay per event + usage option, so the platform usage of your runs (compute, proxy traffic and storage) is not billed to you separately.

| Event | Billing unit | Price on Free |
| --- | --- | --- |
| `apify-actor-start` | Actor start event | $0.00005 per event; $0.05 per 1,000 events; $0.50 per 10,000 events |
| `apify-default-dataset-item` | One scraped result with all fields | $0.0035 per event; $3.50 per 1,000 events; $35 per 10,000 events |

The dataset-item event applies to each product record pushed to the dataset. At least one Actor Start event is charged for a run. If a run delivers 0 records and fails, no dataset items are charged and only the start event applies.

The Apify Free plan includes $5 of monthly platform usage credit. The Free plan's $5 monthly credit covers 1,428 results after one Actor Start event.

### How to use

1. **Open** the Actor from your Apify account.
2. **Choose** an HTTPS Magnit home or catalog category page and provide it as `startUrl`.
3. **Adjust** the example input below as needed.
4. **Start** the run and review the product records in the resulting dataset.
5. **Repeat** the run through Apify Schedules, using daily as a starting point for listings or price monitoring.

Example input:

```json
{
  "startUrl": "https://magnit.ru/catalog",
  "maxResults": 50,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": ["RESIDENTIAL"]
  }
}
```

Export the dataset as JSON or CSV, or read it through the Apify dataset API.

### Input parameters

| Parameter | What it does | Default |
| --- | --- | --- |
| `startUrl` | HTTPS Magnit home or catalog category page. Only Magnit URLs are accepted. | `https://magnit.ru/catalog` |
| `maxResults` | Upper limit on distinct product records pushed after duplicate product IDs are removed. The Actor fetches only the one requested page and does not paginate, so a run returns at most the distinct valid cards on that page, which can be fewer than `maxResults`. The schema requires an integer of at least `1`. | `50` |
| `proxyConfiguration` | Optional Apify proxy settings. If omitted or `useApifyProxy` is `false`, requests use a direct connection. | None when omitted; the input schema default uses Apify Proxy with the `RESIDENTIAL` group. |

### Limits and edge cases

| Condition | What happens | What to do |
| --- | --- | --- |
| `startUrl` is not an HTTPS URL on `magnit.ru` or `www.magnit.ru` | Input validation fails before the catalog page is fetched. URLs with credentials or a custom port are also rejected. | Use an HTTPS Magnit home or catalog category URL without credentials or a custom port. |
| The requested page has fewer distinct valid cards than `maxResults` | The run delivers only the cards on that page. | Request another Magnit page. |
| `maxResults` is zero or negative | The Actor returns without pushing product records. | Use a positive integer. |
| The requested page contains repeated product cards with the same product ID | Only one record is returned for each distinct product ID. | No action needed. |
| The requested page does not contain usable server-rendered Nuxt data, or the response is not usable HTML or the catalog cannot be parsed | The run ends with zero delivered records. | Pick a page that shows product cards. |
| A product card lacks a product ID, title, product link, or current price | That card is skipped. If this leaves no records, the run ends with zero delivered records. | Try another URL. |
| The requested HTTP response is `403`, `408`, `425`, `429`, a `5xx` response, or a connection, proxy, or timeout error | The Actor makes up to 5 attempts in total, each with a new proxy session. If all fail, the run fails with no delivered records and no dataset items are charged. | Check the URL and run again, or adjust the optional proxy input. |
| The run is aborted, times out, or fails while records are being delivered | Records already pushed to the dataset remain; records not yet pushed are absent. | Review the dataset and run again if needed. |

### FAQ

#### How much does it cost to scrape Magnit?

See the Pricing table above. A run that delivers 0 records is charged only the start event.

#### Why can a Magnit scrape return no products?

The page may lack usable server-rendered Nuxt data, or its cards may lack a product ID, title, product URL, or current price. Try a different URL.

#### Why is my run not working?

The most common causes are a `startUrl` that is not an HTTPS `magnit.ru` URL, a page without product cards, or a blocked or failed fetch. The Actor tries up to 5 times with a new proxy session, then fails with zero delivered records. The default residential proxy uses country `RU`.

#### Does the Actor need a Magnit account or login?

No. No Magnit account or login is needed. The Actor runs from your Apify account, and the Apify proxy is optional.

#### Is it legal or allowed to scrape Magnit’s public catalog data?

The Actor reads public product cards from `magnit.ru` and does not sign in. Whether a particular use is legal or allowed depends on Magnit’s source terms and applicable law for your use case; review those requirements before using the data.

# Actor input Schema

## `startUrl` (type: `string`):

Magnit home or catalog category page on magnit.ru. The selected store is taken from the page URL or Magnit's page state.

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

Maximum number of distinct product records to push to the dataset.

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

Optional Apify proxy settings. If omitted or useApifyProxy is false, requests use a direct connection.

## Actor input object example

```json
{
  "startUrl": "https://magnit.ru/catalog",
  "maxResults": 50,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

## `results` (type: `string`):

Dataset with the scraped records.

# 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 = {
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("bovi/magnit-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 = { "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    } }

# Run the Actor and wait for it to finish
run = client.actor("bovi/magnit-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 '{
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call bovi/magnit-scraper --silent --output-dataset

```

## MCP server setup

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