# Brazil CEP Geocoordinates, IBGE Code & Logistics Auditor (`b2b-quant-apis/brazil-cep-geocoordinates-logistics-auditor`) Actor

Batch geocodes and validates Brazilian 8-digit postal codes (CEPs) via BrasilAPI v2 & ViaCEP fallback. Extracts Latitude/Longitude, 7-digit IBGE city code (for NF-e/CT-e), state UF, neighborhood, and Last-Mile Delivery Scores (0-100).

- **URL**: https://apify.com/b2b-quant-apis/brazil-cep-geocoordinates-logistics-auditor.md
- **Developed by:** [Jesley Tassili de Oliveira Aguileira](https://apify.com/b2b-quant-apis) (community)
- **Categories:** AI, E-commerce, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$10.00 / 1,000 brazil cep geocoordinates & ibge city code auditeds

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

## Brazil CEP Geocoordinates, IBGE Code & Logistics Auditor (`MCP Server` + `n8n Ready` + `REST API`)

[![MCP Server Enabled](https://img.shields.io/badge/MCP_Server-Streamable_HTTP_%26_SSE-6366F1?style=for-the-badge)](https://mcp.apify.com/?actors=b2b-quant-apis/brazil-cep-geocoordinates-logistics-auditor)
[![n8n Workflow Template](https://img.shields.io/badge/n8n-Download_Ready_Workflow-FF6D5A?style=for-the-badge\&logo=n8n)](https://raw.githubusercontent.com/jesleytassili-glitch/b2b-quant-mcp-n8n-suite/main/n8n_creator_hub_templates/brazil-cep-geocoordinates-logistics-auditor.n8n.json)
[![OpenAPI 3.1](https://img.shields.io/badge/OpenAPI_3.1-Stateless_JSON_API-00C853?style=for-the-badge)](https://github.com/jesleytassili-glitch/b2b-quant-mcp-n8n-suite)

**Batch geocodes and validates Brazilian 8-digit postal codes (CEPs) via BrasilAPI v2 & ViaCEP fallback. Extracts Latitude/Longitude, 7-digit IBGE city code (for NF-e/CT-e), state UF, neighborhood, and Last-Mile Delivery Scores (0-100).**

Engineered by **[@b2b-quant-apis](https://apify.com/b2b-quant-apis)** for **scheduled Machine-to-Machine (`n8n` / `Make.com`) pipelines**, **Autonomous AI Agents (`Claude Desktop`, `Cursor IDE`, `LangChain`, `CrewAI`)**, and **Enterprise Compliance & RevOps stacks**.

***

### Why Choose `b2b-quant-apis/brazil-cep-geocoordinates-logistics-auditor`?

1. **Zero-Proxy & Zero-External-Key Architecture**: Connects directly to official primary registries and public regulatory endpoints with deterministic input sanitization and automatic retry/backoff.
2. **Quantitative Risk & Opportunity Scoring (`0–100`)**: Every output record includes a normalized quantitative score and an executive **Markdown Dossier** ready for RAG vector databases, Slack/Teams alerts, or CRM enrichment.
3. **Native Model Context Protocol (MCP) Server**: Connect directly to **Claude Desktop**, **Cursor**, **Windsurf**, or any MCP client in 1 click without deploying local infrastructure.
4. **Predictable Pay-Per-Event Pricing**: You only pay **`$0.01 USD`** per successfully processed record (`cep-geo-audited`). Zero monthly subscription fees.

***

### Transparent Pay-Per-Event (PPE) Pricing

| Billing Event Name | Event Title | Price per Event (USD) | Categories |
| :--- | :--- | :---: | :--- |
| **`cep-geo-audited`** | Brazil CEP Geocoordinates & IBGE City Code Audited | **`$0.01 USD`** | `AI, ECOMMERCE, AUTOMATION` |

> **Negative Profit Protection**: Failed queries, empty responses, or invalid inputs return cleanly without triggering event charges.

***

### Input Parameters

| Parameter | Type | Required | Default | Description |
| :--- | :---: | :---: | :--- | :--- |
| `ceps` | `string` | **Yes** | `"01310100,20040002,30140071"` | Comma-separated Brazilian postal codes (e.g., '01310100, 20040002, 30140071'). |
| `maxResults` | `integer` | **Optional** | `10` | Maximum number of CEP records to return (1 to 100). |

#### Example Input JSON

```json
{
  "ceps": "01310100,20040002,30140071",
  "maxResults": 5
}
```

***

### Output Dataset Schema

Each run pushes structured JSON items to the default Apify Dataset with the following fields:

| Field Name | Type | Description |
| :--- | :---: | :--- |
| `cep` | `string` | **CEP (8 Digits)** — Standardized 8-digit Brazilian postal code. |
| `stateUf` | `string` | **State UF** — Two-letter Brazilian state code. |
| `cityName` | `string` | **City / Municipality** — Official municipality name. |
| `neighborhood` | `string` | **Neighborhood / Bairro** — District or neighborhood. |
| `street` | `string` | **Street / Logradouro** — Street address. |
| `ibgeCityCode` | `string` | **IBGE 7-Digit City Code** — Official 7-digit IBGE municipality code for NF-e/CT-e. |
| `latitude` | `number` | **Latitude** — WGS84 Latitude coordinate. |
| `longitude` | `number` | **Longitude** — WGS84 Longitude coordinate. |
| `logisticsReadinessScore` | `integer` | **Logistics & NF-e Readiness Score (0-100)** — Quantitative score for last-mile routing and tax invoice completeness (0-100). |
| `markdownLogisticsDossier` | `string` | **Markdown Logistics & NF-e Dossier** — Executive report for e-commerce, TMS/WMS, and ERP tax engines. |

#### Example Output JSON

```json
[
  {
    "cep": "Sample CEP (8 Digits)",
    "stateUf": "Sample State UF",
    "cityName": "Sample City / Municipality",
    "neighborhood": "Sample Neighborhood / Bairro",
    "street": "Sample Street / Logradouro",
    "ibgeCityCode": "Sample IBGE 7-Digit City Code",
    "latitude": 1500.5,
    "longitude": 1500.5,
    "logisticsReadinessScore": 92,
    "markdownLogisticsDossier": "Sample Markdown Logistics & NF-e Dossier"
  }
]
```

***

### 1-Click MCP Server Integration (Claude Desktop & Cursor IDE)

Add `b2b-quant-apis/brazil-cep-geocoordinates-logistics-auditor` as an AI Agent tool in **Claude Desktop** (`claude_desktop_config.json`) or **Cursor IDE** (`.cursor/mcp.json`):

```json
{
  "mcpServers": {
    "brazil-cep-geocoordinates-logistics-auditor": {
      "command": "npx",
      "args": [
        "-y",
        "@apify/actors-mcp-server",
        "--actors",
        "b2b-quant-apis/brazil-cep-geocoordinates-logistics-auditor"
      ],
      "env": {
        "APIFY_TOKEN": "<YOUR_APIFY_API_TOKEN>"
      }
    }
  }
}
```

- **Hosted Streamable HTTP MCP URL:** `https://mcp.apify.com/?actors=b2b-quant-apis/brazil-cep-geocoordinates-logistics-auditor`

***

### Automated Daily `n8n` Workflow Template

Download the pre-built, sanitized **n8n workflow template** with a daily `Schedule Trigger` (`07:00 AM`), `HTTP Request` node, and `CRM/Slack Webhook Router`:

- **Direct Download (`.n8n.json`):** [brazil-cep-geocoordinates-logistics-auditor.n8n.json](https://raw.githubusercontent.com/jesleytassili-glitch/b2b-quant-mcp-n8n-suite/main/n8n_creator_hub_templates/brazil-cep-geocoordinates-logistics-auditor.n8n.json)
- **Enterprise Multi-Actor Super-Pipelines:** [GitHub Repository `jesleytassili-glitch/b2b-quant-mcp-n8n-suite`](https://github.com/jesleytassili-glitch/b2b-quant-mcp-n8n-suite)

***

### Direct Stateless REST API Call (`cURL` Synchronous JSON)

Call this Actor synchronously as a standard HTTP POST micro-API and receive the JSON dataset array directly in the HTTP response:

```bash
curl -X POST "https://api.apify.com/v2/acts/b2b-quant-apis~brazil-cep-geocoordinates-logistics-auditor/run-sync-get-dataset-items" \
  -H "Authorization: Bearer <YOUR_APIFY_API_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"ceps": "01310100,20040002,30140071", "maxResults": 5}'
```

***

### Frequently Asked Questions (FAQ)

#### 1. Do I need to configure residential proxies or third-party API keys?

No. `b2b-quant-apis/brazil-cep-geocoordinates-logistics-auditor` runs out-of-the-box with zero external API keys and zero paid proxy requirements.

#### 2. Can I chain this Actor with other B2B compliance and lead enrichment tools?

Yes. Explore the full **25-Actor B2B Quant & Regulatory Suite** at **[apify.com/b2b-quant-apis](https://apify.com/b2b-quant-apis/brazil-cep-geocoordinates-logistics-auditor)** or import our **5 Multi-Actor Waterfall Pipelines** from **[GitHub (`jesleytassili-glitch/b2b-quant-mcp-n8n-suite`)](https://github.com/jesleytassili-glitch/b2b-quant-mcp-n8n-suite)**.

# Actor input Schema

## `ceps` (type: `string`):

Comma-separated Brazilian postal codes (e.g., '01310100, 20040002, 30140071').

## `maxResults` (type: `integer`):

Maximum number of CEP records to return (1 to 100).

## Actor input object example

```json
{
  "ceps": "01310100,20040002,30140071",
  "maxResults": 10
}
```

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("b2b-quant-apis/brazil-cep-geocoordinates-logistics-auditor").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("b2b-quant-apis/brazil-cep-geocoordinates-logistics-auditor").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 '{}' |
apify call b2b-quant-apis/brazil-cep-geocoordinates-logistics-auditor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,b2b-quant-apis/brazil-cep-geocoordinates-logistics-auditor"
        }
    }
}
```

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/sjcgeOiBFlH4OVXl3/builds/QqcK9Xi5Lkrv9wTLl/openapi.json
