# Encontrar CNPJ de Empresas do Google Maps (Brasil) (`jeffev/encontrar-cnpj`) Actor

Descubra o CNPJ de lugares do Google Maps ou de qualquer lista de empresas: casa nome, telefone e endereço com a base oficial da Receita Federal e devolve razão social, porte, data de abertura, CNAE, Simples/MEI e contatos.

- **URL**: https://apify.com/jeffev/encontrar-cnpj.md
- **Developed by:** [Jefferson Valandro](https://apify.com/jeffev) (community)
- **Categories:** Lead generation, Business
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$10.00 / 1,000 cnpj encontrados

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

## Encontrar CNPJ de empresas do Google Maps (Brasil)

O Google Maps dá nome, telefone e endereço, mas não o **CNPJ**. Sem ele você não sabe o porte da empresa, há quanto tempo ela existe, se é MEI ou Simples, nem quem são os sócios.

Este actor **descobre o CNPJ** de cada lugar cruzando nome, telefone e endereço com a **base oficial da Receita Federal** (28 milhões de estabelecimentos ativos, atualizada todo mês) e devolve o lead qualificado.

### Como usar

**Com o Google Maps Scraper:** rode o [Google Maps Scraper](https://apify.com/compass/crawler-google-places) normalmente e informe aqui o **ID do dataset** da execução. Ou configure como integração para rodar automaticamente depois de cada busca.

**Com a sua própria lista** (CRM, planilha):

```json
{
  "lugares": [
    {"nome": "Restaurante Bardana", "cidade": "Campinas", "uf": "SP", "telefone": "(19) 3000-0000", "endereco": "Rua Exemplo, 100", "cep": "13000-000", "categoria": "Restaurante"}
  ]
}
```

Só nome, cidade e UF já funcionam. Telefone, endereço e CEP aumentam bastante a taxa de acerto.

### O que você recebe

Os dados do lugar mais:

| Campo | Descrição |
|---|---|
| `cnpjEncontrado`, `cnpjFormatado` | se achou, e o CNPJ |
| `confianca` | **alta** (nome parecido, ou telefone e endereço batendo juntos) ou **media** |
| `metodo` | como casou: `telefone`, `endereco`, `telefone+endereco` ou `nome` |
| `razaoSocial`, `nomeFantasia` | da Receita |
| `porte`, `capitalSocial`, `dataAbertura` | ME, EPP ou demais; capital; data de abertura |
| `cnaePrincipal`, `cnaeDescricao` | atividade oficial |
| `simplesNacional`, `mei` | regime tributário |
| `telefoneReceita`, `emailReceita`, `enderecoReceita` | contatos cadastrados na Receita |

### Taxa de acerto

Num teste com 180 lugares reais do Google Maps em Campinas (restaurantes, dentistas e contabilidades), o CNPJ foi encontrado para **59%**, quase todos com confiança alta. A taxa varia com o tipo de negócio: empresas com nome próprio e telefone fixo casam melhor do que ambulantes e franquias.

Para evitar erros, o casamento confere se a atividade do Google Maps é compatível com o CNAE (um dentista não casa com uma imobiliária do mesmo prédio) e ignora telefones compartilhados por muitas empresas (normalmente o do contador).

### Preço

Você paga **só pelos lugares em que o CNPJ foi encontrado**. Os não encontrados aparecem na saída sem custo.

### Privacidade (LGPD)

Quando a empresa é de empresário individual, a Receita inclui o CPF no fim da razão social. Esse número é removido.

***

## Find the CNPJ (Brazilian company ID) for Google Maps places

Google Maps gives you name, phone and address, but not the company's tax ID (CNPJ). This actor matches each place against the official Receita Federal registry (28M active establishments, monthly) and returns the CNPJ with legal name, size, opening date, industry code, tax regime and registered contacts, plus a confidence level. Works with Google Maps Scraper datasets or your own list. You pay only for places where a CNPJ was found.

# Actor input Schema

## `datasetId` (type: `string`):

ID do dataset de uma execução do Google Maps Scraper (ou de qualquer actor com campos title, phone, street, postalCode, city, state). Também pode ser ligado como integração: rode o Google Maps Scraper e envie o dataset para cá.

## `lugares` (type: `array`):

Objetos com nome, cidade, uf e, se tiver, telefone, endereco (rua e número), cep e categoria.

## `confiancaMinima` (type: `string`):

Alta: nome parecido, ou telefone e endereço batendo juntos. Média: inclui casamentos só por telefone ou endereço com atividade compatível.

## `incluirNaoEncontrados` (type: `boolean`):

Mantém todos os lugares na saída (sem custo para os não encontrados).

## `maxItens` (type: `integer`):

Limite de lugares lidos da entrada.

## Actor input object example

```json
{
  "lugares": [
    {
      "nome": "Restaurante Bardana",
      "cidade": "Campinas",
      "uf": "SP",
      "categoria": "Restaurante"
    }
  ],
  "confiancaMinima": "media",
  "incluirNaoEncontrados": true
}
```

# Actor output Schema

## `empresas` (type: `string`):

Uma linha por lugar, com o CNPJ encontrado e os dados da Receita.

# 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 = {
    "lugares": [
        {
            "nome": "Restaurante Bardana",
            "cidade": "Campinas",
            "uf": "SP",
            "categoria": "Restaurante"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("jeffev/encontrar-cnpj").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 = { "lugares": [{
            "nome": "Restaurante Bardana",
            "cidade": "Campinas",
            "uf": "SP",
            "categoria": "Restaurante",
        }] }

# Run the Actor and wait for it to finish
run = client.actor("jeffev/encontrar-cnpj").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 '{
  "lugares": [
    {
      "nome": "Restaurante Bardana",
      "cidade": "Campinas",
      "uf": "SP",
      "categoria": "Restaurante"
    }
  ]
}' |
apify call jeffev/encontrar-cnpj --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,jeffev/encontrar-cnpj"
        }
    }
}
```

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/Uggm1PNitUuaHPndv/builds/9y6ByK1abRQvEYqxa/openapi.json
