{
  "openapi": "3.0.1",
  "info": {
    "title": "MercadoLibre Seller & Competition Monitor",
    "description": "Monitor prices, positions, and seller changes on MercadoLibre across 9 LATAM countries. Pay only for changes detected in delta mode.",
    "version": "0.1",
    "x-build-id": "E7MjC8rotNZcroNo2"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/don.eich~mercadolibre-seller-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-don.eich-mercadolibre-seller-monitor",
        "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/don.eich~mercadolibre-seller-monitor/runs": {
      "post": {
        "operationId": "runs-sync-don.eich-mercadolibre-seller-monitor",
        "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/don.eich~mercadolibre-seller-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-don.eich-mercadolibre-seller-monitor",
        "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": {
          "mode": {
            "title": "Modo de operación",
            "enum": [
              "SEARCH",
              "SELLER",
              "PRODUCT",
              "MONITOR"
            ],
            "type": "string",
            "description": "SEARCH: keywords/categoría → listings y vendedores. SELLER: todos los listings de un vendedor. PRODUCT: todos los vendedores de un producto catálogo. MONITOR: delta — solo emite cambios vs snapshot anterior.",
            "default": "SEARCH"
          },
          "siteId": {
            "title": "Sitio de MercadoLibre",
            "enum": [
              "MLA",
              "MLB",
              "MLM",
              "MCO",
              "MLC",
              "MPE",
              "MLU",
              "MEC",
              "MRD"
            ],
            "type": "string",
            "description": "Site ID del país. MLA=Argentina, MLB=Brasil (mercadolivre.com.br), MLM=México, MCO=Colombia, MLC=Chile, MPE=Perú, MLU=Uruguay, MEC=Ecuador, MRD=República Dominicana.",
            "default": "MLA"
          },
          "searchQueries": {
            "title": "Búsquedas / keywords",
            "type": "array",
            "description": "Lista de keywords o frases a buscar. Activo en modos SEARCH y MONITOR. Ejemplo: [\"iphone 15\", \"samsung galaxy s24\"]",
            "items": {
              "type": "string"
            }
          },
          "categoryIds": {
            "title": "IDs de categoría",
            "type": "array",
            "description": "IDs de categoría de MercadoLibre (ej. MLA1055, MLB1051). Se combinan con searchQueries o se usan solos para scraping por categoría.",
            "items": {
              "type": "string"
            }
          },
          "sellerIds": {
            "title": "IDs de vendedor",
            "type": "array",
            "description": "IDs numéricos de vendedores (ej. 2386762620). En modo SELLER: extrae todos sus listings. En modo MONITOR: detecta cambios en su catálogo.",
            "items": {
              "type": "string"
            }
          },
          "sellerNicknames": {
            "title": "Nicknames de vendedor",
            "type": "array",
            "description": "Nicknames exactos de vendedores (ej. MERCADOLIBRE_IMPORTACIONES). Se resuelven a seller_id via API antes del scraping.",
            "items": {
              "type": "string"
            }
          },
          "catalogProductIds": {
            "title": "IDs de producto catálogo (PID)",
            "type": "array",
            "description": "IDs de producto del catálogo MercadoLibre (ej. MLA1055308852). En modo PRODUCT: extrae todos los vendedores que compiten en ese catálogo.",
            "items": {
              "type": "string"
            }
          },
          "itemIds": {
            "title": "IDs de listing (WID)",
            "type": "array",
            "description": "IDs de listings individuales (ej. MLA2396453468). Se usan en modo MONITOR para trackear items específicos.",
            "items": {
              "type": "string"
            }
          },
          "condition": {
            "title": "Condición del producto",
            "enum": [
              "all",
              "new",
              "used"
            ],
            "type": "string",
            "description": "Filtrar por condición. 'all' no aplica filtro.",
            "default": "all"
          },
          "sortBy": {
            "title": "Ordenar por",
            "enum": [
              "relevance",
              "price_asc",
              "price_desc"
            ],
            "type": "string",
            "description": "Criterio de ordenamiento de resultados de búsqueda.",
            "default": "relevance"
          },
          "maxResultsPerQuery": {
            "title": "Máximo de resultados por búsqueda",
            "minimum": 0,
            "maximum": 1000,
            "type": "integer",
            "description": "Límite de listings a extraer por keyword o categoría. Máximo 1000 (límite de la API). 0 = sin límite (hasta 1000).",
            "default": 100
          },
          "fetchSellerDetail": {
            "title": "Enriquecer datos del vendedor",
            "type": "boolean",
            "description": "Si es true, hace una llamada adicional a /users/{seller_id} para obtener reputación, power_seller_status y métricas de ventas. Aumenta tiempo y costo por vendedor único.",
            "default": true
          },
          "fetchItemDetail": {
            "title": "Enriquecer datos del item",
            "type": "boolean",
            "description": "Si es true, hace una llamada a /items/{id} para obtener stock exacto, variantes, installments y atributos completos. Recomendado para modos PRODUCT y MONITOR.",
            "default": false
          },
          "fetchTechSpecs": {
            "title": "Extraer especificaciones técnicas (HTML)",
            "type": "boolean",
            "description": "Si es true, hace scraping HTML con Googlebot UA para obtener la tabla de specs técnicas. Solo aplica cuando fetchItemDetail también es true.",
            "default": false
          },
          "deltaFields": {
            "title": "Campos a monitorear para cambios",
            "type": "array",
            "description": "Lista de campos del output que activan un delta_event cuando cambian. Por defecto monitorea precio, stock, posición, envío y fulfillment.",
            "items": {
              "type": "string",
              "enum": [
                "price",
                "originalPrice",
                "availableQuantity",
                "listingTypeId",
                "orderBackend",
                "condition",
                "freeShipping",
                "fulfillment",
                "sellerReputationLevel",
                "powerSellerStatus",
                "officialStoreId",
                "catalogListing",
                "winRate",
                "offerScore"
              ]
            },
            "default": [
              "price",
              "originalPrice",
              "availableQuantity",
              "orderBackend",
              "freeShipping",
              "fulfillment"
            ]
          },
          "monitorStoreName": {
            "title": "Nombre del KV store de delta (modo MONITOR)",
            "type": "string",
            "description": "Nombre del Key-Value Store de Apify donde se guardan los snapshots para comparación. Cambiar solo si se quieren múltiples monitores paralelos con distintos inputs.",
            "default": "ml-seller-monitor-delta"
          },
          "mlClientId": {
            "title": "MercadoLibre App Client ID",
            "type": "string",
            "description": "Client ID de una app registrada en developers.mercadolibre.com. Sin esto el actor cae a HTML scraping (menor confiabilidad). El registro es gratuito."
          },
          "mlClientSecret": {
            "title": "MercadoLibre App Client Secret",
            "type": "string",
            "description": "Client Secret de la app registrada. Se usa para obtener access_token via client_credentials (no requiere login de usuario)."
          },
          "proxyConfiguration": {
            "title": "Configuración de proxy",
            "type": "object",
            "description": "Configuración de Apify Proxy. Se recomienda 'auto' para usar datacenter IPs con rotación automática. Para máxima confiabilidad usar grupos RESIDENTIAL con países LATAM.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": []
            }
          },
          "requestHandlerTimeoutSecs": {
            "title": "Timeout por request (segundos)",
            "minimum": 10,
            "maximum": 120,
            "type": "integer",
            "description": "Segundos máximos por request antes de reintentar. La API responde en <500ms típicamente; el HTML puede tardar 3-8s.",
            "default": 30
          },
          "maxRequestRetries": {
            "title": "Reintentos por request fallido",
            "minimum": 0,
            "maximum": 5,
            "type": "integer",
            "description": "Cantidad de reintentos ante error 4xx/5xx o timeout. El actor aplica backoff exponencial entre reintentos.",
            "default": 3
          },
          "requestDelayMs": {
            "title": "Delay entre requests (ms)",
            "minimum": 100,
            "maximum": 5000,
            "type": "integer",
            "description": "Milisegundos de espera entre requests consecutivos al mismo dominio. MercadoLibre recomienda mínimo 200ms.",
            "default": 250
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}