# BrasilAPI API

> Returns Brazilian postal code addresses, banks, area codes, national holidays and company registry data by CNPJ.

Category: Government & Open Data. Region: BR. 15 endpoints at `https://api.hoshime.com/v1/brasilapi/<endpoint>`, `GET` with query parameters, answering `{data, meta}` (see https://hoshime.com/docs/responses.md). Reference: https://hoshime.com/docs/platforms/brasilapi
## GET /v1/brasilapi/cep

The address of a Brazilian postal code (CEP): state, city, neighbourhood, street and position.

Scope: `social:read` · Units: 1 · Cached: 1440 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `cep` | string | yes | CEP with eight digits, such as 01001000. (e.g. 01001000) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `cep` (string), `city` (string), `latitude` (number (double)), `longitude` (number (double)), `neighborhood` (string), `state` (string), `street` (string), `timezone` (string)

```bash
curl "https://api.hoshime.com/v1/brasilapi/cep?cep=01001000" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/brasilapi/bank

A bank authorised in Brazil, by its code, with its full name and ISPB.

Scope: `social:read` · Units: 1 · Cached: 1440 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `code` | string | yes | Bank code, such as 237 for Bradesco. (e.g. 237) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `code` (integer (int64)), `fullName` (string), `ispb` (string), `name` (string)

```bash
curl "https://api.hoshime.com/v1/brasilapi/bank?code=237" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/brasilapi/ddd

The state and cities that use a Brazilian area code (DDD).

Scope: `social:read` · Units: 1 · Cached: 1440 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `ddd` | string | yes | Two-digit area code, such as 11. (e.g. 11) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `cities` (string[]), `state` (string)

```bash
curl "https://api.hoshime.com/v1/brasilapi/ddd?ddd=11" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/brasilapi/holidays

The national holidays of Brazil in one year.

Scope: `social:read` · Units: 1 · Cached: 1440 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `year` | integer | yes | Year, from 1900 to 2100. (e.g. 2024) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `date` (string), `name` (string), `type` (string), `weekday` (string)

```bash
curl "https://api.hoshime.com/v1/brasilapi/holidays?year=2024" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/brasilapi/cnpj

A Brazilian company registered with the Receita Federal by its CNPJ: name, status, activity, address, capital and size.

Scope: `social:read` · Units: 1 · Cached: 1440 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `cnpj` | string | yes | CNPJ with 14 digits, such as 00000000000191. (e.g. 00000000000191) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `capitalStock` (number (double)), `city` (string), `cnpj` (string), `complement` (string), `email` (string), `legalName` (string), `legalNature` (string), `mainActivity` (string), `neighbourhood` (string), `number` (string), `partnersCount` (integer (int64)), `secondaryActivities` (string[]), `size` (string), `startDate` (string), `state` (string), `status` (string), `street` (string), `tradeName` (string), `zip` (string)

```bash
curl "https://api.hoshime.com/v1/brasilapi/cnpj?cnpj=00000000000191" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/brasilapi/banks

Every bank authorised in Brazil with its code, ISPB and full name.

Scope: `social:read` · Units: 1 · Cached: 1440 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `code` (integer (int64)), `fullName` (string), `ispb` (string), `name` (string)

```bash
curl "https://api.hoshime.com/v1/brasilapi/banks" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/brasilapi/ibgeStates

The 27 federative units of Brazil with their IBGE code, abbreviation, region and capital.

Scope: `social:read` · Units: 1 · Cached: 1440 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `abbreviation` (string), `capital` (string), `id` (string), `name` (string), `region` (string)

```bash
curl "https://api.hoshime.com/v1/brasilapi/ibgeStates" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/brasilapi/interestRates

The current Brazilian reference rates in per cent: Selic, CDI and IPCA, as the Central Bank publishes them.

Scope: `social:read` · Units: 1 · Cached: 60 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `name` (string), `value` (number (double))

```bash
curl "https://api.hoshime.com/v1/brasilapi/interestRates" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/brasilapi/fipeBrands

The vehicle brands in the FIPE price table for one vehicle type, with the FIPE code of each brand.

Scope: `social:read` · Units: 1 · Cached: 1440 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `vehicleType` | string | no | carros (cars), motos (motorcycles) or caminhoes (trucks). (one of carros, motos, caminhoes; default carros; e.g. carros) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `code` (string), `name` (string)

```bash
curl "https://api.hoshime.com/v1/brasilapi/fipeBrands?vehicleType=carros" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/brasilapi/fipeModels

The vehicle models of one brand in the FIPE price table, with the FIPE code of each model. Each model name carries its version and engine.

Scope: `social:read` · Units: 1 · Cached: 1440 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `vehicleType` | string | no | carros (cars), motos (motorcycles) or caminhoes (trucks). (one of carros, motos, caminhoes; default carros; e.g. carros) |
| `brand` | integer | yes | FIPE brand code from fipeBrands, such as 21 for Fiat. (e.g. 21) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `code` (string), `name` (string)

```bash
curl "https://api.hoshime.com/v1/brasilapi/fipeModels?vehicleType=carros&brand=21" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/brasilapi/ncm

One Mercosur trade code (NCM) with its description and the dates it is valid.

Scope: `social:read` · Units: 1 · Cached: 1440 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `code` | string | yes | NCM code with 8 digits, such as 01012100. (e.g. 01012100) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `code` (string), `description` (string), `validFrom` (string), `validTo` (string)

```bash
curl "https://api.hoshime.com/v1/brasilapi/ncm?code=01012100" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/brasilapi/isbn

A book by its ISBN: title, authors, publisher and year, from the Brazilian ISBN agency and open catalogues.

Scope: `social:read` · Units: 1 · Cached: 10080 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `isbn` | string | yes | ISBN with 10 or 13 digits, such as 9788535902778. (e.g. 9788535902778) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `authors` (string[]), `isbn` (string), `publisher` (string), `subtitle` (string), `title` (string), `year` (string)

```bash
curl "https://api.hoshime.com/v1/brasilapi/isbn?isbn=9788535902778" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/brasilapi/domain

The registration status of a .br domain at Registro.br: whether it is taken, its name servers and expiry.

Scope: `social:read` · Units: 1 · Cached: 60 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `domain` | string | yes | Domain name ending in .br, such as google.com.br. (e.g. google.com.br) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `domain` (string), `expiresAt` (string), `hosts` (string[]), `status` (string)

```bash
curl "https://api.hoshime.com/v1/brasilapi/domain?domain=google.com.br" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/brasilapi/weatherCities

The Brazilian cities the CPTEC weather service knows whose name matches the text, with the id to forecast them by.

Scope: `social:read` · Units: 1 · Cached: 1440 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `query` | string | yes | Text in the city name, such as sao paulo. (e.g. sao paulo) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `id` (string), `name` (string), `region` (string), `state` (string)

```bash
curl "https://api.hoshime.com/v1/brasilapi/weatherCities?query=sao+paulo" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/brasilapi/weatherForecast

The daily weather forecast of one Brazilian city from CPTEC/INPE: condition, temperatures and UV index for each day.

Scope: `social:read` · Units: 1 · Cached: 60 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `cityId` | integer | yes | CPTEC city id, such as 244 for São Paulo (see weatherCities). (e.g. 244) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `city` (string), `days` (ForecastDay[]), `days[].condition` (string), `days[].conditionText` (string), `days[].date` (string), `days[].maxCelsius` (integer (int64)), `days[].minCelsius` (integer (int64)), `days[].uvIndex` (number (double)), `issuedDate` (string), `state` (string)

```bash
curl "https://api.hoshime.com/v1/brasilapi/weatherForecast?cityId=244" -H "Authorization: Bearer $HOSHIME_TOKEN"
```
