{"_id":"@br-geo-kit/provider-brasilapi","name":"@br-geo-kit/provider-brasilapi","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@br-geo-kit/provider-brasilapi","version":"1.0.0","description":"BrasilAPI provider for br-geo-kit, with coordinates","license":"MIT","engines":{"node":">=20"},"type":"module","sideEffects":false,"main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"dependencies":{"@br-geo-kit/core":"1.0.0"},"publishConfig":{"access":"public"},"keywords":["brasilapi","cep","endereco","brasil","br-geo-kit"],"repository":{"type":"git","url":"git+https://github.com/arielff3/br-geo-kit.git","directory":"providers/brasilapi"},"homepage":"https://github.com/arielff3/br-geo-kit/tree/main/providers/brasilapi#readme","bugs":{"url":"https://github.com/arielff3/br-geo-kit/issues"},"scripts":{"build":"tsup","clean":"node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\""},"_id":"@br-geo-kit/provider-brasilapi@1.0.0","_integrity":"sha512-NrVH4kgG4dJk+UsKezQHamrrB7d1AYIyBP5vKFAMnN020/k0yMnMZwnudW722w1QT2JLzdKb597syuDYQvLnrg==","_resolved":"C:\\Users\\ariel\\AppData\\Local\\Temp\\4901300e4065f0535a38b6ef49453273\\br-geo-kit-provider-brasilapi-1.0.0.tgz","_from":"file:br-geo-kit-provider-brasilapi-1.0.0.tgz","_nodeVersion":"22.17.1","_npmVersion":"10.9.2","dist":{"integrity":"sha512-NrVH4kgG4dJk+UsKezQHamrrB7d1AYIyBP5vKFAMnN020/k0yMnMZwnudW722w1QT2JLzdKb597syuDYQvLnrg==","shasum":"81e138d2b1cb305e645e89510eecd5bbed7221c9","tarball":"https://registry.npmjs.org/@br-geo-kit/provider-brasilapi/-/provider-brasilapi-1.0.0.tgz","fileCount":10,"unpackedSize":29834,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCkjs+nmrKln3dlSgcEuqNqJiuVh5XiiEQzewBGcq0ODAIhAMkmHSFqK1famFlxoSRCdeZVh/38oW91kGcK9PPpcv23"}]},"_npmUser":{"name":"arielff03","email":"arielfrancoferreira5@gmail.com"},"directories":{},"maintainers":[{"name":"arielff03","email":"arielfrancoferreira5@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/provider-brasilapi_1.0.0_1789134622925_0.7879919939231068"},"_hasShrinkwrap":false}},"time":{"created":"2026-09-11T13:50:22.773Z","1.0.0":"2026-09-11T13:50:23.061Z","modified":"2026-09-11T13:50:23.288Z"},"maintainers":[{"name":"arielff03","email":"arielfrancoferreira5@gmail.com"}],"description":"BrasilAPI provider for br-geo-kit, with coordinates","homepage":"https://github.com/arielff3/br-geo-kit/tree/main/providers/brasilapi#readme","keywords":["brasilapi","cep","endereco","brasil","br-geo-kit"],"repository":{"type":"git","url":"git+https://github.com/arielff3/br-geo-kit.git","directory":"providers/brasilapi"},"bugs":{"url":"https://github.com/arielff3/br-geo-kit/issues"},"license":"MIT","readme":"# @br-geo-kit/provider-brasilapi\n\n> BrasilAPI for br-geo-kit. Fast, geocoded, and an aggregator — which\n> cuts both ways.\n\n```bash\npnpm add @br-geo-kit/cep @br-geo-kit/provider-brasilapi\n```\n\n```ts\nimport { createCep } from '@br-geo-kit/cep'\nimport { brasilapi } from '@br-geo-kit/provider-brasilapi'\n\nconst cep = createCep({ providers: [brasilapi()] })\n```\n\n---\n\n## What it returns\n\n| | |\n| --- | --- |\n| Street, neighbourhood, city, state | yes |\n| Correios side-of-street note | no |\n| IBGE code | yes |\n| Area code | no — the kit fills it from the offline dataset |\n| Coordinates | **yes** |\n| Time zone | yes |\n| Reverse lookup | no |\n\nCoordinates arrive as **strings**. The adapter parses them rather than\ncasting, because `Number('')` is `0` and a silent `(0, 0)` puts every\nunlocated address in the Gulf of Guinea, where it quietly reorders any\ndistance sort it lands in.\n\nBoth the v2 object shape and the v1 bare-string shape of `ibge` are\naccepted, so pointing `baseUrl` at v1 keeps working.\n\n---\n\n## It is an aggregator, and that matters\n\nBrasilAPI queries several bases and returns whichever answers first,\ntelling you which in its `service` field. It inherits that base's errors\nalong with its coverage.\n\nA real example, reproducible today: CEP `99999-999` does not exist in\nthe Correios' base and ViaCEP says so, but the `open-cep` base BrasilAPI\nsometimes falls through to has a record for it in **Sarandi/PR** — a\nmunicipality whose real CEPs start with 871, and a CEP that sits inside\nRio Grande do Sul's block. BrasilAPI returns it confidently, with an\nIBGE code attached.\n\nTwo consequences:\n\n- Pair it with `territory: ibge` and the kit raises a\n  `state-range-mismatch` warning when an answer contradicts the CEP's\n  block.\n- **BrasilAPI and OpenCEP are not independent sources.** They share that\n  base. Two of them agreeing is one opinion, not two — weigh a\n  `consensus` chain accordingly.\n\n---\n\n## Options\n\n```ts\nbrasilapi({ baseUrl: 'https://brasilapi.com.br/api/cep/v1' })\n```\n\n## Rate limits\n\nBrasilAPI publishes no documented rate limit and no SLA. It is\ncommunity-run infrastructure; be a good citizen and cache. See\n[caching](https://github.com/arielff3/br-geo-kit/blob/main/docs/caching.md).\n\n## Licence\n\nMIT.\n\nThis package is an API client and redistributes no data. It is not\naffiliated with, endorsed by, or sponsored by BrasilAPI; the name\nidentifies the service it connects to. BrasilAPI has its own terms of\nuse, and calling it is your relationship with them.\n","readmeFilename":"README.md","_rev":"1-55ed6a4bb018bf2defef7fd7a47e11ec"}