{
  "openapi": "3.0.1",
  "info": {
    "title": "Milanuncios Scraper — Spain Classifieds Ads & Prices",
    "description": "Scrape Milanuncios.com Spanish classifieds by keyword, category, province or URL. Flat rows include title, EUR price, city and province, seller type, images and dates, with no cookies or login.",
    "version": "0.2",
    "x-build-id": "UZHNG3tmqm9KzTYcR"
  },
  "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": "relevance (default), date, cheapest or expensive. Note: the site's date sort orders by last refresh, so an old ad that was bumped can come first. Use 'Only ads published in the last N days' for true new ads.",
            "default": "relevance"
          },
          "maxItems": {
            "title": "Max listings",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Most listings to save and charge in this run. Free plan: 25. Above 2,000 the search is split into price bands so the site's own limit does not stop you. Maximum 10,000.",
            "default": 30
          },
          "maxPages": {
            "title": "Max search pages",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Most result pages to read per search (about 41 ads per page, site limit 50). Stops earlier when Max listings is reached.",
            "default": 50
          },
          "fetchDetails": {
            "title": "Enrich from detail pages",
            "type": "boolean",
            "description": "Open each ad page for the seller profile, full attributes, favorites and shares, and contact flags. Charged as listing-enriched on top of the listing price. If an ad page cannot be read, the search row is still saved and no detail charge is made.",
            "default": false
          },
          "monitorMode": {
            "title": "Monitor mode (only changes)",
            "type": "boolean",
            "description": "Return only ads that are new or changed price since the last run of the same search. The first run returns everything up to Max listings and remembers it. Schedule it daily to watch a market. Rows get changeType, previousPriceEur and priceDropped.",
            "default": false
          },
          "publishedWithinDays": {
            "title": "Only ads published in the last N days",
            "minimum": 1,
            "maximum": 365,
            "type": "integer",
            "description": "Keep only ads first published within this many days (true publication date, not refresh date). May need more pages, so keep Max pages high. Leave empty for no limit."
          },
          "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 connections. Default is Apify Residential with country ES.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}