# Mexico Real Estate Scraper - Mercado Libre Inmuebles (`ambiotec/mexico-real-estate-scraper`) Actor

Extract houses, apartments, land and commercial listings for sale or rent in any Mexican state from Mercado Libre Inmuebles: price, bedrooms, bathrooms, m², location, photo and URL.

- **URL**: https://apify.com/ambiotec/mexico-real-estate-scraper.md
- **Developed by:** [JUAN JOSE romero benitez](https://apify.com/ambiotec) (community)
- **Categories:** Real estate
- **Stats:** 3 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

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

## Mexico Real Estate Scraper – Mercado Libre Inmuebles

Extract **houses, apartments, land, offices, retail and warehouse listings for sale or rent anywhere in Mexico** from [Mercado Libre Inmuebles](https://inmuebles.mercadolibre.com.mx), the largest real estate marketplace in the country. Pick a state (or paste your own filtered search URL) and get clean JSON/CSV/Excel with price, bedrooms, bathrooms, square meters, location, photo and link — optionally with the full description, seller name and GPS coordinates.

No browser, no login, no API key. Pay only for the listings you receive.

### What you get

| Field | Example |
|---|---|
| `id` | `MLM3472970087` |
| `url` | `https://casa.mercadolibre.com.mx/MLM-3472970087-...` |
| `title` | `Casa En Venta, Conde Santiago De La Laguna Guadalupe, Zacatecas` |
| `listingType` | `Casa en venta` |
| `label` | `DESARROLLO` (new development) or `null` |
| `isSponsored` | `true` for paid placements (the URL is still the real listing) |
| `price`, `currency`, `pricePrefix` | `2700000`, `MXN`, `Desde` |
| `bedrooms`, `bathrooms`, `builtAreaM2`, `totalAreaM2`, `parkingSpots` | `3`, `1`, `110`, `null`, `null` |
| `attributes` | `["3 recámaras", "1 baño", "110 m² construidos"]` (raw text) |
| `location` | `Tiro 109, Conde De Bernardez, 98617 Guadalupe, Zacatecas` |
| `image` | main photo URL |
| `description`, `seller`, `latitude`, `longitude` | only when **Open each listing** is on |
| `source`, `searchUrl`, `scrapedAt` | provenance |

Numbers are parsed from Mercado Libre's own labels; ranges such as `70 - 99 m² construidos` keep the lower bound in the numeric field and the full text in `attributes`.

### How to use it

1. Choose **Operation** (sale/rent) and **Property type**.
2. Choose a **State** (all 32 supported) and, if you want, a **City** slug such as `zapopan` or `monterrey`.
3. Set **Maximum listings**. Each listing costs one result event.
4. Optional: tick **Open each listing** to add description, seller and coordinates (one extra page per listing, slower).
5. Run and download the dataset as JSON, CSV, Excel or XML, or call it from the API.

#### Custom searches

Any search URL from inmuebles.mercadolibre.com.mx works in **Custom search URLs**, including price ranges, number of bedrooms, neighborhoods and sort order. Build the search on the website with the filters you need and paste the URL; the structured fields are then ignored.

```json
{
  "startUrls": [{ "url": "https://inmuebles.mercadolibre.com.mx/departamentos/renta/distrito-federal/benito-juarez/_PriceRange_10000MXN-20000MXN" }],
  "maxItems": 200
}
```

### Example input

```json
{
  "operation": "venta",
  "propertyType": "casas",
  "state": "jalisco",
  "city": "zapopan",
  "maxItems": 100,
  "fetchDetails": false
}
```

### Example output

```json
{
  "id": "MLM3472970087",
  "url": "https://casa.mercadolibre.com.mx/MLM-3472970087-casa-en-venta-conde-santiago-de-la-laguna-guadalupe-zacatecas-_JM",
  "title": "Casa En Venta, Conde Santiago De La Laguna Guadalupe, Zacatecas",
  "listingType": "Casa en venta",
  "price": 2700000,
  "currency": "MXN",
  "bedrooms": 3,
  "bathrooms": 1,
  "builtAreaM2": 110,
  "location": "Tiro 109, Conde De Bernardez, 98617 Guadalupe, Zac., Mexico",
  "image": "https://http2.mlstatic.com/D_NQ_NP_2X_830049-MLM115959684140_092026-E.webp",
  "seller": "Housalemx",
  "latitude": 22.7660141,
  "longitude": -102.5268956,
  "scrapedAt": "2026-10-26T01:38:33+00:00"
}
```

### Use cases

- **Market studies and appraisals** – price per m² by municipality or neighborhood.
- **Lead generation for agents and developers** – new listings every morning via the scheduler.
- **Investment screening** – filter below-market properties across several states in one run.
- **Dashboards and AI agents** – the output is flat JSON, ready for spreadsheets, BI tools or an LLM.

### Pricing and performance

Pay-per-event: one `result` event per listing saved, plus one `detail` event per listing page opened when **Open each listing** is on. Residential proxy traffic is included in these prices. A typical run collects ~48 listings per page request; with **Open each listing** off, 1,000 listings take about a minute.

### Limitations

- Mercado Libre shows at most ~2,000 results per search. Split big searches by city or price range (custom URLs) to go beyond that.
- Contact details of sellers are not collected.
- This Actor reads public listing pages. Respect Mercado Libre's terms and local law when using the data.

### Need Inmuebles24, Vivanuncios or Lamudi?

Open an issue in the Actor's **Issues** tab describing the site and fields you need.

# Actor input Schema

## `operation` (type: `string`):

Sale (venta) or rent (renta).

## `propertyType` (type: `string`):

Kind of property to search for.

## `state` (type: `string`):

Mexican state to search in, or all of Mexico.

## `city` (type: `string`):

URL slug of a municipality inside the state, exactly as Mercado Libre writes it, e.g. `zapopan`, `monterrey`, `benito-juarez`. Leave empty for the whole state.

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

Paste any search URL from inmuebles.mercadolibre.com.mx (with your own filters: price, bedrooms, neighborhood...). When filled in, the fields above are ignored.

## `maxItems` (type: `integer`):

Stop after this many listings have been saved (across all searches).

## `fetchDetails` (type: `boolean`):

Adds `description`, `seller`, `latitude` and `longitude`. One extra request per listing, so the run takes longer.

## `proxy` (type: `object`):

Mercado Libre shows a login wall to datacenter IPs, so the default is Apify residential proxy located in Mexico. Keep it unless you have your own Mexican proxies.

## Actor input object example

```json
{
  "operation": "venta",
  "propertyType": "casas",
  "state": "jalisco",
  "startUrls": [],
  "maxItems": 100,
  "fetchDetails": false,
  "proxy": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "MX"
  }
}
```

# Actor output Schema

## `results` (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 = {
    "city": "",
    "startUrls": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("ambiotec/mexico-real-estate-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 = {
    "city": "",
    "startUrls": [],
}

# Run the Actor and wait for it to finish
run = client.actor("ambiotec/mexico-real-estate-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 '{
  "city": "",
  "startUrls": []
}' |
apify call ambiotec/mexico-real-estate-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,ambiotec/mexico-real-estate-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/Ow8Wyy2IdLiqzmPkW/builds/JJKhQCtrgklAQk6Xh/openapi.json
