
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
api-estadosdobrasil
Advanced tools
The aim is to assist in querying Brazilian states and their cities, whether for use in user registration forms or even for filtering data in tracking tables or similar generic tasks.
We intentionally keep it simple by not providing information such as ZIP codes, street names, or neighborhood names.
Install the package api-estadosdobrasil in your project.
npm install api-estadosdobrasil
yarn add api-estadosdobrasil
bun add api-estadosdobrasil
There are several ways you can consume this API. You can simply:
Install the dependency and import Brasil, then assign it to a variable in your project.
import Brasil from 'api-estadosdobrasil'
const myEstados = Brasil.estados // To get all state information
const myCidades = Brasil.cidades // To get all city information
And how do I specifically get information about the city of Campinas, located in the interior of São Paulo, if I want to consume it?
import Brasil from 'api-estadosdobrasil'
const Campinas = Brasil.cidades.siglaEstado['SP'].nome['Campinas']
To consume only the name of the state of São Paulo:
import Brasil from 'api-estadosdobrasil'
const SP = Brasil.estados.id['SP'].nome
Of course, you can filter and customize this according to your preferences.
Another way is to fetch directly from the route or from the repository file.
fetch("https://api.github.com/users/Yagasaki7K")
.then(response => response.json())
.then(data => {
setDataAPI(data) // If you're using a State of React for example.
let data = JSON.stringify(data) // If you're using a variable.
});
2.1 Fetch directly from the file in the repository - less recommended.
fetch("https://github.com/Yagasaki7K/api-estadosdobrasil/blob/main/database.json")
.then(response => response.text())
.then(data => {
setDataAPI(data) // If you're using a State of React for example.
let data = JSON.stringify(data) // If you're using a variable.
});
If you have ideas, you can contribute to the repository on GitHub, following the basic concepts of a pull request - we don't have a specific template for this.
bun test v1.1.4 (fbe2fe0c)
index.test.ts:
✓ Brasil object should be imported correctly [1.04ms]
✓ Should have states in the list of states [0.03ms]
✓ Should have cities in the list of cities [0.03ms]
✓ Campinas should be in the list of cities of São Paulo [1.20ms]
✓ São Paulo state should be in the list of states [0.03ms]
5 pass
FAQs
A better way to format and get details about your variables
We found that api-estadosdobrasil demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.