# Milanuncios Scraper - Spain Classifieds & Prices (`haketa/milanuncios-scraper`) Actor

Scrape classified ads from Milanuncios.com, Spain's #1 classifieds: title, price (euros, cash & financed), description, category, city, province, seller type, contact flags, publish date, images & tags. HTTP-only via impit + Spanish residential proxy (clears PerimeterX). Paginated, no browser.

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

## Pricing

from $1.50 / 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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## Milanuncios Scraper — Spain Classifieds, Vehicles, Real Estate & Prices 🇪🇸

[![Apify Actor](https://img.shields.io/badge/Apify-Actor-orange?style=flat-square\&logo=apify)](https://apify.com/haketa/milanuncios-scraper)
[![Maintenance](https://img.shields.io/badge/Maintained-Active-brightgreen?style=flat-square)](https://apify.com/haketa/milanuncios-scraper)
[![Data Format](https://img.shields.io/badge/Data-JSON%20%7C%20CSV%20%7C%20Excel-blue?style=flat-square)](https://apify.com/haketa/milanuncios-scraper)
[![Pagination](https://img.shields.io/badge/Pagination-1%2C000%2B%20Deep%20Extraction-success?style=flat-square)](https://apify.com/haketa/milanuncios-scraper)
[![Proxy](https://img.shields.io/badge/Proxy-Residential%20ES-red?style=flat-square)](https://apify.com/haketa/milanuncios-scraper)

**Scrape classified ads, second-hand vehicles, real estate, electronics, and job postings from [Milanuncios.com](https://www.milanuncios.com) — Spain's #1 classifieds marketplace.** This enterprise-grade **Milanuncios scraper** traverses search results and category indices, extracting clean, structured ad records: listing title, cash price (€), financed price, complete category hierarchy, city, province, autonomous region, seller type (private vs. professional), phone availability, warranty status, full descriptions, photo galleries, and publication timestamps.

Whether you are monitoring used car valuations across Spain, tracking rental housing prices in Madrid and Barcelona, gathering B2B merchant leads, or building secondary market pricing intelligence, this **Milanuncios data extractor** automates your data pipeline at scale.

Export ready-to-use datasets in **JSON, CSV, Excel, XML, or direct REST API**.

***

### ⚡ At a Glance

| Feature | Specification |
|:---|:---|
| **Target Website** | [Milanuncios.com](https://www.milanuncios.com) (Adevinta Spain) |
| **Data Scope** | Classified ads, cash & financed prices, seller classification, geo-location, tags, photos |
| **Geographic Coverage** | All 50 Spanish provinces and autonomous communities (Madrid, Barcelona, Valencia, Seville, etc.) |
| **Extraction Speed** | ~120–300 ads/minute across concurrent category workers |
| **Deep Pagination** | Unlocked deep extraction (1,000+ ads per category) via parameter pagination (`?pagina=N`) |
| **Category Breadth** | Motor (coches, motos), Inmobiliaria (pisos, casas), Empleo, Formación, Hogar, Tecnología |
| **Proxy Requirement** | Apify Residential Proxies (ES country pool required for geographic compatibility) |
| **Export Formats** | JSON, CSV, XLSX, XML, RSS, HTML Table |
| **Integrations** | Make.com, Zapier, n8n, Google Sheets, Airbyte, Webhooks, Python, Node.js |

***

### 🔎 Why Scrape Milanuncios?

Milanuncios is the undisputed leader in Spanish digital classifieds, hosting millions of active listings published by both everyday individuals and commercial enterprises. From second-hand vehicles and commercial machinery to residential real estate and electronics, Milanuncios reflects real-time consumer and commercial market activity across the Iberian Peninsula.

Manually copying and pasting listings is impossible: pages feature high item churn, regional filters are fragmented across dozens of provinces, and bot defenses block automated collection. This dedicated **Milanuncios scraper** bypasses these hurdles, delivering structured data directly to your warehouse.

#### Key Industry Applications

1. **Automotive Pricing & Valuation Modeling**\
   Track second-hand car prices (`coches-de-segunda-mano`) by make, model, registration year, mileage tags, and warranty status to model fair market value.

2. **Real Estate Rental & Sales Intelligence**\
   Monitor rental yields and purchase prices for flats (`venta-de-pisos`, `alquiler-de-pisos`) across Madrid, Barcelona, Malaga, and the Balearic Islands.

3. **B2B Merchant & Dealer Lead Generation**\
   Identify high-volume professional sellers (`sellerType: "professional"`), commercial dealerships, and estate agents for outreach campaigns.

4. **Consumer Electronics & Marketplace Resale Arbitrage**\
   Detect underpriced luxury watches, smartphones, consoles, and vintage collectibles for resale across international marketplaces.

5. **Competitive Intelligence for Classified Marketplaces**\
   Benchmark listing volume, ad turnover velocity, and pricing trends against rival classified portals such as Wallapop, Idealista, and Coches.net.

***

### ✨ Key Features & Capabilities

- **Deep 1,000+ Ad Pagination**: Unlocked pagination engine capable of traversing 30+ pages per query (~42 ads per page) without artificial caps.
- **Support for Any URL or Search Query**: Scrape top-level categories, filtered sub-categories, provincial landing pages, or search queries simply by pasting the URL.
- **Cash & Financed Price Extraction**: Captures both upfront cash prices and monthly financed price tiers where offered by professional dealerships.
- **Seller Classification**: Distinguishes between private individuals (`private`) and commercial businesses (`professional`), capturing unique seller IDs.
- **Clean Tag & Attribute Resolution**: Automatically extracts vehicle mileage, fuel types, transmission, and housing attributes from structured tags into clean strings.
- **Fast HTTP-Only Architecture**: Operates over optimized HTTP network streams without browser overhead, maximizing throughput and reducing cost.
- **Multi-Listing Concurrency**: Distributes work across parallel category workers with automatic IP rotation and back-off retries.

***

### 📥 Input Parameters

The actor accepts flexible input parameters designed for both non-technical users in the Apify Console and automated API callers.

| Field Name | Type | Default | Description |
|:---|:---|:---|:---|
| `startUrls` | Array\[String] | `["https://www.milanuncios.com/coches-de-segunda-mano/"]` | Milanuncios listing URLs, category pages, filtered searches, or bare slugs (e.g. `venta-de-pisos`). |
| `maxPages` | Integer | `0` | Number of result pages to paginate per listing (~42 ads/page). Set to `0` for auto/unlimited deep pagination (1,000+). |
| `maxItems` | Integer | `0` | Total ads to extract across all URLs. Set to `0` for unlimited extraction. Prefilled with `50` for fast previews. |
| `maxConcurrency` | Integer | `3` | Parallel listings to process concurrently (`1` to `8`). |
| `proxyConfiguration` | Object | `{ "useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"], "apifyProxyCountry": "ES" }` | Proxy configuration. Spanish Residential proxy is required for Milanuncios. |

***

### 🏷️ Popular Milanuncios Categories Supported

You can paste any URL from the following core vertical categories:

| Category | URL Pattern | Common Attributes Captured |
|:---|:---|:---|
| **Motor (Cars & Vehicles)** | `/coches-de-segunda-mano/`, `/motos-de-segunda-mano/` | Kilometers, year, fuel type, gearbox, warranty, financed price |
| **Inmobiliaria (Real Estate)** | `/venta-de-pisos/`, `/alquiler-de-pisos/` | Rooms, square meters, neighborhood, furnished status, elevator |
| **Informática & Telefonía** | `/telefonia/`, `/ordenadores/` | Storage capacity, brand, cosmetic condition, accessories |
| **Hogar & Muebles** | `/muebles/`, `/electrodomesticos/` | Dimensions, condition, pickup/shipping availability |
| **Servicios & Negocios** | `/servicios/`, `/traspasos/` | Professional certification, business turnover, lease transfer details |

***

### 📤 Output Dataset Schema

Each item in the dataset corresponds to a single classified ad listing with fully resolved metadata.

#### Ad Listing Fields

| Field | Type | Coverage | Description |
|:---|:---|:---:|:---|
| `id` | String | 🟢 High | Unique numerical Milanuncios advertisement ID. |
| `title` | String | 🟢 High | Listing title headline. |
| `price` | Number | 🟢 High | Upfront cash price in Euros (€). |
| `currency` | String | 🟢 High | Currency code (`EUR`). |
| `priceIncludesTaxes`| Boolean | 🟡 Conditional | Flag indicating whether taxes (IVA) are included. |
| `financedPrice` | Number / Null | 🟡 Conditional | Financed total or installment price if offered by a dealership. |
| `description` | String | 🟢 High | Complete body text of the listing. |
| `category` | String | 🟢 High | Primary ad category name. |
| `categoryPath` | String | 🟢 High | Full hierarchical category tree breadcrumb (e.g., `Motor > Coches`). |
| `city` | String | 🟢 High | Municipality or city name (e.g., `Badalona`, `Madrid`). |
| `province` | String | 🟢 High | Spanish province name (e.g., `Barcelona`, `Valencia`). |
| `region` | String | 🟢 High | Autonomous community (e.g., `Cataluña`, `Comunidad de Madrid`). |

#### Seller & Contact Fields

| Field | Type | Coverage | Description |
|:---|:---|:---:|:---|
| `sellerType` | String | 🟢 High | Classification: `professional` (business/dealer) or `private` (individual). |
| `sellerId` | String | 🟢 High | Unique numerical identifier of the posting user. |
| `sellType` | String | 🟡 Conditional | Offer type classification (`particular`, `profesional`). |
| `contactable` | Boolean | 🟢 High | Flag indicating if the lister accepts direct platform messages. |
| `isPhoneAvailable` | Boolean | 🟢 High | Flag indicating if a phone contact option is enabled. |
| `warrantyPeriod` | String / Null | 🟡 Conditional | Commercial warranty duration (e.g., `"12 meses"`). |
| `isNew` | Boolean | 🟢 High | Flag indicating brand-new merchandise condition. |
| `highlighted` | Boolean | 🟢 High | Flag indicating paid promotional badge visibility. |
| `tags` | Array\[String] | 🟢 High | Structured specification tags (e.g., `["2021 año", "45.000 kms", "Diésel"]`). |
| `images` | Array\[String] | 🟢 High | Absolute high-resolution photo URLs hosted on Milanuncios image CDNs. |
| `publishDate` | String | 🟢 High | Original listing publication timestamp. |
| `updateDate` | String | 🟢 High | Timestamp of most recent listing update or renewal. |
| `url` | String | 🟢 High | Direct canonical listing URL on milanuncios.com. |
| `scrapedAt` | String | 🟢 High | ISO 8601 timestamp of data extraction. |

***

### 📋 Sample Output Record

```json
{
  "id": "528491024",
  "title": "SEAT Ibiza 1.0 TSI Style 110CV",
  "price": 16490,
  "currency": "EUR",
  "priceIncludesTaxes": true,
  "financedPrice": 14990,
  "description": "Vehículo nacional en impecable estado de reestreno. Único propietario, historial de revisiones completo en concesionario oficial. Garantía de 12 meses incluida.",
  "category": "Coches de segunda mano",
  "categoryPath": "Motor > Coches > SEAT > Ibiza",
  "city": "Badalona",
  "province": "Barcelona",
  "region": "Cataluña",
  "sellerType": "professional",
  "sellerId": "9182741",
  "sellType": "profesional",
  "contactable": true,
  "isPhoneAvailable": true,
  "isNew": false,
  "highlighted": true,
  "warrantyPeriod": "12 meses",
  "publishDate": "2026-11-08T18:22:10.000Z",
  "updateDate": "2026-11-10T09:14:00.000Z",
  "url": "https://www.milanuncios.com/coches-de-segunda-mano/seat-ibiza-1-0-tsi-style-110cv-528491024.htm",
  "images": [
    "https://images.milanuncios.com/api/v1/ma-ad-media-pro/images/528491024/front.jpg",
    "https://images.milanuncios.com/api/v1/ma-ad-media-pro/images/528491024/interior.jpg"
  ],
  "tags": [
    "2022 año",
    "38.500 kms",
    "Gasolina",
    "Manual",
    "5 puertas",
    "110 CV"
  ],
  "scrapedAt": "2026-11-10T14:50:00.000Z"
}
```

***

### 💡 Practical Use Cases & Step-by-Step Recipes

#### 1. Spain Automotive Price Tracker

- **Start URLs**: `["https://www.milanuncios.com/coches-de-segunda-mano/"]`
- **Max Pages**: `10` (~420 vehicles)
- **Schedule**: Run daily at 08:00 UTC.
- **Workflow**: Ingest mileage tags and cash prices into PostgreSQL to detect sudden price reductions across dealership networks.

#### 2. Madrid Residential Property Monitor

- **Start URLs**: `["https://www.milanuncios.com/venta-de-pisos-en-madrid/"]`
- **Max Items**: `1000` (or `0` for all available)
- **Filter**: Filter by private sellers (`sellerType: "private"`) in your database to surface direct owner opportunities without commission overhead.

#### 3. Dealership B2B Lead Sourcing

- **Start URLs**: Category search filtered by commercial vehicles (`/furgonetas-de-segunda-mano/`).
- **Filter**: Isolate records with `sellerType: "professional"` and `isPhoneAvailable: true`.
- **Result**: Exports verified dealership seller IDs, locations, and inventory volumes for B2B CRM sales prospecting.

***

### 🛠️ Step-by-Step Execution Guide

1. **Find Target Search on Milanuncios**: Browse milanuncios.com in your web browser, configure your location and category filters, and copy the resulting browser address.
2. **Paste into startUrls**: Add the URL (or multiple URLs) to the actor input.
3. **Set Depth**: Leave `maxPages` at `0` for unbounded pagination across all available pages, or specify a page cap.
4. **Execute Run**: Click **Start** in the Apify Console. Monitor live page extractions and ad counts in real time.
5. **Download & Integrate**: Export results to JSON, CSV, or Excel, or stream records directly into BigQuery, Snowflake, or Google Sheets via Apify API webhooks.

***

### ⚙️ Advanced API & Webhook Automation

You can trigger this actor programmatically via standard HTTP REST requests.

#### Trigger via cURL

```bash
curl -X POST "https://api.apify.com/v2/acts/haketa~milanuncios-scraper/runs?token=YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "startUrls": ["https://www.milanuncios.com/coches-de-segunda-mano/"],
    "maxPages": 5,
    "maxItems": 200,
    "proxyConfiguration": {
      "useApifyProxy": true,
      "apifyProxyGroups": ["RESIDENTIAL"],
      "apifyProxyCountry": "ES"
    }
  }'
```

#### Fetch Results via Python

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_API_TOKEN")

run = client.actor("haketa/milanuncios-scraper").call(run_input={
    "startUrls": ["https://www.milanuncios.com/venta-de-pisos-en-barcelona/"],
    "maxPages": 3,
    "maxItems": 100,
})

for ad in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(f"[{ad['city']}] {ad['title']}: {ad['price']:,} EUR ({ad['sellerType']})")
```

***

### 🏗️ Enterprise Classifieds Data Warehouse Schema

For automotive dealerships, real estate aggregators, and intelligence desks, Milanuncios records map cleanly into PostgreSQL or Snowflake:

```sql
CREATE TABLE milanuncios_ads (
    id VARCHAR(50) PRIMARY KEY,
    title TEXT NOT NULL,
    price NUMERIC(12, 2),
    currency VARCHAR(5) DEFAULT 'EUR',
    price_includes_taxes BOOLEAN,
    financed_price NUMERIC(12, 2),
    description TEXT,
    category VARCHAR(100),
    category_path TEXT,
    city VARCHAR(100),
    province VARCHAR(100),
    region VARCHAR(100),
    seller_type VARCHAR(30),
    seller_id VARCHAR(50),
    contactable BOOLEAN DEFAULT TRUE,
    is_phone_available BOOLEAN DEFAULT FALSE,
    warranty_period VARCHAR(50),
    is_new BOOLEAN DEFAULT FALSE,
    highlighted BOOLEAN DEFAULT FALSE,
    tags TEXT[],
    images TEXT[],
    publish_date TIMESTAMP WITH TIME ZONE,
    update_date TIMESTAMP WITH TIME ZONE,
    url TEXT,
    scraped_at TIMESTAMP WITH TIME ZONE DEFAULT NOW()
);

-- Indices for automotive and real-estate market intelligence
CREATE INDEX idx_milanuncios_geo ON milanuncios_ads (province, city);
CREATE INDEX idx_milanuncios_category ON milanuncios_ads (category);
CREATE INDEX idx_milanuncios_seller ON milanuncios_ads (seller_type, seller_id);
```

#### Direct Node.js Integration

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: 'YOUR_API_TOKEN' });

const run = await client.actor('haketa/milanuncios-scraper').call({
    startUrls: ['https://www.milanuncios.com/coches-de-segunda-mano/'],
    maxPages: 3,
    maxItems: 100,
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(`Successfully extracted ${items.length} classified ads from Milanuncios.`);
```

***

### 🇪🇸 Supported Spanish Autonomous Communities & Major Provinces

You can target any of Spain's 17 autonomous communities and 50 provinces:

| Autonomous Community | Major Provinces Included | Key Commercial Hubs |
|:---|:---|:---|
| **Comunidad de Madrid** | Madrid | Madrid, Alcalá de Henares, Móstoles, Leganés |
| **Cataluña** | Barcelona, Girona, Lleida, Tarragona | Barcelona, Badalona, Sabadell, Terrassa |
| **Andalucía** | Sevilla, Málaga, Granada, Cádiz, Córdoba, Almería | Sevilla, Málaga, Marbella, Jerez de la Frontera |
| **Comunitat Valenciana**| Valencia, Alicante, Castellón | Valencia, Alicante, Elche, Torrevieja |
| **Galicia** | A Coruña, Pontevedra, Lugo, Ourense | Vigo, A Coruña, Santiago de Compostela |
| **País Vasco** | Bizkaia, Gipuzkoa, Álava | Bilbao, San Sebastián, Vitoria-Gasteiz |
| **Islas Canarias** | Las Palmas, Santa Cruz de Tenerife | Las Palmas de Gran Canaria, Santa Cruz |
| **Islas Baleares** | Illes Balears | Palma de Mallorca, Ibiza, Menorca |

***

### ❓ Frequently Asked Questions (FAQ)

**Does this scraper require a Milanuncios account or login?**\
No. The scraper reads public classified advertisements directly without requiring user credentials, phone verification, or cookies.

**Why is a Spanish residential proxy required?**\
Milanuncios employs network protection layers that restrict non-Spanish and typical datacenter IP ranges. Apify Spanish Residential proxies ensure seamless, uninterrupted extraction.

**How many ads are on each page?**\
Milanuncios serves approximately 42 ads per result page. Paginating 10 pages yields ~420 structured ad records. Setting `maxPages` to `0` enables deep multi-thousand item extraction.

**How are vehicle tags formatted?**\
Tags like mileage, transmission, and fuel type are cleanly extracted as human-readable text strings (e.g. `["2022 año", "38.500 kms", "Diésel"]`) rather than unparsed objects.

**Can I scrape private sellers exclusively?**\
Yes. Every output record contains a `sellerType` attribute (`private` or `professional`), allowing you to filter for private owner listings in your downstream queries or spreadsheets.

**Are image URLs absolute?**\
Yes. All image paths are normalized to absolute `https://` URLs pointing directly to high-resolution assets hosted on Milanuncios media CDNs.

***

### 🔗 Related Classifieds & Real Estate Scrapers

Expand your marketplace data intelligence across European markets:

- [Willhaben Scraper](https://apify.com/haketa/willhaben-scraper) — Austria's #1 classifieds and auto marketplace.
- [Bazos Scraper](https://apify.com/haketa/bazos-scraper) — Leading classifieds in the Czech Republic & Slovakia.
- [Domclick Scraper](https://apify.com/haketa/domclick-scraper) — Russia's premier real estate portal powered by Sberbank.
- [Expedia Scraper](https://apify.com/haketa/expedia-scraper) — European hotel rates, hospitality data, and amenities.

***

### 📋 Changelog

- **v1.2 (2026-11)**:
  - Unlocked 1,000+ deep pagination with parameter traversing (`?pagina=N`) and zero artificial page caps.
  - Set default `maxPages` and `maxItems` to `0` (unlimited auto-pagination) with fast-prefill sample.
  - Enhanced string-aware brace parsing for embedded JSON structures.
  - Standardized vehicle and property tag string normalization.
- **v1.1 (2026-10)**:
  - Added financed price extraction and warranty period tracking.
  - Integrated canonical absolute image URL normalization.
- **v1.0 (2026-10)**:
  - Initial production release supporting multi-category Milanuncios classifieds scraping.

# Changelog

This Actor's version history is a separate document: https://apify.com/haketa/milanuncios-scraper/changelog.md

# Actor input Schema

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

Milanuncios.com listing or search pages to scrape — a category (e.g. https://www.milanuncios.com/coches-de-segunda-mano/), a filtered search, or a province page. Open Milanuncios, filter however you like, and paste the result URL. A bare slug like `venta-de-pisos` also works.

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

How many result pages to paginate per listing (~42 ads per page, via ?pagina=N). 0 = unlimited / auto (governed by maxItems).

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

Maximum number of ads to save across all listings. 0 = unlimited (governed by deep pagination).

## `maxConcurrency` (type: `integer`):

How many listings to process in parallel.

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

SPANISH RESIDENTIAL proxy is REQUIRED — Milanuncios is PerimeterX-protected and walls datacenter / non-Spanish IPs. Keep the default (Apify Residential, country ES). The actor retries each page on a fresh Spanish IP.

## Actor input object example

```json
{
  "startUrls": [
    "https://www.milanuncios.com/coches-de-segunda-mano/",
    "https://www.milanuncios.com/venta-de-pisos/"
  ],
  "maxPages": 0,
  "maxItems": 50,
  "maxConcurrency": 3,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "ES"
  }
}
```

# Actor output Schema

## `ads` (type: `string`):

Classified ads scraped from Milanuncios.com — title, price, location, seller, category, description and images.

# 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 = {
    "startUrls": [
        "https://www.milanuncios.com/coches-de-segunda-mano/"
    ],
    "maxPages": 0,
    "maxItems": 50,
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ],
        "apifyProxyCountry": "ES"
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("haketa/milanuncios-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 = {
    "startUrls": ["https://www.milanuncios.com/coches-de-segunda-mano/"],
    "maxPages": 0,
    "maxItems": 50,
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
        "apifyProxyCountry": "ES",
    },
}

# Run the Actor and wait for it to finish
run = client.actor("haketa/milanuncios-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 '{
  "startUrls": [
    "https://www.milanuncios.com/coches-de-segunda-mano/"
  ],
  "maxPages": 0,
  "maxItems": 50,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "ES"
  }
}' |
apify call haketa/milanuncios-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,haketa/milanuncios-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/wXZ4m1OctLZhcwoQ3/builds/03oZqpTosZarKaQeu/openapi.json
