# MercadoLibre Inmuebles Scraper (AR + MX) (`barefoot_grade/ml-inmuebles-scraper`) Actor

MercadoLibre inmuebles scraper for Argentina and Mexico. Search real-estate listings (sale and rent) by province/city and property type. Extracts price in local currency, location, attributes, photos and listing URL.

- **URL**: https://apify.com/barefoot_grade/ml-inmuebles-scraper.md
- **Developed by:** [Philip Kirkbride](https://apify.com/barefoot_grade) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.40 / 1,000 listings

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 Inmuebles Listings (Argentina + Mexico)

### Quick Start

Collect public property listings from the MercadoLibre real-estate
vertical — `inmuebles.mercadolibre.com.ar` and
`inmuebles.mercadolibre.com.mx` — with this minimal input:

```json
{"country":"ar","propertyType":"departamentos","operation":"venta","maxResults":50}
```

Use the country, property type and location inputs to select the listings
you need. Persistent access problems produce a clear run error.

### Input

| Name | Type | Default | What it does |
| --- | --- | --- | --- |
| `country` | string | `ar` | Argentina (`inmuebles.mercadolibre.com.ar`) or Mexico (`inmuebles.mercadolibre.com.mx`). |
| `propertyType` | string | `departamentos` | Property category: `departamentos`, `casas`, `ph` (AR only), `terrenos`, `campos`, `quintas`, `oficinas`, `locales`, `galpones`. |
| `operation` | string | `venta` | Sale (`venta`) or rental (`alquiler`) in either country. |
| `province` | string | empty | Optional province/state (`capital-federal`, `distrito-federal`, `nuevo-leon`…). Accepts names or site identifiers. Empty searches the whole country. |
| `city` | string | empty | Optional city (`palermo`, `polanco`…); requires `province`. |
| `maxPages` | integer | `1` | Search-result pages per run, from 1 to 10 (about 48 listings per page). |
| `maxResults` | integer | `50` | Maximum listings, from 1 to 200. |
| `requestDelaySecs` | number | `1.0` | Delay between page requests, from 0.5 to 10 seconds. |

The Actor collects additional pages up to `maxPages`, stopping when no
new listings are available or `maxResults` is reached.

### Output

Each item includes `id`, `listing_key`, `url`, `name`, `price`,
`currency`, `country`, `type`, `operation`, `location`, `images`,
`source`, and `scraped_at`.

Example record:

```json
{"id":"MLA1165523921","listing_key":"inmuebles.mercadolibre.com.ar:MLA1165523921","url":"https://www.mercadolibre.com.ar/inmuebles/departamento-en-venta-1-MLA-1165523921","name":"Departamento en Venta en Palermo 2 Ambientes","price":95000,"currency":"ARS","country":"AR","type":"departamentos","operation":"venta","location":"Palermo, Capital Federal","images":["https://http2.mlstatic.com/D_NQ_NP_2X_1165523921-MLA5523921.webp"],"source":"inmuebles.mercadolibre.com.ar","scraped_at":"2026-10-03T00:00:00+00:00"}
```

Prices use the currency shown in the listing: ARS, MXN or USD. Listings
with an undisclosed price have `price: null`. `location` contains the
location provided by the listing, such as `Palermo, Capital Federal`.

### FAQ

**How fresh are the results?** Listings are collected during each run.

**Which markets are supported?** Argentina and Mexico.

**Can I collect rentals?** Yes. Set `operation` to `alquiler` in either country.

**Is `ph` supported in Mexico?** No. This property category is available
only in Argentina.

For help, contact Apify Support and include the run URL.

### Pricing

See the Actor’s Pricing tab on Apify for current rates. Total run cost
depends on the selected limits and your Apify plan. Start with a small
`maxResults` value and check the run cost before scheduling larger
collections.

#### Optional proxy

Direct connections remain available. To use Apify Proxy, set
`proxy` to `{"useApifyProxy": true}`; the country defaults to AR for Argentina or MX for Mexico.
Override it with `proxy.apifyProxyCountry` or top-level `apifyProxyCountry`
(the value inside `proxy` takes precedence). Custom proxy URLs retain their
configured country. Explicit `{"useApifyProxy": false}` selects direct
egress for the platform lane.

# Actor input Schema

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

Country site to search: Argentina (inmuebles.mercadolibre.com.ar, ARS prices) or Mexico (inmuebles.mercadolibre.com.mx, MXN prices). USD-marked listings stay USD on both.

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

The /{type} search facet. 'ph' exists on Argentina only (an unsupported type fails fast instead of crawling a dead path).

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

Sale or rental search. Rentals map to the /alquiler path on Argentina and /renta on Mexico (the site-native slugs).

## `province` (type: `string`):

Optional province (AR) or state (MX) slug to scope the search, e.g. 'capital-federal', 'buenos-aires', 'distrito-federal', 'nuevo-leon'. Free text is slugified ('Capital Federal' -> 'capital-federal'). Empty searches the whole country.

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

Optional city slug to scope the search, e.g. 'palermo', 'polanco'. Requires a province (the URL grammar is /{province}/{city}/). Free text is slugified.

## `maxPages` (type: `integer`):

Search-result pages to fetch (about 48 listings per page on the ML grid).

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

Stop after this many listings.

## `requestDelaySecs` (type: `number`):

Minimum 0.5 seconds between fetches (be polite on the direct lane).

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

Optional proxy. Apify Proxy defaults to the selected portal’s home country (AR/MX); override with apifyProxyCountry. Custom proxy URLs keep their configured geography.

## `apifyProxyGroups` (type: `array`):

Optional platform proxy groups. Defaults to RESIDENTIAL when Apify Proxy is requested.

## `apifyProxyCountry` (type: `string`):

Optional two-letter country override. Defaults to AR/MX. The country in the proxy configuration takes precedence.

## Actor input object example

```json
{
  "country": "ar",
  "propertyType": "departamentos",
  "operation": "venta",
  "province": "",
  "city": "",
  "maxPages": 1,
  "maxResults": 50,
  "requestDelaySecs": 1
}
```

# 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 = {
    "country": "ar",
    "propertyType": "departamentos",
    "operation": "venta",
    "province": "",
    "city": "",
    "maxPages": 1,
    "maxResults": 50,
    "requestDelaySecs": 1
};

// Run the Actor and wait for it to finish
const run = await client.actor("barefoot_grade/ml-inmuebles-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 = {
    "country": "ar",
    "propertyType": "departamentos",
    "operation": "venta",
    "province": "",
    "city": "",
    "maxPages": 1,
    "maxResults": 50,
    "requestDelaySecs": 1,
}

# Run the Actor and wait for it to finish
run = client.actor("barefoot_grade/ml-inmuebles-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 '{
  "country": "ar",
  "propertyType": "departamentos",
  "operation": "venta",
  "province": "",
  "city": "",
  "maxPages": 1,
  "maxResults": 50,
  "requestDelaySecs": 1
}' |
apify call barefoot_grade/ml-inmuebles-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,barefoot_grade/ml-inmuebles-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/HlaC2SvvktquO0RJh/builds/scSgbG72GvtSIJuPl/openapi.json
