# MercadoLibre Official Stores Scraper (`stilled_stalagmite/mercadolibre-official-stores-scraper`) Actor

Scrape product catalogs from MercadoLibre official brand stores: prices, stock, and product details.

- **URL**: https://apify.com/stilled\_stalagmite/mercadolibre-official-stores-scraper.md
- **Developed by:** [Danilo Frias](https://apify.com/stilled_stalagmite) (community)
- **Categories:** E-commerce
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 results

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

## MercadoLibre Official Stores Scraper

Scrapes the **public official-stores directory ("tiendas oficiales") of MercadoLibre Mexico** and returns one record per official store: brand name, store URL, logo URL, and directory category.

Who would use it: lead-list builders, brand/marketplace analysts, and anyone maintaining a directory of brands with an official storefront on MercadoLibre Mexico. Official store names are business names shown on public listings; no personal data is collected.

### Inputs

| Field | Type | Default | Description |
|---|---|---|---|
| `start_urls` | array of strings | `["https://www.mercadolibre.com.mx/tiendas-oficiales"]` | Directory pages to start from. Accepts the directory landing page (category pages are discovered automatically) or individual category pages (`tiendas-oficiales/show?category=MLM1000...`). |
| `max_items` | integer | `250` | Maximum number of unique store records to return. The actor visits category pages in order and stops as soon as this many unique stores have been collected. |
| `country` | string | `"mx"` | Two-letter country code stamped on each record. |

### Sample output record

```json
{
  "store_name": "117 Mx",
  "store_url": "https://www.mercadolibre.com.mx/tienda/117-mx",
  "logo_url": "https://http2.mlstatic.com/D_NQ_NP_832107-MLA112151539782_062026-F.jpg",
  "category": "Electrónica, Audio y Video",
  "country": "mx"
}
```

Fields: `store_name` (str), `store_url` (str), `logo_url` (str or null), `category` (str or null), `country` (str). A store that appears in several categories keeps the category where it was first seen; `logo_url` prefers the brand's `high_resolution_logo` asset.

### Coverage and limits

- The directory is organized by product category (24 categories such as "Electrónica, Audio y Video", "Ropa, Bolsas y Calzado", "Computación"). Each category page (`tiendas-oficiales/show?category=MLM...`) renders a fixed set of top brands (100 per page, server-side, with store data also embedded in the page's `__NORDIC_RENDERING_CTX__` JSON).
- **Pagination is by category, not by page.** The category pages ignore `page=`/`letter=` query parameters and expose only their first ~100 brands even when the page reports a larger `totalBrands` count. So coverage is the top ~100 brands per category, up to ~2,400 raw listings deduped by store URL.
- **Deliberately avoided surfaces:** MercadoLibre search-result pages and product-detail pages redirect unauthenticated visitors to account verification; this actor never requests them. If any directory page starts redirecting to a login/account-verification wall or serves a CAPTCHA, the actor logs the URL, status code, and redirect target and moves on.

### Rate limiting

Plain HTTPS with a browser User-Agent, max 2 concurrent connections, and a fixed ~1 second delay between requests. No scraping proxy services, no CAPTCHA solving, no parallel hammering. On hosts that route outbound traffic through a standard egress proxy, the actor uses the machine's configured `https_proxy`/`http_proxy` URL explicitly (this host's `no_proxy` format breaks httpx's environment parsing, so the URL is passed directly rather than relying on `trust_env`).

### Data rules

- **Public pages only.** The actor visits only the official-stores directory landing and category pages, all accessible without login. No login flows, no session cookies.
- **No personal data.** Only business/brand names, public store URLs, and logo image URLs are collected. No names, emails, or phone numbers of private individuals.

### Run locally

```bash
cd mercadolibre-official-stores-scraper
mkdir -p storage/key_value_stores/default
cat > storage/key_value_stores/default/INPUT.json <<'EOF'
{
  "start_urls": ["https://www.mercadolibre.com.mx/tiendas-oficiales"],
  "max_items": 250,
  "country": "mx"
}
EOF
python main.py
```

Output lands in `storage/datasets/default/` (local Apify storage). The same files build the Apify Docker image (`Dockerfile`, `requirements.txt`) without changes.

# Actor input Schema

## `country` (type: `string`):

Two-letter country code attached to each record (e.g. mx). The default start URLs target MercadoLibre Mexico.

## `max_items` (type: `integer`):

Maximum number of unique official-store records to return. The scraper visits category pages in order and stops as soon as this many unique stores have been collected.

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

Official-stores directory pages to start from. Accepts the directory landing page (e.g. https://www.mercadolibre.com.mx/tiendas-oficiales, from which category pages are discovered) or individual category pages (tiendas-oficiales/show?category=...).

## Actor input object example

```json
{
  "country": "mx",
  "max_items": 250,
  "start_urls": [
    {
      "url": "https://www.mercadolibre.com.mx/tiendas-oficiales"
    }
  ]
}
```

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("stilled_stalagmite/mercadolibre-official-stores-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 = {}

# Run the Actor and wait for it to finish
run = client.actor("stilled_stalagmite/mercadolibre-official-stores-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 '{}' |
apify call stilled_stalagmite/mercadolibre-official-stores-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,stilled_stalagmite/mercadolibre-official-stores-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/TV2odwxD4LETtAEH4/builds/hqKKHsyxO3YdAHJEn/openapi.json
