
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.
correios-api-client
Advanced tools
A lightweight client for interfacing with the Correios API. Facilitates seamless integration of Brazil's postal services into JavaScript applications, including features for tracking, delivery estimates, pricing, and address lookup (CEP).
A Node.js client for the Correios API, allowing for easy integration and management of various Correios services such as Token, Price, Deadline, CEP, and Tracking.
npm install correios-api-client
Firstly, you need to initialize the API client with your configuration.
const apiClient = require('correios-api-client');
const configuration = {
ambiente: "PRODUCAO",
idCorreios: "00000000",
codigoAcesso: "xxxxxxxxxxxxxx",
contrato: "000000000",
}
apiClient.initialize(configuration);
Authenticate with the Correios API to receive tokens.
const token = await apiClient.Token.autentica();
const tokenCartaoPostagem = await apiClient.Token.autenticaCartaoPostagem();
const tokenContrato = await apiClient.Token.autenticaContrato();
Search for an address by CEP or retrieve multiple addresses.
const endereco = await apiClient.Cep.search("85070555");
const enderecos = await apiClient.Cep.searchMany(["85070555", "85070200"]);
Calculate the delivery timeframe for national packages.
const prazo = await apiClient.Prazo.nacional("04014", "85070555", "85070200");
Track parcels using the tracking number.
const rastro = await apiClient.Rastro.search("LX697446262CN");
Get the estimated price for a package delivery.
const consultaPreco = {
alturaCm: 20,
cepDestino: "85070555",
cepOrigem: "85070222",
comprimentoCm: 20,
diametroCm: 0,
tipoObjeto: TiposObjeto.Pacote,
larguraCm: 20,
pesoEmGramas: 300,
codigoProduto: "03220",
isAvisoRecebimento: false,
isMaoPropria: false,
valorDeclarado: 200
};
const preco = await apiClient.Preco.nacional(consultaPreco);
The library uses various interfaces and enums to represent data structures.
interface Token {
readonly ambiente: "PRODUCAO" | "HOMOLOGACAO";
// ... other properties ...
}
enum CorreiosAPIs {
Token = 5,
Preco = 34,
Prazo = 35,
Cep = 41,
Rastro = 87
}
interface Endereco {
readonly cep: string;
// ... other properties ...
}
interface Prazo {
public readonly coProduto: string;
// ... other properties ...
}
interface Rastro {
readonly versao: string;
// ... other properties ...
}
interface Objeto {
codObjeto: string;
// ... other properties ...
}
For the complete list of interfaces and their properties, please refer to the source code.
Pull requests and issues are welcome. If you encounter any bugs or want to suggest enhancements, please create an issue.
This library is open-sourced and licensed under the MIT License.
FAQs
A lightweight client for interfacing with the Correios API. Facilitates seamless integration of Brazil's postal services into JavaScript applications, including features for tracking, delivery estimates, pricing, and address lookup (CEP).
We found that correios-api-client 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.