{
  "openapi": "3.0.1",
  "info": {
    "title": "Milanuncios Scraper — Spain Classifieds Ads & Prices",
    "description": "Scrape Milanuncios.com Spain classifieds by keyword, category, province, or URL. Flat MCP-ready rows: title, EUR price, city/province, seller type, images, dates. HTTP-only via __INITIAL_PROPS__ + Spanish residential proxy. Cookieless, no login.",
    "version": "0.1",
    "x-build-id": "NBusoJglcmr9P77Cd"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/khadinakbar~milanuncios-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-khadinakbar-milanuncios-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/khadinakbar~milanuncios-scraper/runs": {
      "post": {
        "operationId": "runs-sync-khadinakbar-milanuncios-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/khadinakbar~milanuncios-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-khadinakbar-milanuncios-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",
        "properties": {
          "startUrls": {
            "title": "Start URLs",
            "type": "array",
            "description": "Milanuncios search or ad URLs to scrape. Search examples: https://www.milanuncios.com/telefonos-moviles/iphone.htm or https://www.milanuncios.com/anuncios-en-madrid/. Detail URLs ending in -{id}.htm return one enriched row. Non-milanuncios.com hosts are rejected. When set, startUrls take priority over keyword/category/province builders.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "keyword": {
            "title": "Search keyword",
            "type": "string",
            "description": "Keyword used when startUrls is empty. Slugified into the Milanuncios path (e.g. iphone → /anuncios/iphone.htm or /{category}/iphone.htm). Combine with category and province for narrower searches."
          },
          "category": {
            "title": "Category slug",
            "enum": [
              "motor",
              "coches-de-segunda-mano",
              "motos",
              "inmobiliaria",
              "ofertas-de-empleo",
              "formacion",
              "servicios",
              "negocios",
              "informatica-segunda-mano",
              "imagen-y-sonido",
              "telefonia",
              "telefonos-moviles",
              "juegos",
              "casa-y-jardin",
              "moda-y-complementos",
              "bebes",
              "aficiones",
              "deportes-nautica",
              "mascotas"
            ],
            "type": "string",
            "description": "Optional Milanuncios category path segment (e.g. telefonos-moviles, coches-de-segunda-mano, inmobiliaria). Must match a known slug — typos fail the run instead of searching all Spain."
          },
          "province": {
            "title": "Province",
            "enum": [
              "alava",
              "albacete",
              "alicante",
              "almeria",
              "asturias",
              "avila",
              "badajoz",
              "baleares",
              "barcelona",
              "vizcaya",
              "burgos",
              "caceres",
              "cadiz",
              "cantabria",
              "castellon",
              "ceuta",
              "ciudad_real",
              "cordoba",
              "la_coruna",
              "cuenca",
              "guipuzcoa",
              "girona",
              "granada",
              "guadalajara",
              "huelva",
              "huesca",
              "jaen",
              "la_rioja",
              "las_palmas",
              "leon",
              "lleida",
              "lugo",
              "madrid",
              "malaga",
              "melilla",
              "murcia",
              "navarra",
              "ourense",
              "palencia",
              "pontevedra",
              "salamanca",
              "segovia",
              "sevilla",
              "soria",
              "tarragona",
              "tenerife",
              "teruel",
              "toledo",
              "valencia",
              "valladolid",
              "zamora",
              "zaragoza"
            ],
            "type": "string",
            "description": "Optional Spanish province slug as used in Milanuncios URLs (madrid, barcelona, vizcaya, las_palmas, ciudad_real). Narrows results via path segments like /anuncios-en-madrid/."
          },
          "minPrice": {
            "title": "Min price (EUR)",
            "minimum": 0,
            "type": "integer",
            "description": "Minimum price filter mapped to Milanuncios desde query parameter. Leave empty for no floor."
          },
          "maxPrice": {
            "title": "Max price (EUR)",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum price filter mapped to Milanuncios hasta query parameter. Leave empty for no ceiling."
          },
          "sellerType": {
            "title": "Seller type",
            "enum": [
              "any",
              "private",
              "professional"
            ],
            "type": "string",
            "description": "Filter private (particular) vs professional sellers via Milanuncios vendedor=part|prof. Choose any to skip the filter.",
            "default": "any"
          },
          "adType": {
            "title": "Ad type",
            "enum": [
              "any",
              "offer",
              "wanted"
            ],
            "type": "string",
            "description": "Offer to sell vs wanted/demand ads (demanda=n|s). Defaults to any.",
            "default": "any"
          },
          "onlyShippable": {
            "title": "Only shippable",
            "type": "boolean",
            "description": "When true, sets isShippable=true on the Milanuncios search request.",
            "default": false
          },
          "sort": {
            "title": "Sort order",
            "enum": [
              "relevance",
              "date",
              "cheapest",
              "expensive"
            ],
            "type": "string",
            "description": "Milanuncios sort: relevance (default), date (newest), cheapest, or expensive.",
            "default": "relevance"
          },
          "maxItems": {
            "title": "Max listings",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "Hard cap on dataset rows charged this run. Prefill 5 for a cheap quality check. Hard maximum 2000.",
            "default": 30
          },
          "maxPages": {
            "title": "Max search pages",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Maximum Milanuncios result pages to crawl per search URL (~41 ads/page). Stops earlier when maxItems is reached.",
            "default": 10
          },
          "fetchDetails": {
            "title": "Enrich from detail pages",
            "type": "boolean",
            "description": "Visit each ad page for seller profile, structured attributes, favorites/shares, and contact flags. Adds one residential request per listing and charges listing-enriched ($0.008) on top of listing-scraped.",
            "default": false
          },
          "stripSellerPII": {
            "title": "Strip private-seller PII",
            "type": "boolean",
            "description": "For GDPR-sensitive pipelines: redact private seller name/id and coarsen coordinates/zip on detail-enriched rows. Professional shop identity is kept. Applies when fetchDetails is on or detail URLs are used.",
            "default": false
          },
          "requireKeywordInTitle": {
            "title": "Require keyword in title/description",
            "type": "boolean",
            "description": "Client-side filter: keep only ads whose title or description contains every word from keyword. Useful because Milanuncios search can be fuzzy.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Milanuncios blocks datacenter and non-Spain IPs (Akamai). Default is Apify RESIDENTIAL with country ES. Do not switch to datacenter unless you accept UPSTREAM_FAILED outcomes.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ],
              "apifyProxyCountry": "ES"
            }
          }
        }
      },
      "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}