# CNPJ Intelligence BR — Brazilian Company Deep Profile (`geodetic_marigold/brazilian-company-signals`) Actor

Turns any Brazilian CNPJ into deep company intelligence: fiscal regime history, shareholder changes, job openings, public procurement signals, and AI-generated executive report in Portuguese. Zero-auth, 100% public government data. Built for B2B prospecting & due diligence.

- **URL**: https://apify.com/geodetic\_marigold/brazilian-company-signals.md
- **Developed by:** [Antonio Fernando Rincon de Mendonça](https://apify.com/geodetic_marigold) (community)
- **Categories:** Business, Lead generation
- **Stats:** 4 total users, 4 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.056 / result

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

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## Brazilian Company Signals

Aggregates **public Brazilian company data** into a single API call — registry + open job postings + public procurement + AI commercial report — perfect for B2B sales prospecting, lead qualification, due diligence, and market research.

### What it does

Given a **CNPJ** (Brazilian company tax ID), returns one structured JSON with:

- **Cadastral** (minhareceita.org + Receita Federal fallback): legal name, trade name, status, capital, CNAE (primary + secondary), address, phones, email, partners with **age range** and **masked CPF**, **tax regime history (2016-2024)**
- **Vagas / Job postings** (Gupy): open positions published by the company — a strong signal of active hiring and team expansion
- **Licitações / Public procurement** (PNCP, opt-in): government contracts where the company appears as the purchasing entity — relevant when prospecting the public sector
- **Aggregated intelligence**: commercial tier (LOW / MEDIUM / HIGH / VERY_HIGH), company age and category, activity score, risk flags
- **AI commercial report** (optional): 140-200 word inferential analysis in Portuguese with tone that adapts to the company profile — bring your own OpenAI key

### Why use it

Brazil has 50M+ registered companies, but the public data is spread across multiple government APIs with different formats, rate limits, and quirks. This actor does the unification work for you — **zero auth on public sources, zero ToS risk**, structured JSON ready to pipe into any CRM.

### Use cases

- **B2B SDRs**: qualify CNPJs in your pipeline before reaching out. Open job postings = hiring timing. Commercial tier = prioritization.
- **Due diligence**: verify cadastral status, tax regime history, and partners in seconds.
- **Market research**: enrich lists of CNPJs with real activity signals, not just registry data.
- **CRM enrichment**: pipe via n8n / Zapier / Make into HubSpot, Pipedrive, Salesforce (n8n template included).

### Input

```json
{
  "cnpj": "33000167000101",
  "sources": ["cadastral", "vagas"],
  "includeAiReport": true,
  "openaiApiKey": "sk-...",
  "maxProcurementDays": 180
}
````

| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| `cnpj` | string | ✅ | — | 14 digits (formatted OK: `33.000.167/0001-01`) |
| `sources` | array | — | `["cadastral","vagas"]` | Which sources to query. Options: `cadastral`, `vagas`, `licitacoes` |
| `includeAiReport` | boolean | — | `true` | Generate the AI commercial report (requires `openaiApiKey`) |
| `openaiApiKey` | string (secret) | — | — | Your OpenAI API key. Never stored or logged. |
| `maxProcurementDays` | int | — | `180` | How far back to search procurement (30-730) |

### Output (dataset item)

```json
{
  "schemaVersion": "0.4",
  "cnpj": "33000167000101",
  "enrichedAt": "2026-04-17T...",
  "sources": {
    "cadastral": {
      "razaoSocial": "...",
      "situacaoCadastral": { "status": "Ativa", "motivo": null },
      "capitalSocial": 5000000,
      "cnaePrincipal": { "codigo": "...", "descricao": "..." },
      "socios": [{ "nome": "...", "faixaEtaria": "...", "cpfCnpjMascarado": "***912137**" }],
      "regimeTributarioHistorico": [{ "ano": 2024, "forma": "..." }]
    },
    "vagas": { "count": 12, "items": [...] },
    "licitacoes": { "count": 3, "totalValue": 4500000, "items": [...] }
  },
  "intelligence": {
    "commercialTier": { "tier": "HIGH", "reasons": [...] },
    "ageYears": 35,
    "ageCategory": "established",
    "flags": [...]
  },
  "indicators": {
    "isActive": true,
    "isHiring": true,
    "openingsCount": 12,
    "hasRecentProcurement": true,
    "commercialTier": "HIGH",
    "flagsCount": 0
  },
  "aiReport": {
    "available": true,
    "text": "...",
    "generatedInMs": 4200
  },
  "prospectaaiLink": "https://prospectaai.com.br/dossie/33000167000101",
  "meta": { "durationMs": 6800, "errors": [], ... }
}
```

### Data sources

| Source | API | Rate limit | License |
|---|---|---|---|
| minhareceita.org | https://minhareceita.org | generous | Public |
| publica.cnpj.ws (fallback) | https://publica.cnpj.ws | ~3 req/min per IP | Public |
| Gupy | https://portal.api.gupy.io | — | Public job feed |
| PNCP | https://pncp.gov.br/api/consulta | — | Public gov |
| OpenAI (AI report, optional) | https://api.openai.com | your quota | Your own key |

### Pricing

**Pay per event:**

- **Actor start**: $0.06 per run
- **Result (dataset item)**: $0.08 per enriched CNPJ
- **AI commercial report**: $0.12 per run (only charged when the report is actually generated and `openaiApiKey` is provided — your OpenAI usage is billed separately by OpenAI)

Typical run with all sources + AI report: ~**$0.26** plus your OpenAI cost (~$0.002-0.005 with gpt-4o-mini).

### Need more signals? Try ProspectaAI

This actor returns **structured data** from 3 public sources. The full Signal-to-Action Sales OS is at **[prospectaai.com.br](https://prospectaai.com.br)** — it's what we built this actor from.

**What you get on top of this actor:**

- **Signal scoring across 8+ sources** — hiring + Meta Ads + Google News + new domains + BNDES financing + procurement + website changes + LinkedIn decision-makers
- **WhatsApp message generator** — auto-drafts the opener based on the specific signal detected ("saw you just posted 5 openings for SDRs...")
- **Automated outreach cadence** with tracking pixel and reply detection
- **LinkedIn + phone waterfall** — decision-maker enrichment with 8-pattern email verification
- **CRM sync** to HubSpot, Pipedrive, Salesforce, RD Station (OAuth-ready)

**→ [Free trial: 10 qualified leads/day, no credit card](https://prospectaai.com.br)** — or DM the founder (Antonio Rincon, [linkedin.com/in/antoniohertzog](https://linkedin.com/in/antoniohertzog)) with your use case and get a 7-day expanded trial (50 leads with signals).

This actor handles raw data. ProspectaAI handles the "which lead do I call right now and what do I say?" layer.

### Integration templates

Ready-to-use in [`templates/`](./templates/):

- **n8n**: `n8n-cnpj-enrichment.json` — CNPJ → enrich → HubSpot upsert (swap last node for any CRM)
- Zapier: coming soon
- Make.com: coming soon

### Local development

```bash
npm install
node src/test-local.js   ## smoke test against 3 real CNPJs
```

### Deployment

```bash
apify login
apify push
```

### Changelog

- **0.5** (Apr 2026): hotfix for Gupy API breaking change — `name` parameter replaced by `jobName`. Vagas source now uses waterfall search (5 common role terms) + local filter by `careerPageName`/`jobUrl` match. Coverage limited to companies using Gupy as ATS (~40% of BR market).
- **0.4** (Apr 2026): replaced PNCP default with Gupy (job postings); score replaced by qualitative tier; AI report now inferential with variable tone; `schemaVersion` field added
- **0.3** (Apr 2026): added AI commercial report (optional, pay-per-event); switched primary cadastral source to minhareceita.org for richer data (tax regime history, partner age range)
- **0.2** (Apr 2026): added aggregated intelligence layer (tier, flags, age category)
- **0.1** (Apr 2026): initial release with cadastral + licitacoes sources

# Actor input Schema

## `cnpj` (type: `string`):

Brazilian company registration number. Accepts formatted or digits-only.

## `sources` (type: `array`):

Which data sources to query. Default: cadastral + vagas (best signal for private B2B). Licitações only for government entities.

## `includeAiReport` (type: `boolean`):

Generates an inferential business analysis in Portuguese (140-200 words) using OpenAI. Requires openaiApiKey below.

## `openaiApiKey` (type: `string`):

Your personal OpenAI API key (starts with sk-). Required for AI report. Get at https://platform.openai.com/api-keys. Cost per run: ~$0.0005.

## `maxProcurementDays` (type: `integer`):

Only used if 'licitacoes' is in sources. Default 180.

## Actor input object example

```json
{
  "cnpj": "47960950000121",
  "sources": [
    "cadastral"
  ],
  "includeAiReport": true,
  "maxProcurementDays": 180
}
```

# 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 = {
    "cnpj": "33000167000101",
    "sources": [
        "cadastral"
    ],
    "includeAiReport": false
};

// Run the Actor and wait for it to finish
const run = await client.actor("geodetic_marigold/brazilian-company-signals").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 = {
    "cnpj": "33000167000101",
    "sources": ["cadastral"],
    "includeAiReport": False,
}

# Run the Actor and wait for it to finish
run = client.actor("geodetic_marigold/brazilian-company-signals").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "cnpj": "33000167000101",
  "sources": [
    "cadastral"
  ],
  "includeAiReport": false
}' |
apify call geodetic_marigold/brazilian-company-signals --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=geodetic_marigold/brazilian-company-signals",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "CNPJ Intelligence BR — Brazilian Company Deep Profile",
        "description": "Turns any Brazilian CNPJ into deep company intelligence: fiscal regime history, shareholder changes, job openings, public procurement signals, and AI-generated executive report in Portuguese. Zero-auth, 100% public government data. Built for B2B prospecting & due diligence.",
        "version": "0.5",
        "x-build-id": "ibinnHFdKnHMXaJip"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/geodetic_marigold~brazilian-company-signals/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-geodetic_marigold-brazilian-company-signals",
                "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/geodetic_marigold~brazilian-company-signals/runs": {
            "post": {
                "operationId": "runs-sync-geodetic_marigold-brazilian-company-signals",
                "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/geodetic_marigold~brazilian-company-signals/run-sync": {
            "post": {
                "operationId": "run-sync-geodetic_marigold-brazilian-company-signals",
                "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": [
                    "cnpj"
                ],
                "properties": {
                    "cnpj": {
                        "title": "CNPJ (14 digits)",
                        "pattern": "^[\\d./\\-]+$",
                        "type": "string",
                        "description": "Brazilian company registration number. Accepts formatted or digits-only."
                    },
                    "sources": {
                        "title": "Data sources",
                        "uniqueItems": true,
                        "type": "array",
                        "description": "Which data sources to query. Default: cadastral + vagas (best signal for private B2B). Licitações only for government entities.",
                        "items": {
                            "type": "string",
                            "enum": [
                                "cadastral",
                                "vagas",
                                "licitacoes"
                            ],
                            "enumTitles": [
                                "Cadastral profundo (minhareceita.org)",
                                "Vagas abertas (Gupy)",
                                "Licitações PNCP (só relevante para entidades públicas)"
                            ]
                        },
                        "default": [
                            "cadastral",
                            "vagas"
                        ]
                    },
                    "includeAiReport": {
                        "title": "Include AI-generated executive report",
                        "type": "boolean",
                        "description": "Generates an inferential business analysis in Portuguese (140-200 words) using OpenAI. Requires openaiApiKey below.",
                        "default": true
                    },
                    "openaiApiKey": {
                        "title": "OpenAI API Key (optional)",
                        "type": "string",
                        "description": "Your personal OpenAI API key (starts with sk-). Required for AI report. Get at https://platform.openai.com/api-keys. Cost per run: ~$0.0005."
                    },
                    "maxProcurementDays": {
                        "title": "Max days back for procurement history",
                        "minimum": 30,
                        "maximum": 730,
                        "type": "integer",
                        "description": "Only used if 'licitacoes' is in sources. Default 180.",
                        "default": 180
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
