{
  "openapi": "3.0.1",
  "info": {
    "title": "Magnit Market (mm.ru) Scraper",
    "description": "Scrape Magnit Market (mm.ru / Магнит Маркет) - Russia's marketplace by Magnit. Search products, browse by category, fetch full product details (prices, ratings, stock, images, seller info, characteristics and SKUs), or pull real customer reviews.",
    "version": "1.0",
    "x-build-id": "hcZNCf6nR3l9g0wI6"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/crawlerbros~magnit-market-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-crawlerbros-magnit-market-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/crawlerbros~magnit-market-scraper/runs": {
      "post": {
        "operationId": "runs-sync-crawlerbros-magnit-market-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/crawlerbros~magnit-market-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-crawlerbros-magnit-market-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "required": [
          "mode",
          "proxyConfiguration"
        ],
        "properties": {
          "mode": {
            "title": "Mode",
            "enum": [
              "search",
              "byCategory",
              "productDetails",
              "categoryTree",
              "reviews"
            ],
            "type": "string",
            "description": "What to fetch.",
            "default": "search"
          },
          "searchQuery": {
            "title": "Search query (mode=search)",
            "type": "string",
            "description": "Free-text search query, e.g. `iphone`, `ноутбук`, `телевизор`."
          },
          "categoryId": {
            "title": "Category ID or URL (mode=byCategory, categoryTree)",
            "type": "string",
            "description": "A numeric mm.ru category ID (e.g. `10044`) or a full category URL (e.g. `https://mm.ru/category/10044`). Overrides `rootCategory` if both are set. In `byCategory` mode, fetches products in this category. In `categoryTree` mode, scopes the listed tree to this category's subtree (omit to list the entire tree). Use `rootCategory` below for a curated list of top-level categories, or find deeper category IDs by browsing mm.ru and copying the numeric ID from the URL -- or by running `categoryTree` mode first."
          },
          "rootCategory": {
            "title": "Root category (mode=byCategory, categoryTree, convenience picker)",
            "enum": [
              "",
              "10020",
              "1821",
              "10004",
              "10012",
              "10018",
              "10005",
              "10002",
              "10016",
              "10019",
              "10014",
              "10013",
              "10003",
              "10007",
              "10006",
              "10009",
              "10015",
              "10010",
              "10011",
              "10008",
              "10017"
            ],
            "type": "string",
            "description": "Pick one of mm.ru's 20 top-level categories. Ignored if `categoryId` is also set.",
            "default": ""
          },
          "productIds": {
            "title": "Product IDs or URLs (mode=productDetails, reviews)",
            "type": "array",
            "description": "Numeric mm.ru product IDs (e.g. `2560933`) or full product URLs (e.g. `https://mm.ru/product/2560933`).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "reviewsLimit": {
            "title": "Reviews per product (mode=reviews)",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Max number of reviews to emit per product ID, newest first. The `productRatingBreakdown`/`productReviewsTotal`/`productAvgRating` fields on every emitted review always reflect mm.ru's full review set for that product, not just this capped subset.",
            "default": 20
          },
          "sortBy": {
            "title": "Sort order (mode=search, byCategory)",
            "enum": [
              "popularityDesc",
              "popularityAsc",
              "priceAsc",
              "priceDesc",
              "ratingDesc",
              "ratingAsc",
              "newDesc",
              "newAsc",
              "discountDesc",
              "discountAsc"
            ],
            "type": "string",
            "description": "How to order results. Popularity/price/rating sorting is confirmed to reorder mm.ru's results server-side. Newest and discount sorting are accepted by mm.ru without error but confirmed to have no effect on result order (mm.ru silently falls back to its default order for these two) -- an upstream mm.ru API limitation.",
            "default": "popularityDesc"
          },
          "cityId": {
            "title": "City ID",
            "minimum": 1,
            "maximum": 999999,
            "type": "integer",
            "description": "mm.ru delivery-city ID. Only affects delivery-date estimates on returned items, not which products match. Defaults to `1`.",
            "default": 1
          },
          "minPrice": {
            "title": "Min price (RUB)",
            "minimum": 0,
            "maximum": 100000000,
            "type": "integer",
            "description": "Drop products cheaper than this, in Russian rubles."
          },
          "maxPrice": {
            "title": "Max price (RUB)",
            "minimum": 0,
            "maximum": 100000000,
            "type": "integer",
            "description": "Drop products more expensive than this, in Russian rubles."
          },
          "minRating": {
            "title": "Min rating",
            "minimum": 0,
            "maximum": 5,
            "type": "number",
            "description": "Drop products rated below this (0-5 scale)."
          },
          "inStockOnly": {
            "title": "In stock only",
            "type": "boolean",
            "description": "Only emit products currently in stock.",
            "default": false
          },
          "excludeAdultItems": {
            "title": "Exclude adult items",
            "type": "boolean",
            "description": "Skip products flagged as adult/18+ content.",
            "default": false
          },
          "includeSimilarProducts": {
            "title": "Include similar products (mode=productDetails)",
            "type": "boolean",
            "description": "Enrich each product detail record with a `similarProducts` array (up to 10 related items with price, rating, reviews, image) from mm.ru's own \"similar products\" API. Adds one extra request per product ID.",
            "default": true
          },
          "leafCategoriesOnly": {
            "title": "Leaf categories only (mode=categoryTree)",
            "type": "boolean",
            "description": "Only emit categories with no subcategories (the ones actually usable as a `categoryId` seed for `byCategory` mode). Skips intermediate/parent nodes.",
            "default": false
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "Hard cap on emitted records.",
            "default": 10
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "mm.ru's public APIs are reachable without a proxy; the free Apify AUTO group is used by default for resilience at zero extra cost.",
            "default": {
              "useApifyProxy": true
            }
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}