# Ecommerce Price Scraper (`yurimaike/ecommerce-price-scraper`) Actor

Extrai títulos, preços e links de notebooks do Mercado Livre de forma rápida e estruturada

- **URL**: https://apify.com/yurimaike/ecommerce-price-scraper.md
- **Developed by:** [yuri maike braga](https://apify.com/yurimaike) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.00005 / actor start

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## Ecommerce Price Scraper

Apify Actor em Python/Crawlee para extrair produtos de páginas de pesquisa do Mercado Livre Brasil.

### Actor

O Actor aceita:

- `start_urls`: até 10 URLs de pesquisa do Mercado Livre Brasil.
- `max_pages`: limite de páginas (1–100).
- `proxy_mode`: `auto` (padrão), `always` ou `never`.

O modo `auto` inicia sem proxy residencial e tenta novamente URLs que retornem HTTP 401, 403 ou 429 usando o grupo residencial brasileiro. O uso do grupo residencial depende de acesso e cobrança habilitados na conta Apify.

A extração é feita do HTML e dos dados JSON embutidos na página. Não é uma integração com a API oficial do Mercado Livre. A estrutura HTML e as regras de acesso do site podem mudar, então valide os resultados antes de utilizá-los comercialmente.

### Rodar o Actor

```bash
pip install -r requirements.txt
apify run
```

### Painel web privado (MVP)

O diretório `webapp/` contém um painel simples que inicia execuções do Actor e exibe os produtos retornados.

Instale as dependências:

```bash
pip install -r requirements.txt
```

Configure variáveis de ambiente no servidor:

- `APIFY_TOKEN`: token privado da Apify.
- `APP_API_KEY`: chave longa e aleatória para proteger o painel.
- `APIFY_ACTOR_ID`: opcional; padrão `yurimaike~ecommerce-price-scraper`.

Inicie:

```bash
uvicorn webapp.main:app --host 0.0.0.0 --port 8000
```

Abra `http://localhost:8000` e informe a chave `APP_API_KEY` no painel.

**Segurança e escopo:** esta é uma primeira versão administrativa, com uma chave compartilhada. Não publique como SaaS multiusuário ainda. Antes disso, implemente contas individuais, armazenamento persistente por cliente, limites de uso, isolamento de dados, pagamentos e política de privacidade. Nunca coloque `APIFY_TOKEN` no frontend ou no Git.

### Próximas etapas comerciais

1. Testar o Actor em execução real e medir custo por resultado.
2. Configurar monetização Pay per Event na Apify Console depois de definir os eventos e preços.
3. Evoluir o painel para autenticação individual e histórico persistente.
4. Adicionar alertas e monitoramento agendado somente depois de validar custos e confiabilidade.

### Limitações conhecidas

- O painel mostra até 200 resultados por execução.
- A primeira versão não mantém histórico próprio de preços.
- A extração HTML pode retornar zero produtos se a página mudar ou bloquear a requisição.
- Não inclui pagamentos nem gestão de assinaturas.

# Actor input Schema

## `start_urls` (type: `array`):

URLs de pesquisa do Mercado Livre Brasil. Aceita até 10 URLs.

## `max_pages` (type: `integer`):

Quantidade máxima de páginas a visitar nesta execução.

## `proxy_mode` (type: `string`):

Auto começa sem proxy e usa proxy residencial brasileiro somente após bloqueio HTTP 401, 403 ou 429.

## Actor input object example

```json
{
  "start_urls": [
    {
      "url": "https://lista.mercadolivre.com.br/notebook"
    }
  ],
  "max_pages": 5,
  "proxy_mode": "auto"
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# 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 = {
    "start_urls": [
        {
            "url": "https://lista.mercadolivre.com.br/notebook"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("yurimaike/ecommerce-price-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 = { "start_urls": [{ "url": "https://lista.mercadolivre.com.br/notebook" }] }

# Run the Actor and wait for it to finish
run = client.actor("yurimaike/ecommerce-price-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 '{
  "start_urls": [
    {
      "url": "https://lista.mercadolivre.com.br/notebook"
    }
  ]
}' |
apify call yurimaike/ecommerce-price-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,yurimaike/ecommerce-price-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/7SCPxjiM1fQmfZwTY/builds/Kwkj2AQNVimpD03f4/openapi.json
