# Comparar preços cardápio iFood vs concorrentes (`bonpleincapital/ifood-comparar-precos`) Actor

Compara seu cardápio com pratos de concorrentes no iFood: mínimo, média, máximo e posição por prato. Testado: 2 resultados. O iFood pode limitar o acesso.

Licença: somente uso pessoal; revenda e redistribuição proibidas.
Criado com a ajuda de inteligência artificial.

- **URL**: https://apify.com/bonpleincapital/ifood-comparar-precos.md
- **Developed by:** [Bon Plein Capital](https://apify.com/bonpleincapital) (community)
- **Categories:** Automation, E-commerce
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.60 / 1,000 prato comparados

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## Comparar preços iFood: cardápio vs concorrentes

**Comparar preços iFood** é um Actor que compara os preços do cardápio do seu restaurante com os pratos de concorrentes
próximos no iFood. Você informa seus pratos e as páginas públicas dos concorrentes; o Actor devolve, para cada prato,
o menor, o médio e o maior preço dos concorrentes e se você está acima, abaixo ou na média. Ideal para donos de
restaurante, dark kitchens e consultores de delivery que precisam comparar preços iFood sem planilhas manuais.

### O que este Actor faz?

- Lê as páginas públicas de restaurantes concorrentes no iFood (sem login, sem dados privados).
- Casa cada um dos seus pratos com o prato mais parecido de cada concorrente (similaridade de nome ajustável).
- Gera um item JSON por prato: seu preço, mínimo, média e máximo dos concorrentes, diferença em % e posição.
- Se nenhum concorrente tiver prato parecido, o item vem com o status `no_competitor_match`, sem inventar dados.
- No plano gratuito da Apify você testa com os créditos mensais.

### Como usar

1. Clique em **Try for free** e abra a aba **Input**.
2. Cole seu cardápio em `myMenu` (nome e preço de cada prato).
3. Adicione em `competitorUrls` as páginas públicas dos concorrentes no iFood.
4. Clique em **Start** e baixe o resultado em JSON, CSV ou Excel, ou chame o Actor por API, Make, Zapier ou n8n.

Observação: o iFood pode mudar suas páginas ou limitar o acesso; quando uma página não puder ser lida, o Actor a ignora e registra um aviso no log.

### Input (Entrada)

```json
{
  "myMenu": [{"name": "X-Burger", "price": 24.9}, {"name": "Pizza Margherita", "price": 39.9}],
  "competitorUrls": ["https://www.ifood.com.br/restaurantes"],
  "minSimilarity": 0.6,
  "maxItems": 5
}
```

### Output (Saída)

```json
{
  "dish": "X-Burger",
  "myPrice": 24.9,
  "competitorsMatched": 2,
  "competitorMin": 22.5,
  "competitorAvg": 26.0,
  "competitorMax": 29.5,
  "diffVsAvgPercent": -4.2,
  "position": "na média",
  "status": "ok",
  "matches": [{"competitorUrl": "https://...", "competitorDish": "X-Burger Clássico", "competitorPrice": 22.5, "similarity": 0.78}]
}
```

### How much does it cost? (Quanto custa?)

Preço **pay per event**: você paga um pequeno valor por prato comparado (evento `result`), e nada por pratos que não
foram produzidos. Mil pratos custam o preço de 1.000 eventos `result` indicado na aba **Pricing**. O plano gratuito
da Apify dá créditos mensais para testar antes de pagar.

### FAQ

#### É legal usar este Actor?

O Actor lê apenas páginas públicas e não coleta dados pessoais. Você é responsável por usar os resultados de forma
lícita, inclusive respeitando a LGPD/GDPR e os termos do iFood.

#### Por que um prato aparece sem concorrente?

Porque nenhuma página lida tinha um prato com nome parecido. Reduza `minSimilarity` ou adicione mais concorrentes.

#### Posso usar por API?

Sim. Cada execução pode ser iniciada e lida pela API da Apify e pelos clientes Python e JavaScript.

#### O que fazer se algo falhar?

Abra uma issue na aba **Issues** com a entrada e o link da execução.

***

Created with the help of artificial intelligence.

# Changelog

This Actor's version history is a separate document: https://apify.com/bonpleincapital/ifood-comparar-precos/changelog.md

# Actor input Schema

## `myMenu` (type: `array`):

Lista de pratos seus: objetos com name e price (em R$).

## `competitorUrls` (type: `array`):

Páginas públicas de restaurantes concorrentes no iFood (até 10).

## `minSimilarity` (type: `number`):

De 0 a 1: quão parecido deve ser o nome do prato do concorrente.

## `maxItems` (type: `integer`):

Para depois deste número de pratos comparados.

## Actor input object example

```json
{
  "myMenu": [
    {
      "name": "X-Burger",
      "price": 24.9
    },
    {
      "name": "Pizza Margherita",
      "price": 39.9
    }
  ],
  "competitorUrls": [
    "https://www.ifood.com.br/restaurantes"
  ],
  "minSimilarity": 0.6,
  "maxItems": 5
}
```

# Actor output Schema

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

One dataset item per result, shown in the Overview view.

# 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 = {
    "myMenu": [
        {
            "name": "X-Burger",
            "price": 24.9
        },
        {
            "name": "Pizza Margherita",
            "price": 39.9
        }
    ],
    "competitorUrls": [
        "https://www.ifood.com.br/restaurantes"
    ],
    "minSimilarity": 0.6,
    "maxItems": 5
};

// Run the Actor and wait for it to finish
const run = await client.actor("bonpleincapital/ifood-comparar-precos").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 = {
    "myMenu": [
        {
            "name": "X-Burger",
            "price": 24.9,
        },
        {
            "name": "Pizza Margherita",
            "price": 39.9,
        },
    ],
    "competitorUrls": ["https://www.ifood.com.br/restaurantes"],
    "minSimilarity": 0.6,
    "maxItems": 5,
}

# Run the Actor and wait for it to finish
run = client.actor("bonpleincapital/ifood-comparar-precos").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 '{
  "myMenu": [
    {
      "name": "X-Burger",
      "price": 24.9
    },
    {
      "name": "Pizza Margherita",
      "price": 39.9
    }
  ],
  "competitorUrls": [
    "https://www.ifood.com.br/restaurantes"
  ],
  "minSimilarity": 0.6,
  "maxItems": 5
}' |
apify call bonpleincapital/ifood-comparar-precos --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,bonpleincapital/ifood-comparar-precos"
        }
    }
}
```

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/tfq1XcOERM1OqZiRO/builds/Ec1p1xcI3ML3WaHYz/openapi.json
