MCPcopy Create free account
hub / github.com/BrasilAPI/BrasilAPI / fetchOpenCep

Function fetchOpenCep

services/cep/cep.js:18–31  ·  view source on GitHub ↗
(cep)

Source from the content-addressed store, hash-verified

16}
17
18async function fetchOpenCep(cep) {
19 const { data } = await axios.get(`https://opencep.com/v1/${cep}`, {
20 timeout: DEFAULT_TIMEOUT,
21 });
22
23 return {
24 cep: onlyDigits(data.cep),
25 state: data.uf,
26 city: data.localidade,
27 neighborhood: data.bairro,
28 street: data.logradouro,
29 service: 'open-cep',
30 };
31}
32
33async function updateOpenCep(cep) {
34 await axios.get(`https://update.opencep.com/${cep}`, {

Callers 1

fetchCepFunction · 0.85

Calls 1

onlyDigitsFunction · 0.85

Tested by

no test coverage detected