# Brazil Health Facilities (CNES, CNPJ, phone) (`latsouth/brazil-health-facilities`) Actor

360k Brazilian hospitals, clinics, labs and pharmacies from DATASUS CNES: CNPJ, facility type, public/private sphere, SUS, beds, address, geo, phone, role e-mail, verified website, joined to the CNPJ registry. Company data only.

- **URL**: https://apify.com/latsouth/brazil-health-facilities.md
- **Developed by:** [LatSouth Data](https://apify.com/latsouth) (community)
- **Categories:** Lead generation, Business
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$5.00 / 1,000 facility records

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 Health Facilities: hospitals, clinics, labs and pharmacies with CNPJ, phone and SUS status (CNES)

**By [LatSouth](https://latsouth.com).** **360,530 Brazilian health facilities** run by legal entities, from the
Ministry of Health's national registry (**DATASUS / CNES**), cleaned, translated to English and joined to the federal
company registry (CNPJ). Filter by facility type, public or private sphere, SUS, beds, state and city; get the
facility's registered phone, role e-mail, verified website, address and coordinates. Pay only for the rows you get.

### Quick facts

| | |
|---|---|
| Rows | 360,530 facilities (one row per CNES code), 263,923 distinct CNPJs, all 27 states |
| Hospitals | 8,264 (528,420 beds) · outpatient clinics/offices 203,936 · diagnostics (labs, imaging) 31,084 · pharmacies 29,225 · primary care 52,736 · emergency 8,391 |
| Private | 256,179 (for-profit 245,024, non-profit 11,155); public: municipal 96,876, state 4,748, federal 1,704 |
| Serve SUS | 129,398 · accept health plans 134,684 · private and SUS-free 230,520 |
| With a phone | 190,708 (52.9%), validated +55 numbers |
| With a role e-mail | 25,803 (7.2%), e.g. contato@, faturamento@, saude@, on the facility's own domain |
| With a verified website | 60,999 (16.9%), HTTP-checked |
| Matched to the CNPJ registry | 95.6% (adds registry legal name, company size, opening date, main CNAE) |
| Coordinates | 100% (latitude/longitude inside Brazil) |
| Data as of | CNES competence 2026-09, records updated up to 2026-10-09 (`data_as_of` on every row) |
| Price | **US$0.005 per facility returned: 1,000 facilities = US$5**; 10 = US$0.05 |
| Company data only | No CPF, no individual practitioners, no sole traders, no personal mailboxes |

### Who it's for

- **Medtech and medical-equipment sales**: "general hospitals in the South with 100+ beds", "private imaging centers
  in São Paulo", with a phone to call and the purchasing CNPJ to quote.
- **Pharma, diagnostics and supplies distributors**: pharmacies, labs and clinics by city, with SUS / private-pay /
  health-plan flags to size the channel.
- **Healthtech (scheduling, EHR, billing, telehealth)**: private clinics and specialty centers that do **not** serve
  SUS (`sus: non_sus_only`), with a verified website.
- **Market sizing and territory planning**: every run reports `total_matching` in `OUTPUT`, even if you pull 10 rows.

### How it is built

1. **Source**: the official monthly *Base de dados CNES* published by DATASUS (all states, every establishment).
2. **Company-only filter**: keep establishments registered as **pessoa jurídica** (`TP_PFPJ = 3`) that are **active**,
   drop natural persons (171k consultórios identified by CPF), sole traders and MEI (legal nature 2135) and every
   other natural-person nature. Each kept row has a check-digit-valid **CNPJ**: its own (`cnpj`) or, for public units
   and branches registered under the maintaining entity, the **maintainer's** (`cnpj_maintainer`);
   `company_cnpj` is the one to use for invoicing/quoting.
3. **Decoding**: facility type (CNES `TP_UNIDADE`) in English + a broad category, legal nature in English,
   administrative **sphere** (federal / state / municipal / private for-profit / private non-profit) from the legal
   nature, SUS / private-pay / health-plan payers and attendance types (inpatient, outpatient, diagnostics,
   emergency), beds and number of specialized services, city from the IBGE code.
4. **Contacts**: phone and e-mail are the ones the facility registered in CNES, kept only when they pass the rules
   below. Website = the company registry's HTTP-verified site, else the CNES-declared URL or the facility's own e-mail
   domain, each HTTP-checked (2xx/3xx, not parked).
5. **Registry join**: by CNPJ to the Receita Federal company registry (release 2026-10-10): registry legal name,
   company size (micro / small / other), opening date, main CNAE in English.

### Compliance rules (what is never returned)

- No CPF, no clinical director CPF/registration, no CNES user names, no bank data.
- No establishment registered as a natural person, no sole trader / MEI.
- **Phone**: Brazilian format only (+55, known area code, 8-digit landline 2-5 or 9-digit mobile 9). Numbers without
  an area code or old 8-digit mobiles are dropped; **no digit is ever added**. A number registered by more than 3
  different companies (billing agencies, accountants) is dropped.
- **E-mail**: only role/generic mailboxes (contato@, atendimento@, faturamento@, saude@, agendamento@ ...) on a
  non-free-mail domain. Nominal mailboxes (joao.silva@), Gmail/Hotmail/Yahoo/ISP addresses and accountants' or
  registration agents' mailboxes are never returned.

### Input

| Field | What it does |
|---|---|
| `states`, `cities` | UF codes and city names (accents optional). Selecting states makes runs faster. |
| `facility_categories` | hospital, primary_care, outpatient, diagnostics, pharmacy, emergency, services, management, public_health, mobile, other |
| `facility_types` | Official CNES unit types, e.g. `05` general hospital, `07` specialized hospital, `36` specialty clinic, `39` diagnostic unit, `43` pharmacy, `73` urgent care (OR with categories) |
| `spheres`, `private_only` | Administrative sphere; `private_only` keeps for-profit + non-profit (default **false**) |
| `sus` | `any` (default), `sus_only`, `non_sus_only` |
| `accepts_health_plans` | Only facilities that accept health plans / insurers |
| `min_beds` | Minimum existing beds |
| `keyword` | Substring of the legal/trade name or facility type (e.g. oncologia, cardio, odonto) |
| `only_with_phone`, `only_with_email`, `only_with_website`, `only_with_contact` | Contact filters (`only_with_website` = verified site) |
| `sort_by` | `beds_desc` (default), `services_desc`, `updated_desc`, `cnes` |
| `max_results` | Default 1,000; the run also stops at your spending limit |

Example: `{"states": ["SP"], "facility_categories": ["hospital"], "private_only": true, "min_beds": 50, "only_with_phone": true}`

### Output

One item per facility:

```json
{
  "cnes_code": "2078015", "company_cnpj": "56577059000100", "company_cnpj_source": "own",
  "trade_name": "HC DA FMUSP HOSPITAL DAS CLINICAS SAO PAULO", "facility_type_en": "General hospital",
  "facility_category": "hospital", "sphere": "private_nonprofit", "accepts_sus": true, "beds_total": 1543,
  "city": "SAO PAULO", "state": "SP", "zip": "05403010", "phone": "+551130875456", "phone_type": "landline",
  "email": null, "website": "https://ffm.br/ffm/portal/index.php", "website_verified": true,
  "latitude": -23.5566, "longitude": -46.6723, "registry_matched": true, "company_size": "other",
  "data_as_of": "2026-10-09", "source": "Fonte: DATASUS/CNES - ..."
}
```

Full field list: `cnes_code`, `cnpj`, `cnpj_maintainer`, `company_cnpj`, `company_cnpj_source`, `legal_name`,
`trade_name`, `legal_nature_code`, `legal_nature`, `sphere`, `is_private`, `facility_type_code`, `facility_type_en`,
`facility_type_pt`, `facility_category`, `facility_kind_pt`, `management`, `accepts_sus`, `accepts_private_pay`,
`accepts_health_plans`, `attendance_types`, `beds_total`, `beds_sus`, `n_specialized_services`, `address`,
`district`, `city`, `city_ibge6`, `state`, `zip`, `phone`, `phone_type`, `email`, `website`, `website_verified`,
`website_source`, `latitude`, `longitude`, `updated_at`, `registry_matched`, `registry_legal_name`, `company_size`,
`opening_date`, `registry_cnae_code`, `registry_cnae_label_en`, `competence`, `data_as_of`, `source`, `license`.
Download as JSON, CSV, Excel or XML from the dataset tab or the API.

### Pricing

Pay per event: **US$0.005 per facility returned** (event `record`). 1,000 facilities = US$5. Set a spending limit on
the run and it stops before exceeding it (`OUTPUT.stopped_by_budget`).

### Limitations

- CNES is self-declared by facilities and health managers; phones and e-mails can be outdated. `updated_at` tells you
  when the record was last touched.
- 13% of facilities registered an old 8-digit mobile; we do not guess the missing 9th digit, so those rows have no phone.
- `sphere` follows the legal nature of the CNPJ the facility is registered under: e.g. a public teaching hospital run
  by a private foundation shows as `private_nonprofit`.
- Facility type `16` has no official label in the CNES lookup; it is shown as "Other (CNES type 16)".
- Refreshed monthly with each CNES competence.

### Source and attribution

**Fonte: DATASUS/CNES** — Cadastro Nacional de Estabelecimentos de Saúde, Ministério da Saúde (public data, Lei
12.527/2011). Company fields: Receita Federal do Brasil, Dados Abertos do CNPJ. Data transformed by LatSouth; not an
official Ministry of Health or Receita Federal product. Every row carries `source` and `license`.

### More from LatSouth

- [Brazil Company Finder](https://apify.com/latsouth/brazil-company-finder): 10.9M active CNPJs by CNAE, state, size.
- [Mexico Company Finder](https://apify.com/latsouth/mexico-company-finder): DENUE legal entities with verified websites.
- Full datasets and custom TAM lists: [latsouth.com](https://latsouth.com).

# Actor input Schema

## `states` (type: `array`):

Leave empty for all of Brazil. Selecting states makes runs faster.

## `cities` (type: `array`):

City names as in CNES, accents optional (e.g. Sao Paulo, Campinas, Belo Horizonte).

## `facility_categories` (type: `array`):

Broad groups of CNES unit types. Combined with the unit types below using OR. Leave both empty for all.

## `facility_types` (type: `array`):

Official CNES establishment types (TP_UNIDADE), e.g. 05 General hospital, 39 Diagnostic support unit, 43 Pharmacy.

## `spheres` (type: `array`):

From the legal nature of the facility's CNPJ. Leave empty for all.

## `private_only` (type: `boolean`):

Keep only private facilities (for-profit and non-profit), i.e. drop municipal, state and federal units.

## `sus` (type: `string`):

Based on the payers each facility declares in CNES.

## `accepts_health_plans` (type: `boolean`):

Keep only facilities that declare private or own health plans / insurers as payers.

## `min_beds` (type: `integer`):

Minimum number of existing hospital beds (only hospitals and some clinics report beds).

## `keyword` (type: `string`):

Case- and accent-insensitive substring searched in the legal and trade names and the facility type (e.g. oncologia, cardio, laboratorio, odonto).

## `only_with_phone` (type: `boolean`):

Keep only facilities with a valid registered phone (+55, DDD checked).

## `only_with_email` (type: `boolean`):

Keep only facilities with a role/generic e-mail (contato@, faturamento@, saude@ ...) on their own domain. Personal and Gmail/Hotmail addresses are never output.

## `only_with_website` (type: `boolean`):

Keep only facilities whose website answered an HTTP check (2xx/3xx, not parked).

## `only_with_contact` (type: `boolean`):

Keep only facilities with at least one company contact (phone or role e-mail).

## `sort_by` (type: `string`):

Order of results. Most beds first surfaces the largest hospitals.

## `max_results` (type: `integer`):

You pay per facility returned (US$0.005 each: 1,000 facilities = US$5). The run also stops at your spending limit. Default 1,000 when called via API without this field.

## Actor input object example

```json
{
  "states": [
    "SP"
  ],
  "facility_categories": [
    "hospital"
  ],
  "private_only": false,
  "sus": "any",
  "accepts_health_plans": false,
  "only_with_phone": false,
  "only_with_email": false,
  "only_with_website": false,
  "only_with_contact": false,
  "sort_by": "beds_desc",
  "max_results": 10
}
```

# Actor output Schema

## `facilities` (type: `string`):

Matching facilities, one item per row. Download as JSON, CSV, Excel or XML via the dataset API.

## `summary` (type: `string`):

Counts, applied filters, CNES data_as_of and whether the run stopped at the buyer's budget cap.

# 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 = {
    "states": [
        "SP"
    ],
    "facility_categories": [
        "hospital"
    ],
    "max_results": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("latsouth/brazil-health-facilities").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 = {
    "states": ["SP"],
    "facility_categories": ["hospital"],
    "max_results": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("latsouth/brazil-health-facilities").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 '{
  "states": [
    "SP"
  ],
  "facility_categories": [
    "hospital"
  ],
  "max_results": 10
}' |
apify call latsouth/brazil-health-facilities --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,latsouth/brazil-health-facilities"
        }
    }
}
```

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/CyhXn4DciEWfgRaX2/builds/FEesw4AY9fVwgRfs7/openapi.json
