{
  "openapi": "3.0.1",
  "info": {
    "title": "Mercado Livre Brasil BOOST Scraper 🇧🇷 + Analytics (Português)",
    "description": "Extraia resultados de busca do Mercado Livre Brasil com dados limpos e tipados — preços, parcelamento, marcadores de anúncio patrocinado, envio Full, vendedores — além de resumo instantâneo do mercado, posicionamento de SKU, ranking e alertas de queda de preço.",
    "version": "0.1",
    "x-build-id": "FZOcRdj3KvrmZiEA6"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/mia_miah~mercado-livre-market-scanner/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-mia_miah-mercado-livre-market-scanner",
        "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/mia_miah~mercado-livre-market-scanner/runs": {
      "post": {
        "operationId": "runs-sync-mia_miah-mercado-livre-market-scanner",
        "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/mia_miah~mercado-livre-market-scanner/run-sync": {
      "post": {
        "operationId": "run-sync-mia_miah-mercado-livre-market-scanner",
        "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",
        "required": [
          "keywords"
        ],
        "properties": {
          "keywords": {
            "title": "🔍 Palavras-chave / Keywords",
            "type": "array",
            "description": "Keywords to scan on Mercado Livre Brasil (one market report per keyword). Ex: 'tenis de corrida masculino'.",
            "items": {
              "type": "string"
            }
          },
          "maxItemsPerKeyword": {
            "title": "📦 Max products per keyword",
            "minimum": 50,
            "maximum": 100,
            "type": "integer",
            "description": "How many search results to collect per keyword. Mercado Livre stops serving new listings after ~2 pages, so a search yields at most ~85 unique products no matter how many you ask for — the run simply stops early when nothing new comes back. The minimum is 50 because a single page already costs the same whether you take 10 or 60.",
            "default": 100
          },
          "sortBy": {
            "title": "↕️ Sort order",
            "enum": [
              "relevance",
              "price_asc",
              "price_desc"
            ],
            "type": "string",
            "description": "Mirror of Mercado Livre's own sort options. 'relevance' is what buyers see (best for rank tracking).",
            "default": "relevance"
          },
          "mySku": {
            "title": "🎯 My SKU (positioning mode)",
            "type": "string",
            "description": "Optional. Your Mercado Livre item ID (e.g. MLB4290861023). When set, the run also outputs a positioning report: your rank, price percentile and comparison vs. category leaders."
          },
          "priceAlertBelow": {
            "title": "🚨 Alert if any competitor price drops below (R$)",
            "type": "integer",
            "description": "Optional absolute threshold in BRL. Fires an alert (dataset + webhook) if any product in the results is priced below this value."
          },
          "enableDelta": {
            "title": "🔁 Enable delta & history mode",
            "type": "boolean",
            "description": "Compares this run with the previous run of the same keyword (stored per user) and outputs what changed: price drops, new competitors in top 10, rank shifts, disappeared items. Becomes active from the 2nd run onwards.",
            "default": true
          },
          "alertWebhookUrl": {
            "title": "📣 Webhook URL for alerts",
            "type": "string",
            "description": "Optional. Alerts are POSTed as JSON to this URL (n8n, Make, your API...). Slack incoming webhooks are detected automatically and receive a formatted message with clickable products instead of raw JSON."
          },
          "failOnEmpty": {
            "title": "❗ Fail the run when nothing is collected",
            "type": "boolean",
            "description": "Off by default: a keyword with no results is a valid outcome, not an error. Turn it ON for scheduled monitoring — the run then ends as FAILED when zero products are collected, so Apify's failure notifications actually fire if Mercado Livre changes its layout or blocks the request.",
            "default": false
          },
          "saveSnapshotOnEmpty": {
            "title": "🩺 Save debug snapshot when page yields 0 items",
            "type": "boolean",
            "description": "If a page parses to zero products (layout change / blocking), stores the raw HTML in the key-value store for inspection.",
            "default": true
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}