# SP Alvarás de Obras — Aprova Digital (`guzik_andre/sp-alvaras-obras`) Actor

Baixa e normaliza o relatório mensal oficial de alvarás de obra emitidos pela SMUL/Aprova Digital (Prefeitura de São Paulo).

- **URL**: https://apify.com/guzik\_andre/sp-alvaras-obras.md
- **Developed by:** [Andre Guzik](https://apify.com/guzik_andre) (community)
- **Categories:** Real estate, Lead generation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$5.90 / 1,000 resultados

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?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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

## SP Alvarás de Obras — Aprova Digital

Todo mês a Prefeitura de São Paulo aprova centenas de alvarás de construção,
reforma e certificados de conclusão — e publica um relatório oficial em
Excel, mas cru: sem separar lotes, sem categorizar o tipo de obra, sem
histórico consultável. Este Actor baixa o relatório mensal oficial (SMUL /
Portal de Licenciamento — Aprova Digital), limpa e normaliza os dados, e
devolve um dataset estruturado — pronto pra lead-gen imobiliário, PropTech,
seguro de obra ou monitoramento de concorrência na construção civil.

### O que você recebe, por alvará

- `data_deferimento` — data da aprovação (ISO `YYYY-MM-DD`)
- `processo_aprova_digital` / `processo_sei` — números de processo oficiais
- `descricao` — descrição original do tipo de alvará
- `categoria` — classificação normalizada: `edificacao_nova`, `reforma`,
  `certificado_conclusao`, `projeto_modificativo` ou `outro`
- `his_hmp` — `true`/`false`, se é habitação de interesse social
- `sqls` — lista dos códigos de lote (SQL/IPTU) atingidos pelo alvará —
  cruzável com a camada `LOTES` do GeoSampa pra virar endereço
- `mes_referencia` — mês/ano do relatório de origem

### Exemplo de saída

```json
{
  "data_deferimento": "2026-08-14",
  "processo_aprova_digital": "3067-21-SP-REF",
  "processo_sei": "1020.2021/0007187-3",
  "descricao": "Alvará de Aprovação e Execução de Reforma (Exceto HIS e HMP)",
  "categoria": "reforma",
  "his_hmp": false,
  "sqls": ["12019400056"],
  "mes_referencia": "2026-agosto"
}
```

### Input

| Campo | Obrigatório | Descrição |
|---|---|---|
| `mes` | Não | Mês em português sem acento (`marco`, `julho`, ...). Se omitido, usa o mês mais recente disponível. |
| `ano` | Não | Ano (ex.: `2026`). Se omitido, usa o mais recente disponível. |

Sem input nenhum, o Actor busca sozinho o relatório do mês mais recente
publicado.

### Fonte dos dados

Relatório mensal público da SMUL (`prefeitura.sp.gov.br/web/licenciamento`),
sistema Aprova Digital — sem login, sem CAPTCHA, atualizado mensalmente
desde dez/2020. Este Actor não faz scraping de HTML nem automação de
navegador: baixa o arquivo oficial já publicado e normaliza — mais estável
e mais rápido que qualquer scraper de página.

### Limitações conhecidas

- O relatório cobre só alvarás emitidos pelo sistema Aprova Digital
  (obras de pequeno/médio porte) — grandes empreendimentos sujeitos a
  licenciamento ambiental (CADES) não aparecem aqui.
- `sqls` traz o código de lote bruto — este Actor não cruza com o endereço
  legível (fica pra uma versão futura, ou pra combinar com um Actor de
  geocodificação separado).

### Pagamento — inclusive por agente de IA (x402)

Além da cobrança normal pela sua conta Apify, este Actor aceita pagamento
via **protocolo x402**: um agente de IA pode rodar e pagar em USDC (rede
Base) **sem conta Apify, sem API key e sem aprovação humana** — recebe um
desafio HTTP 402, autoriza o pagamento a partir da própria carteira, e o
Actor roda na hora. Mesmo preço por resultado, é só mais um jeito de
pagar. Funciona tanto chamando o Actor direto pela API da Apify quanto via
MCP (`search-actors` / `call-actor`) — não precisa pré-configurar nada.

### Actors relacionados

Se você usa este dado pra due diligence de obra/fornecedor, veja também:
**CRF-SP — Consulta de Situação Cadastral**, **PROCON-SP — Empresas
Autuadas (Multas)** e **PROCON-PR — Reclamações contra Fornecedor**, do
mesmo desenvolvedor.

# Actor input Schema

## `mes` (type: `string`):

Mês do relatório, em português sem acento (ex.: "marco", "julho"). Deixe em branco para usar o mês mais recente disponível.

## `ano` (type: `string`):

Ano do relatório (ex.: "2026"). Deixe em branco para usar o mais recente disponível.

## Actor input object example

```json
{}
```

# Actor output Schema

## `alvaras` (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("guzik_andre/sp-alvaras-obras").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("guzik_andre/sp-alvaras-obras").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 guzik_andre/sp-alvaras-obras --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,guzik_andre/sp-alvaras-obras"
        }
    }
}
```

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/nZWtPww6asDfEmmR4/builds/LZe4AEYI1faa4wdYb/openapi.json
